mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-14 07:56:52 +01:00
BugFix of Wildcard of Topic Issue #40
Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
@@ -301,7 +301,6 @@ int UDPPort::unicast(const uint8_t* buf, uint32_t length, SensorNetAddress* addr
|
||||
dest.sin_family = AF_INET;
|
||||
dest.sin_port = addr->getPortNo();
|
||||
dest.sin_addr.s_addr = addr->getIpAddress();
|
||||
;
|
||||
|
||||
int status = ::sendto(_sockfdUnicast, buf, length, 0, (const sockaddr*) &dest, sizeof(dest));
|
||||
if (status < 0)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -38,7 +38,8 @@ namespace MQTTSNGW
|
||||
#define API_MODEMSTATUS 0x8A
|
||||
#define API_XMITSTATUS 0x8B
|
||||
|
||||
#define START_BYTE 0x7e
|
||||
#define XMIT_STATUS_TIME_OVER 5000
|
||||
|
||||
#define ESCAPE 0x7d
|
||||
#define XON 0x11
|
||||
#define XOFF 0x13
|
||||
|
||||
Reference in New Issue
Block a user