I need a way to know the MQTT connection status at any time, so that I can reconnect to the MQTT broker again.
I observe that the call back function registered via "qapi_Net_MQTTc_Register_Connect_Callback()" does not get called for every disconnect to the MQTT broker.
Also the function qapi_Net_MQTTc_Publish() returns success, even after the MQTT disconnects. Also qapi_Status_t returned by function qapi_Net_MQTTc_Publish() is "QAPI_NET_STATUS_MQTTC_CONNECT_SUCCEEDED" after the MQTT disconnects.
After MQTT disconnect may be 10-20 minutes later, the API qapi_Net_MQTTc_Publish() returns error "QAPI_NET_STATUS_MQTTC_SOCKET_WRITE_ERROR".
I will require MQTT connection status immediately not after 10 -15 minutes. Is there any way I can get the MQTT connection status immediatley.
Thanks in advance.