![]() |
Roboid Control for C++
|
A participant is device which can communicate with other participants.
#include <SiteServer.h>
Public Member Functions | |
SiteServer (int port=7681) | |
Create a new site server. | |
virtual void | UpdateMyThings (unsigned long currentTimeMs) override |
void | begin () |
virtual void | Update (unsigned long currentTimeMs=0) override |
Update all things for this participant. | |
Thing * | Get (unsigned char thingId) |
Find a thing managed by this participant. | |
void | Add (Thing *thing, bool checkId=true) |
Add a new thing for this participant. | |
void | Remove (Thing *thing) |
Remove a thing for this participant. | |
Static Public Member Functions | |
static ParticipantUDP * | Isolated () |
Isolated participant is used when the application is run without networking. | |
Public Attributes | |
bool | isIsolated = false |
True if the participant is running isolated. Isolated participants do not communicate with other participants. | |
Participant * | remoteSite = nullptr |
The remote site when this participant is connected to a site. | |
long | publishInterval = 3000 |
const char * | name = "ParticipantUDP" |
The name of the participant. | |
bool | connected = false |
const char * | ipAddress = "0.0.0.0" |
The Ip Address of a participant. | |
unsigned int | port = 0 |
The port number for UDP communication with the participant. | |
unsigned char | networkId = 0 |
The network Id to identify the participant. | |
unsigned char | thingCount = 0 |
Thing * | things [MAX_THING_COUNT] |
std::list< Thing * > | things |
The things managed by this participant. | |
Static Public Attributes | |
static ParticipantRegistry | registry |
Protected Member Functions | |
virtual void | Process (Participant *sender, ParticipantMsg *msg) override |
virtual void | Process (Participant *sender, NetworkIdMsg *msg) override |
virtual void | Process (Participant *sender, ThingMsg *msg) override |
virtual void | UpdateOtherThings (unsigned long currentTimeMs) |
void | SendThingInfo (Participant *remoteParticipant, Thing *thing) |
void | PublishThingInfo (Thing *thing) |
bool | Send (Participant *remoteParticipant, IMessage *msg) |
bool | Publish (IMessage *msg) |
void | ReceiveData (unsigned char bufferSize, char *senderIpAddress, unsigned int senderPort) |
void | ReceiveData (unsigned char bufferSize, Participant *remoteParticipant) |
void | SetupUDP (int localPort, const char *remoteIpAddress, int remotePort) |
void | ReceiveUDP () |
virtual void | Process (Participant *sender, InvestigateMsg *msg) |
virtual void | Process (Participant *sender, NameMsg *msg) |
virtual void | Process (Participant *sender, ModelUrlMsg *msg) |
virtual void | Process (Participant *sender, PoseMsg *msg) |
virtual void | Process (Participant *sender, BinaryMsg *msg) |
Protected Attributes | |
unsigned long | nextPublishMe = 0 |
char | buffer [1024] |
int | sock |
sockaddr_in | remote_addr |
sockaddr_in | server_addr |
sockaddr_in | broadcast_addr |
RoboidControl::SiteServer::SiteServer | ( | int | port = 7681 | ) |
Create a new site server.
port | The port of which to receive the messages |
|
overridevirtual |
Reimplemented from RoboidControl::ParticipantUDP.
|
overrideprotectedvirtual |
Reimplemented from RoboidControl::ParticipantUDP.
|
overrideprotectedvirtual |
Reimplemented from RoboidControl::ParticipantUDP.
|
overrideprotectedvirtual |
Reimplemented from RoboidControl::ParticipantUDP.
|
staticinherited |
Isolated participant is used when the application is run without networking.
|
overridevirtualinherited |
Update all things for this participant.
currentTimeMs | The current time in milliseconds (optional) |
Reimplemented from RoboidControl::Participant.
|
inherited |
Find a thing managed by this participant.
thingId | The ID of the thing |
|
inherited |
Add a new thing for this participant.
thing | The thing to add |
checkId | If true, the thing.id is regenerated if it is zero |
|
inherited |
Remove a thing for this participant.
thing | The thing to remove |
|
inherited |
True if the participant is running isolated. Isolated participants do not communicate with other participants.
True if the participant is running isolated. Isolated participants do not communicate with other participants
|
inherited |
The interval in milliseconds for publishing (broadcasting) data on the local network