aqhome: add apiCode to endpoint.

This commit is contained in:
Martin Preuss
2025-02-28 00:22:26 +01:00
parent e308e07b87
commit 3e9aa7969b
4 changed files with 33 additions and 2 deletions

View File

@@ -89,7 +89,7 @@ int AQH_Tool_Watch(GWEN_DB_NODE *dbGlobalArgs, int argc, char **argv)
int _handleResponseMessage(AQH_OBJECT *o, const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList, int first)
int _handleResponseMessage(AQH_OBJECT *o, const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList, GWEN_UNUSED int first)
{
uint16_t code;
GWEN_DB_NODE *dbArgs;
@@ -110,7 +110,7 @@ int _handleResponseMessage(AQH_OBJECT *o, const AQH_MESSAGE *msg, const GWEN_TAG
void _handleDataResponse(const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList, const char *tmpl)
void _handleDataResponse(GWEN_UNUSED const AQH_MESSAGE *msg, const GWEN_TAG16_LIST *tagList, const char *tmpl)
{
AQH_VALUE *value;

View File

@@ -115,6 +115,33 @@ void GWENHYWFAR_CB _freeData(GWEN_UNUSED void *bp, void *p)
int AQH_Endpoint_GetApiCode(const AQH_OBJECT *o)
{
if (o) {
AQH_ENDPOINT *xo;
xo=GWEN_INHERIT_GETDATA(AQH_OBJECT, AQH_ENDPOINT, o);
if (xo)
return xo->apiCode;
}
return 0;
}
void AQH_Endpoint_SetApiCode(AQH_OBJECT *o, int i)
{
if (o) {
AQH_ENDPOINT *xo;
xo=GWEN_INHERIT_GETDATA(AQH_OBJECT, AQH_ENDPOINT, o);
if (xo)
xo->apiCode=i;
}
}
const char *AQH_Endpoint_GetServiceName(const AQH_OBJECT *o)
{
if (o) {

View File

@@ -34,6 +34,9 @@ enum {
*/
AQHOME_API AQH_OBJECT *AQH_Endpoint_new(AQH_EVENT_LOOP *eventLoop, AQH_OBJECT *msgReader, AQH_OBJECT *msgWriter);
AQHOME_API int AQH_Endpoint_GetApiCode(const AQH_OBJECT *o);
AQHOME_API void AQH_Endpoint_SetApiCode(AQH_OBJECT *o, int i);
AQHOME_API const char *AQH_Endpoint_GetServiceName(const AQH_OBJECT *o);
AQHOME_API void AQH_Endpoint_SetServiceName(AQH_OBJECT *o, const char *s);

View File

@@ -20,6 +20,7 @@ struct AQH_ENDPOINT {
AQH_OBJECT *msgWriter;
AQH_OBJECT *msgReader;
int apiCode;
uint32_t lastMsgId;
int state;
uint32_t permissions;