If a client connects the first time at the MQTT-SN gateway, its client ID from the CONNECT message is stored (see ClientList::createClient).
However, if the client disconnects and connects again with a different client ID, this new client ID is ignored but the client ID from the first CONNECT message is used.
Proposal would be to update the client ID from the CONNECT message for known clients.
E.g., MQTTSNGateway/src/MQTTSNGWClientRecvTask.cpp, lines 168:
if( packet->getType() == MQTTSN_CONNECT ) {
MQTTSNPacket_connectData data;
if (packet->getCONNECT(&data) != 0) {
client->setClientId( data.clientID );
}
}
If a client connects the first time at the MQTT-SN gateway, its client ID from the CONNECT message is stored (see ClientList::createClient). However, if the client disconnects and connects again with a different client ID, this new client ID is ignored but the client ID from the first CONNECT message is used. Proposal would be to update the client ID from the CONNECT message for known clients. E.g., MQTTSNGateway/src/MQTTSNGWClientRecvTask.cpp, lines 168: if( packet->getType() == MQTTSN_CONNECT ) { MQTTSNPacket_connectData data; if (packet->getCONNECT(&data) != 0) { client->setClientId( data.clientID ); } }