This commit is contained in:
tomoaki
2020-02-15 18:24:51 +09:00
parent 731a392559
commit 1b08591fad
2 changed files with 7 additions and 5 deletions

View File

@@ -127,8 +127,8 @@ int AdapterManager::unicastToClient(Client* client, MQTTSNPacket* packet, Client
MQTTSNGWEncapsulatedPacket encap(packet);
WirelessNodeId* wnId = fwd->getWirelessNodeId(client);
encap.setWirelessNodeId(wnId);
WRITELOG(FORMAT_Y_W_G, currentDateTime(), encap.getName(), RIGHTARROW, fwd->getId(), encap.print(pbuf));
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());
}
else

View File

@@ -145,10 +145,12 @@ void ClientRecvTask::run()
}
}
}
else
{
client = _gateway->getClientList()->getClient(senderAddr);
}
}
client = _gateway->getClientList()->getClient(senderAddr);
if ( client )
{
/* write log and post Event */
@@ -217,11 +219,11 @@ void ClientRecvTask::run()
log(client, packet, 0);
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
{
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;
}