BugFix of Wildcard of Topic Issue #40

Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
tomoaki
2016-10-25 21:10:22 +09:00
parent 3c9b7d283b
commit 19c4d8208e
20 changed files with 667 additions and 183 deletions

View File

@@ -207,13 +207,11 @@ int XBee::open(char* device, int baudrate)
int XBee::broadcast(const uint8_t* payload, uint16_t payloadLen){
SensorNetAddress addr;
addr.setBroadcastAddress();
send(payload, (uint8_t) payloadLen, &addr);
return 1;
return send(payload, (uint8_t) payloadLen, &addr);
}
int XBee:: unicast(const uint8_t* payload, uint16_t payloadLen, SensorNetAddress* addr){
send(payload, (uint8_t) payloadLen, addr);
return 1;
return send(payload, (uint8_t) payloadLen, addr);
}
int XBee::recv(uint8_t* buf, uint16_t bufLen, SensorNetAddress* clientAddr)
@@ -355,14 +353,14 @@ int XBee::send(const uint8_t* payload, uint8_t pLen, SensorNetAddress* addr){
D_NWSTACK("\r\n");
/* wait Txim Status 0x8B */
_sem.timedwait(5000); // 5sec
_sem.timedwait(XMIT_STATUS_TIME_OVER);
if ( _respCd || _frameId != _respId )
{
D_NWSTACK(" frameId = %02x Not Acknowleged\r\n", _frameId);
return -1;
}
return 0;
return (int)pLen;
}
void XBee::send(uint8_t c)