diff --git a/apps/aqhome-mqttlog/loop_mqtt.c b/apps/aqhome-mqttlog/loop_mqtt.c index d33fed5..e60fcb4 100644 --- a/apps/aqhome-mqttlog/loop_mqtt.c +++ b/apps/aqhome-mqttlog/loop_mqtt.c @@ -154,7 +154,12 @@ int _handlePublish(AQHOME_MQTT *aqh, GWEN_MSG_ENDPOINT *ep, const char *rcvdTopi device=AQHMQTT_Device_List_First(aqh->registeredDeviceList); while(device) { - AQHMQTT_TOPIC_LIST *topicList; + AQHMQTT_TOPIC_LIST *topicList; + const char *sDeviceName; + const char *sDeviceId; + + sDeviceName=AQHMQTT_Device_GetName(device); + sDeviceId=AQHMQTT_Device_GetId(device); topicList=AQHMQTT_Device_GetTopicList(device); if (topicList) { @@ -168,7 +173,11 @@ int _handlePublish(AQHOME_MQTT *aqh, GWEN_MSG_ENDPOINT *ep, const char *rcvdTopi AQHMQTT_Topic_SetTopic(topic, rcvdTopic); } #endif - if (topic) { + if (topic) { + DBG_INFO(AQH_LOGDOMAIN, + "Handling topic \"%s\" for device type %s (id: %s)", + rcvdTopic, + sDeviceName, sDeviceId?sDeviceId:""); if (AQHMQTT_Topic_GetTopicType(topic)==AQHMQTT_TopicType_Json) _handleJsonTopic(aqh, ep, device, topic, rcvdValue); else @@ -305,7 +314,8 @@ int _registerNewDeviceForTopic(AQHOME_MQTT *aqh, GWEN_MSG_ENDPOINT *ep, const ch if (aqh->registeredDeviceList==NULL) aqh->registeredDeviceList=AQHMQTT_Device_List_new(); DBG_ERROR(NULL, "Registered device \"%s\" (%s)", AQHMQTT_Device_GetId(newDevice), AQHMQTT_Device_GetName(newDevice)); - AQHMQTT_Device_List_Add(newDevice, aqh->registeredDeviceList); + AQHMQTT_Device_List_Add(newDevice, aqh->registeredDeviceList); + /* TODO: add devices and values to data server */ GWEN_Buffer_free(buf); return 1; }