aqhomed, aqhome: added MQTT endpoint, publish value changes via MQTT.

This commit is contained in:
Martin Preuss
2023-03-29 16:46:32 +02:00
parent 40c3a3ee4e
commit bb3d194b5a
8 changed files with 538 additions and 24 deletions

View File

@@ -14,10 +14,21 @@
#include <gwenhywfar/endpoint.h>
#define GWEN_ENDPOINT_MQTTC_STATE_WAITFORCONNACK (GWEN_MSG_ENDPOINT_TCPC_STATE_NEXTFREE+0)
#define GWEN_ENDPOINT_MQTTC_STATE_ESTABLISHED (GWEN_MSG_ENDPOINT_TCPC_STATE_NEXTFREE+1)
AQHOME_API GWEN_MSG_ENDPOINT *AQH_MqttClientEndpoint_new(const char *host, int port, const char *name, int groupId);
AQHOME_API uint16_t AQH_MqttClientEndpoint_GetNextPacketId(GWEN_MSG_ENDPOINT *ep);
AQHOME_API uint16_t AQH_MqttClientEndpoint_GetKeepAliveTime(const GWEN_MSG_ENDPOINT *ep);
AQHOME_API void AQH_MqttClientEndpoint_SetKeepAliveTime(GWEN_MSG_ENDPOINT *ep, uint16_t i);
AQHOME_API const char *AQH_MqttClientEndpoint_GetClientId(const GWEN_MSG_ENDPOINT *ep);
AQHOME_API void AQH_MqttClientEndpoint_SetClientId(GWEN_MSG_ENDPOINT *ep, const char *s);
AQHOME_API const char *AQH_MqttClientEndpoint_GetTopicPrefix(const GWEN_MSG_ENDPOINT *ep);
AQHOME_API void AQH_MqttClientEndpoint_SetTopicPrefix(GWEN_MSG_ENDPOINT *ep, const char *s);