Skip to content

Commit

Permalink
Merge commit '8616dbe4edeb83675ca047c5c66f51c65a4b2cec' into feature/…
Browse files Browse the repository at this point in the history
…updateClangConfig

Signed-off-by: Cervenka Dusan <[email protected]>
  • Loading branch information
Hadatko committed Oct 20, 2023
2 parents 326a65d + 8616dbe commit 714f037
Show file tree
Hide file tree
Showing 213 changed files with 6,466 additions and 2,509 deletions.
49 changes: 38 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,81 @@ version: 2.1
orbs:
win: circleci/[email protected] # The Windows orb gives you everything you need to start using the

commands:
install_dependencies:
parameters:
compiler:
default: ""
type: string
steps:
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh <<parameters.compiler>>
run_tests:
parameters:
compiler:
default: ""
type: string
steps:
- run: chmod u+x run_tests.sh && ./run_tests.sh <<parameters.compiler>>

jobs:
build-linux-gcc:
machine:
image: ubuntu-2204:2022.04.2 #https://circleci.com/developer/machine/image/ubuntu-2204 pick LTS
steps:
- checkout
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh
- run: chmod u+x run_tests.sh && ./run_tests.sh
- install_dependencies
- run_tests
- store_artifacts:
path: ./Release/Linux/erpcgen/erpcgen

build-linux-clang:
machine:
image: ubuntu-2204:2022.04.2 #https://circleci.com/developer/machine/image/ubuntu-2204 pick LTS
steps:
- checkout
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh clang
- run: chmod u+x run_tests.sh && ./run_tests.sh clang
- install_dependencies:
compiler: "clang"
- run_tests:
compiler: "clang"
# - store_artifacts:
# path: ./Release/Linux/erpcgen/erpcgen

build-mac-gcc:
macos:
xcode: 12.5.1 # https://circleci.com/docs/using-macos/#supported-xcode-versions https://en.wikipedia.org/wiki/MacOS_version_history#Releases
resource_class: medium
resource_class: macos.x86.medium.gen2
steps:
- checkout
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh
- run: chmod u+x run_tests.sh && ./run_tests.sh
- install_dependencies
- run_tests
- store_artifacts:
path: ./Release/Darwin/erpcgen/erpcgen

build-mac-clang:
macos:
xcode: 12.5.1 # https://circleci.com/docs/using-macos/#supported-xcode-versions https://en.wikipedia.org/wiki/MacOS_version_history#Releases
resource_class: medium
resource_class: macos.x86.medium.gen2
steps:
- checkout
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh clang
- run: chmod u+x run_tests.sh && ./run_tests.sh clang
- install_dependencies:
compiler: "clang"
- run_tests:
compiler: "clang"
# - store_artifacts:
# path: ./Release/Darwin/erpcgen/erpcgen

build-windows-mingw:
executor:
name: win/default
size: large
steps:
- checkout
- run: powershell.exe .\install_dependencies.ps1
- run: powershell.exe .\mingw64\bin\mingw32-make erpcgen
- run: .\mingw64\bin\mingw32-make all
- run: .\mingw64\opt\bin\python3.exe .\test\run_unit_tests.py -m"..\\..\\mingw64\\bin\\mingw32-make"
# - store_artifacts:
# path: ./Release/MINGW64/erpcgen/erpcgen.exe

build-windows-VS:
executor:
name: win/default
Expand All @@ -65,6 +91,7 @@ jobs:
- run: powershell.exe "& 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe' .\erpcgen\VisualStudio_v14\erpcgen.sln /property:Configuration=Release"
- store_artifacts:
path: ./erpcgen/VisualStudio_v14/Release/erpcgen.exe

