Added sendmsg debug
This commit is contained in:
parent
e92ecef46f
commit
122d087f81
@ -31,6 +31,10 @@ unsigned char BinaryMsg::Serialize(char* buffer) {
|
|||||||
if (this->dataLength <= 0) // in this case, no data is actually sent
|
if (this->dataLength <= 0) // in this case, no data is actually sent
|
||||||
return 0;
|
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;
|
unsigned char ix = 0;
|
||||||
buffer[ix++] = this->id;
|
buffer[ix++] = this->id;
|
||||||
buffer[ix++] = this->networkId;
|
buffer[ix++] = this->networkId;
|
||||||
|
@ -32,6 +32,10 @@ ThingMsg::ThingMsg(unsigned char networkId, Thing* thing) {
|
|||||||
ThingMsg::~ThingMsg() {}
|
ThingMsg::~ThingMsg() {}
|
||||||
|
|
||||||
unsigned char ThingMsg::Serialize(char* buffer) {
|
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;
|
unsigned char ix = 0;
|
||||||
buffer[ix++] = this->id;
|
buffer[ix++] = this->id;
|
||||||
buffer[ix++] = this->networkId;
|
buffer[ix++] = this->networkId;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user