adapted to latest changes in gwen (msgio API v2 becomes v1).

This commit is contained in:
Martin Preuss
2023-07-12 19:30:53 +02:00
parent 7a4edb6854
commit 0fd58567fe
37 changed files with 956 additions and 956 deletions

View File

@@ -0,0 +1,70 @@
/****************************************************************************
* 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_ENDPOINT_MQTT_H
#define AQH_ENDPOINT_MQTT_H
#include <aqhome/api.h>
#include <gwenhywfar/endpoint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Extends the given endpoint to support MQTT messages. It expects the function GWEN_MsgIoEndpoint_Extend() to have been called
* beforehand.
*/
AQHOME_API void AQH_MqttEndpoint_Extend(GWEN_MSG_ENDPOINT *ep);
AQHOME_API const char *AQH_MqttEndpoint_GetClientId(const GWEN_MSG_ENDPOINT *ep);
AQHOME_API void AQH_MqttEndpoint_SetClientId(GWEN_MSG_ENDPOINT *ep, const char *s);
AQHOME_API const char *AQH_MqttEndpoint_GetTopicPrefix(const GWEN_MSG_ENDPOINT *ep);
AQHOME_API void AQH_MqttEndpoint_SetTopicPrefix(GWEN_MSG_ENDPOINT *ep, const char *s);
AQHOME_API uint16_t AQH_MqttEndpoint_GetNextPacketId(const GWEN_MSG_ENDPOINT *ep);
AQHOME_API uint16_t AQH_MqttEndpoint_GetKeepAliveTime(const GWEN_MSG_ENDPOINT *ep);
AQHOME_API void AQH_MqttEndpoint_SetKeepAliveTime(GWEN_MSG_ENDPOINT *ep, uint16_t i);
AQHOME_API GWEN_MSG *AQH_MqttEndpoint_CreateMsgConnect(GWEN_MSG_ENDPOINT *ep);
AQHOME_API GWEN_MSG *AQH_MqttEndpoint_CreateMsgPublishString(GWEN_MSG_ENDPOINT *ep,
uint32_t uid,
int valueId,
const char *valuePath,
const char *v);
AQHOME_API GWEN_MSG *AQH_MqttEndpoint_CreateMsgPublishDouble(GWEN_MSG_ENDPOINT *ep,
uint32_t uid,
int valueId,
const char *valuePath,
double v);
AQHOME_API GWEN_MSG *AQH_MqttEndpoint_CreateMsgPublishInt(GWEN_MSG_ENDPOINT *ep,
uint32_t uid,
int valueId,
const char *valuePath,
int v);
#ifdef __cplusplus
}
#endif
#endif