26 lines
521 B
C++
26 lines
521 B
C++
#include "SiteMsg.h"
|
|
|
|
namespace RoboidControl {
|
|
|
|
SiteMsg::SiteMsg(const char* buffer) {
|
|
this->networkId = buffer[1];
|
|
}
|
|
|
|
SiteMsg::SiteMsg(unsigned char networkId) {
|
|
this->networkId = networkId;
|
|
}
|
|
|
|
SiteMsg::~SiteMsg() {}
|
|
|
|
unsigned char SiteMsg::Serialize(char* buffer) {
|
|
#if defined(DEBUG)
|
|
std::cout << "Send SiteMsg [" << (int)this->networkId << "] " << std::endl;
|
|
#endif
|
|
unsigned char ix = 0;
|
|
buffer[ix++] = this->id;
|
|
buffer[ix++] = this->networkId;
|
|
return SiteMsg::length;
|
|
}
|
|
|
|
} // namespace RoboidControl
|