Roboid Control for C++
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Passer::RoboidControl::TextMsg Class Reference

Detailed Description

Message for sending generic text.

#include <TextMsg.h>

Inheritance diagram for Passer::RoboidControl::TextMsg:
Passer::RoboidControl::IMessage

Public Member Functions

 TextMsg (const char *text, unsigned char textLength)
 Create a new message for sending.
 
 TextMsg (char *buffer)
 Create a message for receiving.
 
virtual ~TextMsg ()
 Destructor for the message.
 
virtual unsigned char Serialize (char *buffer) override
 Serialize the message into a byte array for sending.
 

Public Attributes

unsigned char networkId
 The network ID of the thing.
 
unsigned char thingId
 the ID of the thing
 
const char * text
 The text without the null terminator.
 
unsigned char textLength
 The length of the text.
 

Static Public Attributes

static const unsigned char id = 0xB0
 The message ID.
 
static const unsigned char length = 2
 The length of the message without the text itself.
 

Constructor & Destructor Documentation

◆ TextMsg() [1/2]

Passer::RoboidControl::TextMsg::TextMsg ( const char *  text,
unsigned char  textLength 
)

Create a new message for sending.

Parameters
textThe text

◆ TextMsg() [2/2]

Passer::RoboidControl::TextMsg::TextMsg ( char *  buffer)

Create a message for receiving.

Parameters
bufferThe byte array to parse

Member Function Documentation

◆ Serialize()

unsigned char Passer::RoboidControl::TextMsg::Serialize ( char *  buffer)
overridevirtual

Serialize the message into a byte array for sending.

Parameters
bufferThe buffer to serilize into
Returns
The length of the message in the buffer

Reimplemented from Passer::RoboidControl::IMessage.