Simplified IPC code to use less different IPC messages. Share more code. More qork on MQTT code.

This commit is contained in:
Martin Preuss
2023-10-01 21:31:02 +02:00
parent 0f896c1729
commit 1e27223dfa
50 changed files with 1326 additions and 698 deletions

View File

@@ -22,8 +22,9 @@
#include <aqhome/mqtt/msg_mqtt_subscribe.h>
#include <aqhome/mqtt/msg_mqtt_suback.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/endpoint_multilayer.h>
#include <gwenhywfar/text.h>
#include <gwenhywfar/debug.h>
#include <time.h>
#include <unistd.h>
@@ -75,6 +76,7 @@ GWEN_MSG_ENDPOINT *AqHomeMqttLog_CreateMqttEndpoint(GWEN_DB_NODE *dbArgs)
return NULL;
}
AQH_MqttClientEndpoint_SetKeepAliveTime(epMqtt, mqttKeepAlive);
GWEN_MsgEndpoint_AddFlags(epMqtt, AQH_ENDPOINT2_MQTTCLIENT_FLAGS_SUBSCRIBEALL);
return epMqtt;
}
@@ -89,7 +91,7 @@ int AqHomeMqttLog_MqttConnect(GWEN_MSG_ENDPOINT *epTcp)
if (GWEN_MsgEndpoint_GetState(epTcp)==GWEN_MSG_ENDPOINT_STATE_UNCONNECTED) {
int rv;
rv=AQH_MqttClientEndpoint_StartConnect(epTcp);
rv=GWEN_MultilayerEndpoint_StartConnect(epTcp);
if (rv<0 && rv!=GWEN_ERROR_IN_PROGRESS) {
DBG_ERROR(NULL, "Error starting to connect (%d)", rv);
return rv;