Skip to content

Commit

Permalink
eRPC 1.6.0
Browse files Browse the repository at this point in the history
-- Merge branch 'develop'

-- Improved code size of generated code.
-- Improved eRPC nested calls.
(No need to use @nested annotation, need set client/server task/thread id)
-- Improved eRPC list length variable serialization.
-- Added @nullable support for scalar types.
  • Loading branch information
DusanCervenkaNXP committed Dec 19, 2017
2 parents 93e2cb6 + 9258f58 commit 6b9285e
Show file tree
Hide file tree
Showing 116 changed files with 1,670 additions and 978 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ eRPC is available with an unrestrictive BSD 3-clause license. See the LICENSE fi

## Documentation

[Documentation](https://github.com/EmbeddedRPC/erpc/wiki) is in the `wiki` section. Commit sha in wiki repository: 888b2c2046049e670a7668f4975886bd4da2d4b8.
[Documentation](https://github.com/EmbeddedRPC/erpc/wiki) is in the `wiki` section. Commit sha in wiki repository: 03d53dce9244bfddfc424c886a3f3f586053b298.

[Example IDL](examples/README.md) is available in the `examples/` folder.

Expand Down
6 changes: 3 additions & 3 deletions 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.4.0"
PROJECT_NUMBER = "Rev. 1.6.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 All @@ -51,14 +51,14 @@ PROJECT_BRIEF = "NXP Semiconductors"
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
# the logo to the output directory.

PROJECT_LOGO =
PROJECT_LOGO = ../../../../docs/doxygen/common/nxp_logo_small.png

# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY = ../doc/eRPC_infrastructure/eRPC
OUTPUT_DIRECTORY = ../docs/eRPC_infrastructure/eRPC

# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
Expand Down
6 changes: 3 additions & 3 deletions 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.4.0"
PROJECT_NUMBER = "Rev. 1.6.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 All @@ -51,14 +51,14 @@ PROJECT_BRIEF = "NXP Semiconductors"
# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
# to the output directory.

PROJECT_LOGO =
PROJECT_LOGO = ../../../../docs/doxygen/common/nxp_logo_small.png

# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY = ../doc/eRPC_infrastructure/erpcgen
OUTPUT_DIRECTORY = ../docs/eRPC_infrastructure/erpcgen

# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
Expand Down
9 changes: 4 additions & 5 deletions erpc_c/config/erpc_config.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2016, Freescale Semiconductor, Inc.
* Copyright 2016-2017 NXP
* Copyright 2016 NXP
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -77,15 +77,14 @@

//! @def ERPC_DEFAULT_BUFFER_SIZE
//!
//! Uncomment to change the size of buffers allocated by one of MessageBufferFactory.
//! (@ref client_setup and @ref server_setup). The default size is set to 256.
//! Uncomment to change the size of buffers allocated by BasicMessageBufferFactory in the client
//! and server setup functions (@ref client_setup and @ref server_setup). The default size is 256.
//! For RPMsg transport layer, ERPC_DEFAULT_BUFFER_SIZE must be 2^n - 16.
//#define ERPC_DEFAULT_BUFFER_SIZE (256)

//! @def ERPC_DEFAULT_BUFFERS_COUNT
//!
//! Uncomment to change the count of buffers allocated by one of staticly allocated messages.
//! Default value is set to 2.
//! Uncomment to change the count of buffers allocated by StaticMessageBufferFactory
//#define ERPC_DEFAULT_BUFFERS_COUNT (2)

//! @def ERPC_NOEXCEPT
Expand Down
8 changes: 6 additions & 2 deletions erpc_c/infra/arbitrated_client_manager.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2016, Freescale Semiconductor, Inc.
* Copyright 2016-2017 NXP
* Copyright 2016 NXP
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -33,6 +33,10 @@
#include "assert.h"
#include "transport_arbitrator.h"

#if !(__embedded_cplusplus)
using namespace std;
#endif

using namespace erpc;

////////////////////////////////////////////////////////////////////////////////
Expand All @@ -51,7 +55,7 @@ void ArbitratedClientManager::setArbitrator(TransportArbitrator *arbitrator)
m_transport = arbitrator;
}

erpc_status_t ArbitratedClientManager::performRequest(RequestContext &request)
erpc_status_t ArbitratedClientManager::performClientRequest(RequestContext &request)
{
assert(m_arbitrator && "arbitrator not set");

Expand Down
11 changes: 7 additions & 4 deletions erpc_c/infra/arbitrated_client_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,18 @@ class ArbitratedClientManager : public ClientManager
*/
void setArbitrator(TransportArbitrator *arbitrator);

protected:
TransportArbitrator *m_arbitrator; //!< Optional transport arbitrator. May be NULL.

/*!
* @brief This function performs request.
*
* Should be called in non server context (do not call another eRPC function in server
* remote call implementation).
*
* @param[in] request Request context to perform.
*/
virtual erpc_status_t performRequest(RequestContext &request);

protected:
TransportArbitrator *m_arbitrator; //!< Optional transport arbitrator. May be NULL.
virtual erpc_status_t performClientRequest(RequestContext &request);

//! @brief This method is not used with this class.
void setTransport(Transport *transport) {}
Expand Down
48 changes: 4 additions & 44 deletions erpc_c/infra/basic_codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ erpc_status_t BasicCodec::startWriteMessage(message_type_t type, uint32_t servic
return kErpcStatus_Success;
}

erpc_status_t BasicCodec::endWriteMessage()
erpc_status_t BasicCodec::writeData(const void *value, uint32_t length)
{
return kErpcStatus_Success;
return m_cursor.write(value, length);
}

erpc_status_t BasicCodec::write(bool value)
Expand Down Expand Up @@ -153,32 +153,12 @@ erpc_status_t BasicCodec::startWriteList(uint32_t length)
return write(length);
}

erpc_status_t BasicCodec::endWriteList()
{
return kErpcStatus_Success;
}

erpc_status_t BasicCodec::startWriteStruct()
{
return kErpcStatus_Success;
}

erpc_status_t BasicCodec::endWriteStruct()
{
return kErpcStatus_Success;
}

erpc_status_t BasicCodec::startWriteUnion(int32_t discriminator)
{
// Write the union discriminator as a u32.
return write(discriminator);
}

erpc_status_t BasicCodec::endWriteUnion()
{
return kErpcStatus_Success;
}

erpc_status_t BasicCodec::writeNullFlag(bool isNull)
{
return write(static_cast<uint8_t>(isNull ? kIsNull : kNotNull));
Expand Down Expand Up @@ -208,9 +188,9 @@ erpc_status_t BasicCodec::startReadMessage(message_type_t *type,
return read(sequence);
}

erpc_status_t BasicCodec::endReadMessage()
erpc_status_t BasicCodec::readData(void *value, uint32_t length)
{
return kErpcStatus_Success;
return m_cursor.read(value, length);
}

erpc_status_t BasicCodec::read(bool *value)
Expand Down Expand Up @@ -317,32 +297,12 @@ erpc_status_t BasicCodec::startReadList(uint32_t *length)
return read(length);
}

erpc_status_t BasicCodec::endReadList()
{
return kErpcStatus_Success;
}

erpc_status_t BasicCodec::startReadStruct()
{
return kErpcStatus_Success;
}

erpc_status_t BasicCodec::endReadStruct()
{
return kErpcStatus_Success;
}

erpc_status_t BasicCodec::startReadUnion(int32_t *discriminator)
{
// Read union discriminator as u32.
return read(discriminator);
}

erpc_status_t BasicCodec::endReadUnion()
{
return kErpcStatus_Success;
}

erpc_status_t BasicCodec::readNullFlag(bool *isNull)
{
uint8_t flag;
Expand Down
80 changes: 17 additions & 63 deletions erpc_c/infra/basic_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
#include "codec.h"
#include <new>

#if !(__embedded_cplusplus)
using namespace std;
#endif

/*!
* @addtogroup infra_codec
* @{
Expand Down Expand Up @@ -86,11 +90,14 @@ class BasicCodec : public Codec
virtual erpc_status_t startWriteMessage(message_type_t type, uint32_t service, uint32_t request, uint32_t sequence);

/*!
* @brief Prototype for write end of message.
* @brief Prototype for write data stream.
*
* @param[in] value Pointer to data stream.
* @param[in] length Size of data stream in bytes.
*
* @retval kErpcStatus_Success.
* @return depends on cursor write function.
*/
virtual erpc_status_t endWriteMessage();
virtual erpc_status_t writeData(const void *value, uint32_t length);

/*!
* @brief Prototype for write boolean value.
Expand Down Expand Up @@ -229,27 +236,6 @@ class BasicCodec : public Codec
*/
virtual erpc_status_t startWriteList(uint32_t length);

/*!
* @brief Prototype for end write list.
*
* @retval kErpcStatus_Success.
*/
virtual erpc_status_t endWriteList();

/*!
* @brief Prototype for start write structure.
*
* @retval kErpcStatus_Success.
*/
virtual erpc_status_t startWriteStruct();

/*!
* @brief Prototype for end write structure.
*
* @retval kErpcStatus_Success.
*/
virtual erpc_status_t endWriteStruct();

/*!
* @brief Prototype for start write union.
*
Expand All @@ -259,13 +245,6 @@ class BasicCodec : public Codec
*/
virtual erpc_status_t startWriteUnion(int32_t discriminator);

/*!
* @brief Prototype for end write union.
*
* @return Based on implementation.
*/
virtual erpc_status_t endWriteUnion();

/*!
* @brief Writes a flag indicating whether the next value is null.
*
Expand Down Expand Up @@ -294,11 +273,14 @@ class BasicCodec : public Codec
uint32_t *sequence);

/*!
* @brief Prototype for read end of message.
* @brief Prototype for read data stream.
*
* @retval kErpcStatus_Success.
* @param[in] value Pointer to data stream to be read.
* @param[in] length Size of data stream in bytes to be read.
*
* @return Based on cursor read function.
*/
virtual erpc_status_t endReadMessage();
virtual erpc_status_t readData(void *value, uint32_t length);

/*!
* @brief Prototype for read boolean value.
Expand Down Expand Up @@ -437,27 +419,6 @@ class BasicCodec : public Codec
*/
virtual erpc_status_t startReadList(uint32_t *length);

/*!
* @brief Prototype for end read list.
*
* @retval kErpcStatus_Success.
*/
virtual erpc_status_t endReadList();

/*!
* @brief Prototype for start read structure.
*
* @retval kErpcStatus_Success.
*/
virtual erpc_status_t startReadStruct();

/*!
* @brief Prototype for end read structure.
*
* @retval kErpcStatus_Success.
*/
virtual erpc_status_t endReadStruct();

/*!
* @brief Prototype for start read union.
*
Expand All @@ -467,13 +428,6 @@ class BasicCodec : public Codec
*/
virtual erpc_status_t startReadUnion(int32_t *discriminator);

/*!
* @brief Prototype for end read Union.
*
* @return Based on implementation.
*/
virtual erpc_status_t endReadUnion();

/*!
* @brief Reads a flag indicating whether the next value is null.
*
Expand All @@ -496,7 +450,7 @@ class BasicCodecFactory : public CodecFactory
*
* @return Pointer to created codec.
*/
virtual BasicCodec *create() { return new (std::nothrow) BasicCodec; }
virtual BasicCodec *create() { return new (nothrow) BasicCodec; }

/*!
* @brief Dispose codec.
Expand Down
Loading

0 comments on commit 6b9285e

Please sign in to comment.