3#include "Messages/BinaryMsg.h"
4#include "Messages/InvestigateMsg.h"
5#include "Messages/ModelUrlMsg.h"
6#include "Messages/NameMsg.h"
7#include "Messages/ParticipantMsg.h"
8#include "Messages/PoseMsg.h"
9#include "Messages/SiteMsg.h"
10#include "Messages/ThingMsg.h"
11#include "Participant.h"
17#if defined(_WIN32) || defined(_WIN64)
19#elif defined(__unix__) || defined(__APPLE__)
21#include <netinet/in.h>
22#include <sys/socket.h>
28namespace RoboidControl {
30constexpr int MAX_SENDER_COUNT = 256;
72 const char*
name =
"LocalParticipant";
87#if defined(__unix__) || defined(__APPLE__)
90 sockaddr_in remote_addr;
91 sockaddr_in server_addr;
92 sockaddr_in broadcast_addr;
97 bool connected =
false;
99 virtual void Update(
unsigned long currentTimeMs = 0);
102 void PublishThingInfo(
Thing* thing);
104 bool Send(
Participant* remoteParticipant, IMessage* msg);
105 bool Publish(IMessage* msg);
107 void ReceiveData(
unsigned char bufferSize,
108 char* senderIpAddress,
109 unsigned int senderPort);
110 void ReceiveData(
unsigned char bufferSize,
Participant* remoteParticipant);
113 unsigned char senderCount = 0;
116 std::list<Participant*> senders;
120 unsigned long nextPublishMe = 0;
124 void SetupUDP(
int localPort,
const char* remoteIpAddress,
int remotePort);
Message to send thing-specific data.
Definition BinaryMsg.h:8
Message to request details for a Thing.
Definition InvestigateMsg.h:6
A local participant is the local device which can communicate with other participants It manages all ...
Definition LocalParticipant.h:43
long publishInterval
Definition LocalParticipant.h:69
Participant * remoteSite
The remote site when this participant is connected to a site.
Definition LocalParticipant.h:77
const char * name
The name of the participant.
Definition LocalParticipant.h:72
bool isIsolated
True if the participant is running isolated. Isolated participants do not communicate with other part...
Definition LocalParticipant.h:65
static LocalParticipant * Isolated()
Isolated participant is used when the application is run without networking.
Definition LocalParticipant.cpp:48
Message for communicating the name of a thing.
Definition NameMsg.h:6
A participant is a device which manages things. It can communicate with other participant to synchron...
Definition Participant.h:14
int port
The port number for UDP communication with the participant. This is 0 for isolated participants.
Definition Participant.h:21
const char * ipAddress
The Ip Address of a participant. When the participant is local, this contains 0.0....
Definition Participant.h:18
A participant messages notifies other participants of its presence When received by another participa...
Definition ParticipantMsg.h:10
Message to communicate the pose of the thing The pose is in local space relative to the parent....
Definition PoseMsg.h:8
A message communicating the network ID for that participant.
Definition SiteMsg.h:6
A thing is the primitive building block.
Definition Thing.h:20
Message providing generic information about a Thing.
Definition ThingMsg.h:6