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

Detailed Description

A message communicating the network ID for that participant.

#include <NetworkIdMsg.h>

Inheritance diagram for Passer::RoboidControl::NetworkIdMsg:
Passer::RoboidControl::IMessage

Public Member Functions

 NetworkIdMsg (unsigned char networkId)
 Create a new message for sending.
 
 NetworkIdMsg (const char *buffer)
 Create a message for receiving.
 
virtual ~NetworkIdMsg ()
 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 for the participant.
 

Static Public Attributes

static const unsigned char id = 0xA1
 The message ID.
 
static const unsigned char length = 2
 The length of the message.
 

Constructor & Destructor Documentation

◆ NetworkIdMsg() [1/2]

Passer::RoboidControl::NetworkIdMsg::NetworkIdMsg ( unsigned char  networkId)

Create a new message for sending.

Parameters
networkIdThe network ID for the participant

◆ NetworkIdMsg() [2/2]

Passer::RoboidControl::NetworkIdMsg::NetworkIdMsg ( const char *  buffer)

Create a message for receiving.

Parameters
bufferThe byte array to parse

Member Function Documentation

◆ Serialize()

unsigned char Passer::RoboidControl::NetworkIdMsg::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.