workflows:
build-workflow:
jobs:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ To install the Python infrastructure for eRPC see instructions in the [erpc_pyth

## Code providing

Repository on Github contains two main branches. __Master__ and __develop__. Code is developed on __develop__ branch. Release version is created via merging __develop__ branch into __master__ branch.
Repository on Github contains two main branches: __main__ and __develop__. Code is developed on __develop__ branch. Release version is created via merging __develop__ branch into __main__ branch.

---
Copyright 2014-2016 Freescale Semiconductor, Inc.
Expand Down
2 changes: 1 addition & 1 deletion doxygen/Doxyfile.erpc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "eRPC API Reference"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "Rev. 1.10.0"
PROJECT_NUMBER = "Rev. 1.11.0"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
2 changes: 1 addition & 1 deletion doxygen/Doxyfile.erpcgen
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "eRPC Generator (erpcgen)"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "Rev. 1.10.0"
PROJECT_NUMBER = "Rev. 1.11.0"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
8 changes: 6 additions & 2 deletions erpc_c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ SOURCES += $(ERPC_C_ROOT)/infra/erpc_arbitrated_client_manager.cpp \
$(ERPC_C_ROOT)/infra/erpc_server.cpp \
$(ERPC_C_ROOT)/infra/erpc_simple_server.cpp \
$(ERPC_C_ROOT)/infra/erpc_transport_arbitrator.cpp \
$(ERPC_C_ROOT)/infra/erpc_utils.cpp \
$(ERPC_C_ROOT)/infra/erpc_pre_post_action.cpp \
$(ERPC_C_ROOT)/port/erpc_port_stdlib.cpp \
$(ERPC_C_ROOT)/port/erpc_threading_pthreads.cpp \
$(ERPC_C_ROOT)/port/erpc_serial.cpp \
$(ERPC_C_ROOT)/setup/erpc_arbitrated_client_setup.cpp \
$(ERPC_C_ROOT)/setup/erpc_client_setup.cpp \
$(ERPC_C_ROOT)/setup/erpc_setup_mbf_dynamic.cpp \
Expand All @@ -72,8 +72,11 @@ SOURCES += $(ERPC_C_ROOT)/infra/erpc_arbitrated_client_manager.cpp \
$(ERPC_C_ROOT)/setup/erpc_setup_serial.cpp \
$(ERPC_C_ROOT)/setup/erpc_setup_tcp.cpp \
$(ERPC_C_ROOT)/transports/erpc_inter_thread_buffer_transport.cpp \
$(ERPC_C_ROOT)/transports/erpc_serial_transport.cpp \
$(ERPC_C_ROOT)/transports/erpc_tcp_transport.cpp
ifeq "$(is_mingw)" ""
SOURCES += $(ERPC_C_ROOT)/transports/erpc_serial_transport.cpp \
$(ERPC_C_ROOT)/port/erpc_serial.cpp
endif

HEADERS += $(ERPC_C_ROOT)/config/erpc_config.h \
$(ERPC_C_ROOT)/infra/erpc_arbitrated_client_manager.hpp \
Expand All @@ -91,6 +94,7 @@ HEADERS += $(ERPC_C_ROOT)/config/erpc_config.h \
$(ERPC_C_ROOT)/infra/erpc_static_queue.hpp \
$(ERPC_C_ROOT)/infra/erpc_transport_arbitrator.hpp \
$(ERPC_C_ROOT)/infra/erpc_transport.hpp \
$(ERPC_C_ROOT)/infra/erpc_utils.hpp \
$(ERPC_C_ROOT)/infra/erpc_client_server_common.hpp \
$(ERPC_C_ROOT)/infra/erpc_pre_post_action.h \
$(ERPC_C_ROOT)/port/erpc_setup_extensions.h \
Expand Down
63 changes: 2 additions & 61 deletions erpc_c/infra/erpc_basic_codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,38 +158,7 @@ void BasicCodec::startWriteUnion(int32_t discriminator)

void BasicCodec::writeNullFlag(bool isNull)
{
write(static_cast<uint8_t>(isNull ? kIsNull : kNotNull));
}

void BasicCodec::writeCallback(arrayOfFunPtr callbacks, uint8_t callbacksCount, funPtr callback)
{
uint8_t i;

erpc_assert(callbacksCount > 1U);

// callbacks = callbacks table
for (i = 0; i < callbacksCount; i++)
{
if (callbacks[i] == callback)
{
write(i);
break;
}
if ((i + 1U) == callbacksCount)
{
updateStatus(kErpcStatus_UnknownCallback);
}
}
}

void BasicCodec::writeCallback(funPtr callback1, funPtr callback2)
{
// callbacks = callback directly
// When declared only one callback function no serialization is needed.
if (callback1 != callback2)
{
updateStatus(kErpcStatus_UnknownCallback);
}
write(static_cast<uint8_t>(isNull ? null_flag_t::kIsNull : null_flag_t::kNotNull));
}

void BasicCodec::startReadMessage(message_type_t &type, uint32_t &service, uint32_t &request, uint32_t &sequence)
Expand Down Expand Up @@ -392,38 +361,10 @@ void BasicCodec::readNullFlag(bool &isNull)
read(flag);
if (isStatusOk())
{
isNull = (flag == (uint8_t)kIsNull);
isNull = (flag == static_cast<uint8_t>(null_flag_t::kIsNull));
}
}

