eRPC API Reference  Rev. 1.7.2
NXP Semiconductors
erpc::BasicCodec Class Reference

Simple binary serialization format. More...

#include <erpc_basic_codec.h>

+ Inheritance diagram for erpc::BasicCodec:
+ Collaboration diagram for erpc::BasicCodec:

Public Member Functions

Encoding
virtual void startWriteMessage (message_type_t type, uint32_t service, uint32_t request, uint32_t sequence)
 Prototype for write header of message. More...
 
virtual void writeData (const void *value, uint32_t length)
 Prototype for write data stream. More...
 
virtual void write (bool value)
 Prototype for write boolean value. More...
 
virtual void write (int8_t value)
 Prototype for write int8_t value. More...
 
virtual void write (int16_t value)
 Prototype for write int16_t value. More...
 
virtual void write (int32_t value)
 Prototype for write int32_t value. More...
 
virtual void write (int64_t value)
 Prototype for write int64_t value. More...
 
virtual void write (uint8_t value)
 Prototype for write uint8_t value. More...
 
virtual void write (uint16_t value)
 Prototype for write uint16_t value. More...
 
virtual void write (uint32_t value)
 Prototype for write uint32_t value. More...
 
virtual void write (uint64_t value)
 Prototype for write uint64_t value. More...
 
virtual void write (float value)
 Prototype for write float value. More...
 
virtual void write (double value)
 Prototype for write double value. More...
 
virtual void writePtr (uintptr_t value)
 Prototype for write uintptr value. More...
 
virtual void writeString (uint32_t length, const char *value)
 Prototype for write string value. More...
 
virtual void writeBinary (uint32_t length, const uint8_t *value)
 Prototype for write binary value. More...
 
virtual void startWriteList (uint32_t length)
 Prototype for start write list. More...
 
virtual void startWriteUnion (int32_t discriminator)
 Prototype for start write union. More...
 
virtual void writeNullFlag (bool isNull)
 Writes a flag indicating whether the next value is null. More...
 
virtual void writeCallback (arrayOfFunPtr callbacks, uint8_t callbacksCount, funPtr callback)
 Writes an order ID of callback function. More...
 
virtual void writeCallback (funPtr callback1, funPtr callback2)
 Writes an order ID of callback function. More...
 
Decoding
virtual void startReadMessage (message_type_t *type, uint32_t *service, uint32_t *request, uint32_t *sequence)
 Prototype for read header of message. More...
 
virtual void readData (void *value, uint32_t length)
 Prototype for read data stream. More...
 
virtual void read (bool *value)
 Prototype for read boolean value. More...
 
virtual void read (int8_t *value)
 Prototype for read int8_t value. More...
 
virtual void read (int16_t *value)
 Prototype for read int16_t value. More...
 
virtual void read (int32_t *value)
 Prototype for read int32_t value. More...
 
virtual void read (int64_t *value)
 Prototype for read int64_t value. More...
 
virtual void read (uint8_t *value)
 Prototype for read uint8_t value. More...
 
virtual void read (uint16_t *value)
 Prototype for read uint16_t value. More...
 
virtual void read (uint32_t *value)
 Prototype for read uint32_t value. More...
 
virtual void read (uint64_t *value)
 Prototype for read uint64_t value. More...
 
virtual void read (float *value)
 Prototype for read float value. More...
 
virtual void read (double *value)
 Prototype for read double value. More...
 
virtual void readPtr (uintptr_t *value)
 Prototype for read uintptr value. More...
 
virtual void readString (uint32_t *length, char **value)
 Prototype for read string value. More...
 
virtual void readBinary (uint32_t *length, uint8_t **value)
 Prototype for read binary value. More...
 
virtual void startReadList (uint32_t *length)
 Prototype for start read list. More...
 
virtual void startReadUnion (int32_t *discriminator)
 Prototype for start read union. More...
 
virtual void readNullFlag (bool *isNull)
 Reads a flag indicating whether the next value is null. More...
 
virtual void readCallback (arrayOfFunPtr callbacks, uint8_t callbacksCount, funPtr *callback)
 Read an callback function id and return address of callback function. More...
 
virtual void readCallback (funPtr callbacks1, funPtr *callback2)
 Read an callback function id and return address of callback function. More...
 
- Public Member Functions inherited from erpc::Codec
 Codec (void)
 Constructor. More...
 
virtual ~Codec (void)
 Codec destructor.
 
MessageBuffergetBuffer (void)
 Return message buffer used for read and write data. More...
 
virtual void setBuffer (MessageBuffer &buf)
 Prototype for set message buffer used for read and write data. More...
 
virtual void reset (void)
 Reset the codec to initial state.
 
