/**************************************************************************** * This file is part of the project Gwenhywfar. * Gwenhywfar (c) by 2023 Martin Preuss, all rights reserved. * * The license for this file can be found in the file COPYING which you * should have received along with this file. ****************************************************************************/ #ifndef AQH_ENDPOINT2_MQTT_H #define AQH_ENDPOINT2_MQTT_H #include #include #ifdef __cplusplus extern "C" { #endif /** * Extends the given endpoint to support MQTT messages. It expects the function GWEN_MsgIoEndpoint2_Extend() to have been called * beforehand. */ AQHOME_API void AQH_MqttEndpoint2_Extend(GWEN_MSG_ENDPOINT2 *ep); AQHOME_API const char *AQH_MqttEndpoint2_GetClientId(const GWEN_MSG_ENDPOINT2 *ep); AQHOME_API void AQH_MqttEndpoint2_SetClientId(GWEN_MSG_ENDPOINT2 *ep, const char *s); AQHOME_API const char *AQH_MqttEndpoint2_GetTopicPrefix(const GWEN_MSG_ENDPOINT2 *ep); AQHOME_API void AQH_MqttEndpoint2_SetTopicPrefix(GWEN_MSG_ENDPOINT2 *ep, const char *s); AQHOME_API uint16_t AQH_MqttEndpoint2_GetNextPacketId(const GWEN_MSG_ENDPOINT2 *ep); AQHOME_API uint16_t AQH_MqttEndpoint2_GetKeepAliveTime(const GWEN_MSG_ENDPOINT2 *ep); AQHOME_API void AQH_MqttEndpoint2_SetKeepAliveTime(GWEN_MSG_ENDPOINT2 *ep, uint16_t i); AQHOME_API GWEN_MSG *AQH_MqttEndpoint2_CreateMsgConnect(GWEN_MSG_ENDPOINT2 *ep); AQHOME_API GWEN_MSG *AQH_MqttEndpoint2_CreateMsgPublishString(GWEN_MSG_ENDPOINT2 *ep, uint32_t uid, int valueId, const char *valuePath, const char *v); AQHOME_API GWEN_MSG *AQH_MqttEndpoint2_CreateMsgPublishDouble(GWEN_MSG_ENDPOINT2 *ep, uint32_t uid, int valueId, const char *valuePath, double v); AQHOME_API GWEN_MSG *AQH_MqttEndpoint2_CreateMsgPublishInt(GWEN_MSG_ENDPOINT2 *ep, uint32_t uid, int valueId, const char *valuePath, int v); #ifdef __cplusplus } #endif #endif