void BasicCodec::readCallback(arrayOfFunPtr callbacks, uint8_t callbacksCount, funPtr *callback)
{
uint8_t _tmp_local;

erpc_assert(callbacksCount > 1U);

// callbacks = callbacks table
read(_tmp_local);
if (isStatusOk())
{
if (_tmp_local < callbacksCount)
{
*callback = callbacks[_tmp_local];
}
else
{
*callback = NULL;
m_status = kErpcStatus_UnknownCallback;
}
}
}

void BasicCodec::readCallback(funPtr callbacks1, funPtr *callback2)
{
// callbacks = callback directly
*callback2 = callbacks1;
}

ERPC_MANUALLY_CONSTRUCTED_ARRAY_STATIC(BasicCodec, s_basicCodecManual, ERPC_CODEC_COUNT);

Codec *BasicCodecFactory::create(void)
Expand Down
36 changes: 1 addition & 35 deletions erpc_c/infra/erpc_basic_codec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace erpc {
/*!
* @brief Values of the uint8 flag prefixing nullable values.
*/
enum _null_flag
enum class null_flag_t
{
kNotNull = 0,
kIsNull
Expand Down Expand Up @@ -186,23 +186,6 @@ class BasicCodec : public Codec
* @param[in] isNull Null flag to send.
*/
virtual void writeNullFlag(bool isNull) override;

/*!
* @brief Writes an order ID of callback function.
*
* @param[in] callbacks Pointer to array of callbacks.
* @param[in] callbacksCount Size of array of callbacks.
* @param[in] callback Callback which ID should be serialized.
*/
virtual void writeCallback(arrayOfFunPtr callbacks, uint8_t callbacksCount, funPtr callback) override;

/*!
* @brief Writes an order ID of callback function.
*
* @param[in] callback1 Pointer to existing callback.
* @param[out] callback2 Callback which ID should be serialized.
*/
virtual void writeCallback(funPtr callback1, funPtr callback2) override;
//@}

//! @name Decoding
Expand Down Expand Up @@ -347,23 +330,6 @@ class BasicCodec : public Codec
* @param[in] isNull Null flag to read.
*/
virtual void readNullFlag(bool &isNull) override;

/*!
* @brief Read an callback function id and return address of callback function.
*
* @param[in] callbacks Pointer to array of callbacks.
* @param[in] callbacksCount Size of array of callbacks.
* @param[out] callback Callback which is deserialized. Null in case of error.
*/
virtual void readCallback(arrayOfFunPtr callbacks, uint8_t callbacksCount, funPtr *callback) override;

/*!
* @brief Read an callback function id and return address of callback function.
*
* @param[in] callback1 Pointer to existing callback.
* @param[out] callback2 Callback which is deserialized.
*/
virtual void readCallback(funPtr callbacks1, funPtr *callback2) override;
//@}
};

Expand Down
2 changes: 1 addition & 1 deletion erpc_c/infra/erpc_client_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ void ClientManager::verifyReply(RequestContext &request)
if (request.getCodec()->isStatusOk() == true)
{
// Verify that this is a reply to the request we just sent.
if ((msgType != kReplyMessage) || (sequence != request.getSequence()))
if ((msgType != message_type_t::kReplyMessage) || (sequence != request.getSequence()))
{
request.getCodec()->updateStatus(kErpcStatus_ExpectedReply);
}
Expand Down
2 changes: 2 additions & 0 deletions erpc_c/infra/erpc_client_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
*/

extern "C" {
#else
#include "erpc_common.h"
#endif

typedef void (*client_error_handler_t)(erpc_status_t err,
Expand Down
40 changes: 3 additions & 37 deletions erpc_c/infra/erpc_codec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include "erpc_message_buffer.hpp"
#include "erpc_transport.hpp"

#include <cstdint>
#include <cstring>
#include <stdint.h>

/*!
* @addtogroup infra_codec
Expand All @@ -32,13 +32,13 @@ namespace erpc {
/*!
* @brief Types of messages that can be encoded.
*/
typedef enum _message_type
enum class message_type_t
{
kInvocationMessage = 0,
kOnewayMessage,
kReplyMessage,
kNotificationMessage
} message_type_t;
};

typedef void *funPtr; // Pointer to functions
typedef funPtr *arrayOfFunPtr; // Pointer to array of functions
Expand Down Expand Up @@ -252,23 +252,6 @@ class Codec
* @param[in] isNull Null flag to send.
*/
virtual void writeNullFlag(bool isNull) = 0;

/*!
* @brief Writes an order ID of callback function.
*
* @param[in] callbacks Pointer to array of callbacks.
* @param[in] callbacksCount Size of array of callbacks.
* @param[in] callback Callback which ID should be serialized.
*/
virtual void writeCallback(arrayOfFunPtr callbacks, uint8_t callbacksCount, funPtr callback) = 0;

/*!
* @brief Writes an order ID of callback function.
*
* @param[in] callback1 Pointer to existing callback.
* @param[out] callback2 Callback which ID should be serialized.
*/
virtual void writeCallback(funPtr callback1, funPtr callback2) = 0;
//@}

//! @name Decoding
Expand Down Expand Up @@ -405,23 +388,6 @@ class Codec
*/
virtual void readNullFlag(bool &isNull) = 0;

/*!
* @brief Read an callback function id and return address of callback function.
*
* @param[in] callbacks Pointer to array of callbacks.
* @param[in] callbacksCount Size of array of callbacks.
* @param[out] callback Callback which is deserialized. Null in case of error.
*/
virtual void readCallback(arrayOfFunPtr callbacks, uint8_t callbacksCount, funPtr *callback) = 0;

/*!
* @brief Read an callback function id and return address of callback function.
*
* @param[in] callback1 Pointer to existing callback.
* @param[out] callback2 Callback which is deserialized.
*/
virtual void readCallback(funPtr callbacks1, funPtr *callback2) = 0;

protected:
MessageBuffer m_buffer; /*!< Message buffer object */
MessageBuffer::Cursor m_cursor; /*!< Copy data to message buffers. */
Expand Down
2 changes: 1 addition & 1 deletion erpc_c/infra/erpc_framed_transport.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class FramedTransport : public Transport
*
* @return Crc16* Pointer to CRC-16 object containing crc-16 compute function.
*/
virtual Crc16 *getCrc16() override;
virtual Crc16 *getCrc16(void) override;

protected:
Crc16 *m_crcImpl; /*!< CRC object. */
Expand Down
Loading

0 comments on commit 714f037

Please sign in to comment.