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

Detailed Description

A participant messages notifies other participants of its presence When received by another participant, it can be followed by a NetworkIdMsg to announce that participant to this client such that it can join privately.

#include <ParticipantMsg.h>

Inheritance diagram for Passer::RoboidControl::ParticipantMsg:
Passer::RoboidControl::IMessage

Public Member Functions

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

Public Attributes

unsigned char networkId
 The network ID known by the participant.
 

Static Public Attributes

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

Constructor & Destructor Documentation

◆ ParticipantMsg() [1/2]

Passer::RoboidControl::ParticipantMsg::ParticipantMsg ( char  networkId)

Create a new message for sending.

Parameters
networkIdThe network ID known by the participant

◆ ParticipantMsg() [2/2]

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

Create a message for receiving.

Parameters
bufferThe byte array to parse

Member Function Documentation

◆ Serialize()

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

Serialize the message into a byte array.

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

Reimplemented from Passer::RoboidControl::IMessage.