RoboidControl-cpp/Messages/ParticipantMsg.cpp
2025-04-11 11:15:20 +02:00

33 lines
745 B
C++

#include "ParticipantMsg.h"
namespace RoboidControl {
ParticipantMsg::ParticipantMsg(char networkId) {
this->networkId = networkId;
}
ParticipantMsg::ParticipantMsg(const char* buffer) {
this->networkId = buffer[1];
}
ParticipantMsg::~ParticipantMsg() {}
unsigned char ParticipantMsg::Serialize(char* buffer) {
#if defined(DEBUG)
std::cout << "Send ParticipantMsg [" << (int)this->networkId << "] "
<< std::endl;
#endif
unsigned char ix = 0;
buffer[ix++] = this->id;
buffer[ix++] = this->networkId;
return ParticipantMsg::length;
}
// bool ParticipantMsg::Send(ParticipantUDP *participant, unsigned char
// networkId) {
// ParticipantMsg msg = ParticipantMsg()
// }
// Client Msg
} // namespace RoboidControl