eclipse / paho.mqtt-sn.embedded-c

Paho C MQTT-SN gateway and libraries for embedded systems. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
314 stars 179 forks source link

WillMSGUPD\WillTOPICUPD failed #191

Closed peyton-li closed 4 years ago

peyton-li commented 4 years ago

hi I was working in MQTTSN client, and use MQTTSNGW\MOSQUITTO to have a test, i found these issues what i can't understand. After connection has been established success with will topic and will msg 1、I send willtopicupd, but not recieve anything, according protocol, GW need to answer with willtopicrsp, is this a issue on MQTTSNGW?
2、I send willMSGupd, but recieved reject information for not support, is this stand for the GW not support the willmsgupd? 3、I send willtopicupd ,without flags and topic, only two bytes length, aim to delete the will on GW, but without respect and also revieve will when client disconnect abnormal, is the GW not support this, or willtopicupd package made error?

thanks

ty4tw commented 4 years ago

Hi,

WILLTOPICUPD and WILLMSGUPD are not supported.

/*
 *  WILLTOPICUPD
 */
void MQTTSNConnectionHandler::handleWilltopicupd(Client* client, MQTTSNPacket* packet)
{
    /* send NOT_SUPPORTED responce to the client */
    MQTTSNPacket* respMsg = new MQTTSNPacket();
    respMsg->setWILLTOPICRESP(MQTTSN_RC_NOT_SUPPORTED);
    Event* evt = new Event();
    evt->setClientSendEvent(client, respMsg);
    _gateway->getClientSendQue()->post(evt);
}

/*
 *  WILLMSGUPD
 */
void MQTTSNConnectionHandler::handleWillmsgupd(Client* client, MQTTSNPacket* packet)
{
    /* send NOT_SUPPORTED responce to the client */
    MQTTSNPacket* respMsg = new MQTTSNPacket();
    respMsg->setWILLMSGRESP(MQTTSN_RC_NOT_SUPPORTED);
    Event* evt = new Event();
    evt->setClientSendEvent(client, respMsg);
    _gateway->getClientSendQue()->post(evt);
}
peyton-li commented 4 years ago

OK, thanks to your reply