Clearly set connection state and handle when closing MQTT connection.
Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
}
if (!broker_h) {
- nns_edge_loge ("Invalid param, mqtt_h should not be null.");
+ nns_edge_loge ("Invalid param, broker_h should not be null.");
return NNS_EDGE_ERROR_INVALID_PARAMETER;
}
mosquitto_lib_cleanup ();
}
+ bh->mqtt_h = NULL;
+ bh->connected = false;
+
nns_edge_queue_destroy (bh->message_queue);
bh->message_queue = NULL;
nns_edge_lock_destroy (bh);
}
if (!broker_h) {
- nns_edge_loge ("Invalid param, mqtt_h should not be null.");
+ nns_edge_loge ("Invalid param, broker_h should not be null.");
return NNS_EDGE_ERROR_INVALID_PARAMETER;
}
MQTTAsync_destroy (&handle);
}
+ bh->mqtt_h = NULL;
+
nns_edge_queue_destroy (bh->message_queue);
bh->message_queue = NULL;