TinyRobotics
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Message< T > Class Template Reference

Generic message structure for communication, parameterized by value type. More...

#include <Message.h>

Public Member Functions

 Message ()=default
 Default constructor.
 
 Message (MessageContent c, T v, Unit u)
 Construct a message with content, value, and unit.
 
 Message (MessageContent c, T v, Unit u, MessageOrigin orig)
 

Public Attributes

const char * prefix = "MSG"
 prefix for message identification
 
uint8_t size = sizeof(Message)
 
MessageOrigin origin
 
uint8_t origin_id
 
MessageContent content
 Optional identifier for the source (e.g., sensor ID, motor ID)
 
Unit unit
 Unit of the value.
 
value {}
 Value of the message.
 

Detailed Description

template<typename T = float>
class tinyrobotics::Message< T >

Generic message structure for communication, parameterized by value type.

Template Parameters
TType of the value (default: float)
Note
When using Message in function signatures (e.g., virtual functions), always use Message<float> explicitly. C++ requires the template argument in these contexts, even though the default is float.

Constructor & Destructor Documentation

◆ Message()

Message ( MessageContent  c,
v,
Unit  u 
)
inline

Construct a message with content, value, and unit.

Parameters
cMessage content type
vValue
uUnit

Member Data Documentation

◆ content

MessageContent content

Optional identifier for the source (e.g., sensor ID, motor ID)

Type of message content.

See also
MessageContent

◆ origin

MessageOrigin origin
Initial value:
=
MessageOrigin::RemoteControl

Source of the message.

See also
MessageOrigin

◆ origin_id

uint8_t origin_id
Initial value:
=
0

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