Template Class Message

Class Documentation

template<uint8_t Size>
class microparcel::Message

a Message class that provides API to access specific fields of a data payload

tparam Size

the Byte Size of the Message

Public Functions

template<typename T, uint8_t Offset, uint8_t Bitsize>
inline T get()

returns bitfields of Bitsize located at Offset in a uint8_t data chunk Can return field from 1 to 16 bits

Template Parameters
  • T – the return type

  • Offset – the offset, in bits (from 0 to 8*Size)

  • Bitsize – the bitsize of the returned field (defines the mask)

template<typename T, uint8_t Offset, uint8_t Bitsize>
inline void set(T field)

sets a bitfield of Bitsize located at Offset in a uint8_t data chunk

Template Parameters
  • T – the field type

  • Offset – the offset, in bits (from 0 to 8*Size)

  • Bitsize – the bitsize of the returned field (defines the mask)

Parameters

field – the data to set

Public Members

uint8_t data[Size]

Public Static Attributes

static const uint8_t kSize = Size