mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-16 17:06:51 +01:00
Update: Add Aggregate Gateway functions. #127
Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
@@ -90,7 +90,7 @@ void MQTTSNConnectionHandler::handleConnect(Client* client, MQTTSNPacket* packet
|
||||
//* clear ConnectData of Client */
|
||||
Connect* connectData = client->getConnectData();
|
||||
memset(connectData, 0, sizeof(Connect));
|
||||
if ( !client->isProxy() )
|
||||
if ( !client->isAdapter() )
|
||||
{
|
||||
client->disconnected();
|
||||
}
|
||||
@@ -104,7 +104,7 @@ void MQTTSNConnectionHandler::handleConnect(Client* client, MQTTSNPacket* packet
|
||||
connectData->keepAliveTimer = data.duration;
|
||||
connectData->flags.bits.will = data.willFlag;
|
||||
|
||||
if ((const char*) _gateway->getGWParams()->loginId != 0 && (const char*) _gateway->getGWParams()->password != 0)
|
||||
if ((const char*) _gateway->getGWParams()->loginId != nullptr && (const char*) _gateway->getGWParams()->password != 0)
|
||||
{
|
||||
connectData->flags.bits.password = 1;
|
||||
connectData->flags.bits.username = 1;
|
||||
@@ -291,9 +291,9 @@ void MQTTSNConnectionHandler::handlePingreq(Client* client, MQTTSNPacket* packet
|
||||
|
||||
void MQTTSNConnectionHandler::sendStoredPublish(Client* client)
|
||||
{
|
||||
MQTTGWPacket* msg = 0;
|
||||
MQTTGWPacket* msg = nullptr;
|
||||
|
||||
while ( ( msg = client->getClientSleepPacket() ) != 0 )
|
||||
while ( ( msg = client->getClientSleepPacket() ) != nullptr )
|
||||
{
|
||||
// ToDo: This version can't re-send PUBLISH when PUBACK is not returned.
|
||||
client->deleteFirstClientSleepPacket(); // pop the que to delete element.
|
||||
|
||||
Reference in New Issue
Block a user