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

Detailed Description

A participant is device which can communicate with other participants.

#include <Participant.h>

Inheritance diagram for Passer::RoboidControl::Participant:
Passer::RoboidControl::RemoteParticipant Passer::RoboidControl::SiteServer

Public Member Functions

 Participant (int port)
 
 Participant (const char *ipAddress, int port)
 
void begin ()
 
virtual void Update (unsigned long currentTimeMs=0)
 
void SendThingInfo (RemoteParticipant *remoteParticipant, Thing *thing)
 
void PublishThingInfo (Thing *thing)
 
bool Send (RemoteParticipant *remoteParticipant, IMessage *msg)
 
bool Publish (IMessage *msg)
 
void ReceiveData (unsigned char bufferSize, RemoteParticipant *remoteParticipant)
 
ThingGet (unsigned char networkId, unsigned char thingId)
 Get a thing with the give ids.
 
void Add (Thing *thing)
 Add a new thing for this participant.
 
void Remove (Thing *thing)
 Remove a thing fror this participant.
 

Public Attributes

char buffer [1024]
 
long publishInterval = 3000
 
const char * name = "Participant"
 
int localPort = 0
 
const char * remoteIpAddress = nullptr
 
unsigned short remotePort = 0
 
char * broadcastIpAddress = nullptr
 
WiFiUDP udp
 
SOCKET sock
 
int sock
 
sockaddr_in remote_addr
 
sockaddr_in server_addr
 
sockaddr_in broadcast_addr
 
bool connected = false
 
const char * ipAddress = "0.0.0.0"
 The internet address of the participant.
 
int port = 0
 The UDP port on which the participant can be reached.
 
unsigned char networkId = 0
 The network ID of the participant.
 

Protected Member Functions

void SetupUDP (int localPort, const char *remoteIpAddress, int remotePort)
 
ParticipantGetParticipant (const char *ipAddress, int port)
 
ParticipantAddParticipant (const char *ipAddress, int port)
 
void ReceiveUDP ()
 
virtual void Process (RemoteParticipant *sender, ParticipantMsg *msg)
 
virtual void Process (RemoteParticipant *sender, NetworkIdMsg *msg)
 
virtual void Process (RemoteParticipant *sender, InvestigateMsg *msg)
 
virtual void Process (RemoteParticipant *sender, ThingMsg *msg)
 
virtual void Process (RemoteParticipant *sender, NameMsg *msg)
 
virtual void Process (RemoteParticipant *sender, PoseMsg *msg)
 
virtual void Process (RemoteParticipant *sender, BinaryMsg *msg)
 

Protected Attributes

std::list< Participant * > senders
 
unsigned long nextPublishMe = 0
 
std::list< Thing * > things
 The things reported by this participant.
 

Member Function Documentation

◆ Get()

Thing * Passer::RoboidControl::RemoteParticipant::Get ( unsigned char  networkId,
unsigned char  thingId 
)
inherited

Get a thing with the give ids.

Parameters
networkIdThe network ID of the thing
thingIdThe ID of the thing
Returns
The thing when it is found, nullptr in other cases

◆ Add()

void Passer::RoboidControl::RemoteParticipant::Add ( Thing thing)
inherited

Add a new thing for this participant.

Parameters
thingThe thing to add

◆ Remove()

void Passer::RoboidControl::RemoteParticipant::Remove ( Thing thing)
inherited

Remove a thing fror this participant.

Parameters
thingThe thing to remove