erpc_status_t getStatus (void)
 
void updateStatus (erpc_status_t status)
 

Static Public Attributes

static const uint32_t kBasicCodecVersion
 

Additional Inherited Members

- Protected Attributes inherited from erpc::Codec
MessageBuffer m_buffer
 
MessageBuffer::Cursor m_cursor
 
erpc_status_t m_status
 

Detailed Description

Simple binary serialization format.

Member Function Documentation

void BasicCodec::startWriteMessage ( message_type_t  type,
uint32_t  service,
uint32_t  request,
uint32_t  sequence 
)
virtual

Prototype for write header of message.

Parameters
[in]typeType of message.
[in]serviceWhich interface is requested.
[in]requestWhich function need be called.
[in]sequenceSend sequence number to be sure that received message is reply for current request. or write function.

Implements erpc::Codec.

void BasicCodec::writeData ( const void *  value,
uint32_t  length 
)
virtual

Prototype for write data stream.

Parameters
[in]valuePointer to data stream.
[in]lengthSize of data stream in bytes.
void BasicCodec::write ( bool  value)
virtual

Prototype for write boolean value.

Parameters
[in]valueBoolean typed value to write.

Implements erpc::Codec.

void BasicCodec::write ( int8_t  value)
virtual

Prototype for write int8_t value.

Parameters
[in]valueint8_t typed value to write.

Implements erpc::Codec.

void BasicCodec::write ( int16_t  value)
virtual

Prototype for write int16_t value.

Parameters
[in]valueint16_t typed value to write.

Implements erpc::Codec.

void BasicCodec::write ( int32_t  value)
virtual

Prototype for write int32_t value.

Parameters
[in]valueint32_t typed value to write.

Implements erpc::Codec.

void BasicCodec::write ( int64_t  value)
virtual

Prototype for write int64_t value.

Parameters
[in]valueint64_t typed value to write.

Implements erpc::Codec.

void BasicCodec::write ( uint8_t  value)
virtual

Prototype for write uint8_t value.

Parameters
[in]valueuint8_t typed value to write.

Implements erpc::Codec.

void BasicCodec::write ( uint16_t  value)
virtual

Prototype for write uint16_t value.

Parameters
[in]valueuint16_t typed value to write.

Implements erpc::Codec.

void BasicCodec::write ( uint32_t  value)
virtual

Prototype for write uint32_t value.

Parameters
[in]valueuint32_t typed value to write.

Implements erpc::Codec.

void BasicCodec::write ( uint64_t  value)
virtual

Prototype for write uint64_t value.

Parameters
[in]valueuint64_t typed value to write.

Implements erpc::Codec.

void BasicCodec::write ( float  value)
virtual

Prototype for write float value.

Parameters
[in]valuefloat typed value to write.

Implements erpc::Codec.

void BasicCodec::write ( double  value)
virtual

Prototype for write double value.

Parameters
[in]valuedouble typed value to write.

Implements erpc::Codec.

void BasicCodec::writePtr ( uintptr_t  value)
virtual

Prototype for write uintptr value.

Parameters
[in]valueuintptr typed value to write.

Implements erpc::Codec.

void BasicCodec::writeString ( uint32_t  length,
const char *  value 
)
virtual

Prototype for write string value.

Parameters
[in]lengthof string.
[in]valuestring value to write.

Implements erpc::Codec.

void BasicCodec::writeBinary ( uint32_t  length,
const uint8_t *  value 
)
virtual

Prototype for write binary value.

Parameters
[in]lengthof binary.
[in]valueBinary value to write.

Implements erpc::Codec.

void BasicCodec::startWriteList ( uint32_t  length)
virtual

Prototype for start write list.

Parameters
[in]lengthLength of list.

Implements erpc::Codec.

void BasicCodec::startWriteUnion ( int32_t  discriminator)
virtual

Prototype for start write union.

Parameters
[in]discriminatorDiscriminator of union.

Implements erpc::Codec.

void BasicCodec::writeNullFlag ( bool  isNull)
virtual

Writes a flag indicating whether the next value is null.

Parameters
[in]isNullNull flag to send.

Implements erpc::Codec.

void BasicCodec::writeCallback ( arrayOfFunPtr  callbacks,
uint8_t  callbacksCount,
funPtr  callback 
)
virtual

Writes an order ID of callback function.

Parameters
[in]callbacksPointer to array of callbacks.
[in]callbacksCountSize of array of callbacks.
[in]callbackCallback which ID should be serialized.

Implements erpc::Codec.

void BasicCodec::writeCallback ( funPtr  callback1,
funPtr  callback2 
)
virtual

Writes an order ID of callback function.

