Compare commits

..

2 Commits

2 changed files with 8 additions and 0 deletions

View File

@ -31,6 +31,10 @@ unsigned char BinaryMsg::Serialize(char* buffer) {
if (this->dataLength <= 0) // in this case, no data is actually sent
return 0;
#if defined(DEBUG)
std::cout << "Send BinaryMsg [" << (int)this->networkId << "/" << (int)this->thingId
<< "] " << (int)this->dataLength << std::endl;
#endif
unsigned char ix = 0;
buffer[ix++] = this->id;
buffer[ix++] = this->networkId;

View File

@ -32,6 +32,10 @@ ThingMsg::ThingMsg(unsigned char networkId, Thing* thing) {
ThingMsg::~ThingMsg() {}
unsigned char ThingMsg::Serialize(char* buffer) {
#if defined(DEBUG)
std::cout << "Send ThingMsg [" << (int)this->networkId << "/" << (int)this->thingId
<< "] " << (int)this->thingType << " " << (int)this->parentId << std::endl;
#endif
unsigned char ix = 0;
buffer[ix++] = this->id;
buffer[ix++] = this->networkId;