mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-15 16:36:52 +01:00
BugFix of #181
This commit is contained in:
@@ -127,8 +127,8 @@ int AdapterManager::unicastToClient(Client* client, MQTTSNPacket* packet, Client
|
|||||||
MQTTSNGWEncapsulatedPacket encap(packet);
|
MQTTSNGWEncapsulatedPacket encap(packet);
|
||||||
WirelessNodeId* wnId = fwd->getWirelessNodeId(client);
|
WirelessNodeId* wnId = fwd->getWirelessNodeId(client);
|
||||||
encap.setWirelessNodeId(wnId);
|
encap.setWirelessNodeId(wnId);
|
||||||
WRITELOG(FORMAT_Y_W_G, currentDateTime(), encap.getName(), RIGHTARROW, fwd->getId(), encap.print(pbuf));
|
|
||||||
task->log(client, packet);
|
task->log(client, packet);
|
||||||
|
WRITELOG(FORMAT_Y_W_G, currentDateTime(), encap.getName(), RIGHTARROW, fwd->getId(), encap.print(pbuf));
|
||||||
rc = encap.unicast(_gateway->getSensorNetwork(),fwd->getSensorNetAddr());
|
rc = encap.unicast(_gateway->getSensorNetwork(),fwd->getSensorNetAddr());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -145,10 +145,12 @@ void ClientRecvTask::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
client = _gateway->getClientList()->getClient(senderAddr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
client = _gateway->getClientList()->getClient(senderAddr);
|
|
||||||
|
|
||||||
if ( client )
|
if ( client )
|
||||||
{
|
{
|
||||||
/* write log and post Event */
|
/* write log and post Event */
|
||||||
@@ -217,11 +219,11 @@ void ClientRecvTask::run()
|
|||||||
log(client, packet, 0);
|
log(client, packet, 0);
|
||||||
if ( packet->getType() == MQTTSN_ENCAPSULATED )
|
if ( packet->getType() == MQTTSN_ENCAPSULATED )
|
||||||
{
|
{
|
||||||
WRITELOG("%s Forwarder(%s) is not declared by ClientList file. message has been discarded.%s\n", ERRMSG_HEADER, _sensorNetwork->getSenderAddress()->sprint(buf), ERRMSG_FOOTER);
|
WRITELOG("%s MQTTSNGWClientRecvTask Forwarder(%s) is not declared by ClientList file. message has been discarded.%s\n", ERRMSG_HEADER, _sensorNetwork->getSenderAddress()->sprint(buf), ERRMSG_FOOTER);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WRITELOG("%s Client(%s) is not connecting. message has been discarded.%s\n", ERRMSG_HEADER, senderAddr->sprint(buf), ERRMSG_FOOTER);
|
WRITELOG("%s MQTTSNGWClientRecvTask Client(%s) is not connecting. message has been discarded.%s\n", ERRMSG_HEADER, senderAddr->sprint(buf), ERRMSG_FOOTER);
|
||||||
}
|
}
|
||||||
delete packet;
|
delete packet;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user