Files
aqhomecontrol/aqhome/mqtt/endpoint2_mqtt.h
Martin Preuss 6f5a26b0cf aqhome: Started rewriting endpoints for version 2 of the msgio interface.
This interface is much simpler.
First rewritten endpoint is that for MQTT.
2023-07-09 20:47:47 +02:00

71 lines
2.6 KiB
C

/****************************************************************************
* 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 <aqhome/api.h>
#include <gwenhywfar/endpoint2.h>
#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