Parameters
[in]callback1Pointer to existing callback.
[out]callback2Callback which ID should be serialized.

Implements erpc::Codec.

void BasicCodec::startReadMessage ( message_type_t type,
uint32_t *  service,
uint32_t *  request,
uint32_t *  sequence 
)
virtual

Prototype for read header of message.

Parameters
[out]typeType of message.
[out]serviceWhich interface was used.
[out]requestWhich function was called.
[out]sequenceReturned sequence number to be sure that received message is reply for current request.

Implements erpc::Codec.

void BasicCodec::readData ( void *  value,
uint32_t  length 
)
virtual

Prototype for read data stream.

Parameters
[in]valuePointer to data stream to be read.
[in]lengthSize of data stream in bytes to be read.
void BasicCodec::read ( bool *  value)
virtual

Prototype for read boolean value.

Parameters
[out]valueBoolean typed value to read.

Implements erpc::Codec.

void BasicCodec::read ( int8_t *  value)
virtual

Prototype for read int8_t value.

Parameters
[out]valueint8_t typed value to read.

Implements erpc::Codec.

void BasicCodec::read ( int16_t *  value)
virtual

Prototype for read int16_t value.

Parameters
[out]valueint16_t typed value to read.

Implements erpc::Codec.

void BasicCodec::read ( int32_t *  value)
virtual

Prototype for read int32_t value.

Parameters
[out]valueint32_t typed value to read.

Implements erpc::Codec.

void BasicCodec::read ( int64_t *  value)
virtual

Prototype for read int64_t value.

Parameters
[out]valueint64_t typed value to read.

Implements erpc::Codec.

void BasicCodec::read ( uint8_t *  value)
virtual

Prototype for read uint8_t value.

Parameters
[out]valueuint8_t typed value to read.

Implements erpc::Codec.

void BasicCodec::read ( uint16_t *  value)
virtual

Prototype for read uint16_t value.

Parameters
[out]valueuint16_t typed value to read.

Implements erpc::Codec.

void BasicCodec::read ( uint32_t *  value)
virtual

Prototype for read uint32_t value.

Parameters
[out]valueuint32_t typed value to read.

Implements erpc::Codec.

void BasicCodec::read ( uint64_t *  value)
virtual

Prototype for read uint64_t value.

Parameters
[out]valueuint64_t typed value to read.

Implements erpc::Codec.

void BasicCodec::read ( float *  value)
virtual

Prototype for read float value.

Parameters
[out]valuefloat typed value to read.

Implements erpc::Codec.

void BasicCodec::read ( double *  value)
virtual

Prototype for read double value.

Parameters
[out]valuedouble typed value to read.

Implements erpc::Codec.

void BasicCodec::readPtr ( uintptr_t *  value)
virtual

Prototype for read uintptr value.

Parameters
[out]valueuintptr typed value to read.

Implements erpc::Codec.

void BasicCodec::readString ( uint32_t *  length,
char **  value 
)
virtual

Prototype for read string value.

Parameters
[out]lengthof string.
[out]valueString value to read.

Implements erpc::Codec.

void BasicCodec::readBinary ( uint32_t *  length,
uint8_t **  value 
)
virtual

Prototype for read binary value.

Parameters
[out]lengthof binary.
[out]valueBinary value to read.

Implements erpc::Codec.

void BasicCodec::startReadList ( uint32_t *  length)
virtual

Prototype for start read list.

Parameters
[out]lengthLength of list.

Implements erpc::Codec.

void BasicCodec::startReadUnion ( int32_t *  discriminator)
virtual

Prototype for start read union.

Parameters
[in]discriminatorDiscriminator of union.

Implements erpc::Codec.

void BasicCodec::readNullFlag ( bool *  isNull)
virtual

Reads a flag indicating whether the next value is null.

Parameters
[in]isNullNull flag to read.

Implements erpc::Codec.

void BasicCodec::readCallback ( arrayOfFunPtr  callbacks,
uint8_t  callbacksCount,
funPtr *  callback 
)
virtual

Read an callback function id and return address of callback function.

Parameters
[in]callbacksPointer to array of callbacks.
[in]callbacksCountSize of array of callbacks.
[out]callbackCallback which is deserialized.

Implements erpc::Codec.

void BasicCodec::readCallback ( funPtr  callbacks1,
funPtr *  callback2 
)
virtual

Read an callback function id and return address of callback function.

Parameters
[in]callback1Pointer to existing callback.
[out]callback2Callback which is deserialized.

Implements erpc::Codec.

Member Data Documentation

const uint32_t BasicCodec::kBasicCodecVersion
static

Codec version.


The documentation for this class was generated from the following files: