mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-11 05:56:57 +03:00
Update interface_mqtt.cpp
This commit is contained in:
@@ -135,8 +135,11 @@ static esp_err_t mqtt_event_handler_cb(esp_mqtt_event_handle_t event) {
|
||||
|
||||
case MQTT_EVENT_DATA:
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "MQTT_EVENT_DATA");
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "TOPIC=" + std::string(event->topic));
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "DATA=" + std::string(event->data));
|
||||
char buf[100];
|
||||
snprintf(buf, sizeof(buf), "%.*s", event->topic_len, event->topic);
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "TOPIC=" + std::string(buf));
|
||||
snprintf(buf, sizeof(buf), "%.*s", event->data_len, event->data);
|
||||
LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "DATA=" + std::string(buf));
|
||||
topic.assign(event->topic, event->topic_len);
|
||||
if (subscribeFunktionMap != NULL) {
|
||||
if (subscribeFunktionMap->find(topic) != subscribeFunktionMap->end()) {
|
||||
|
||||
Reference in New Issue
Block a user