From 16e08d623d53f9996d3883a7feac7145bb6fbb2e Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Thu, 12 Oct 2023 00:35:08 +0200 Subject: [PATCH] Started adding an event layer. --- aqhome/0BUILD | 2 + aqhome/events/0BUILD | 87 +++++++++++++ aqhome/events/eventhandler.c | 138 ++++++++++++++++++++ aqhome/events/eventhandler.h | 46 +++++++ aqhome/events/eventhandler_p.h | 30 +++++ aqhome/events/eventsubscription.c | 93 +++++++++++++ aqhome/events/eventsubscription.h | 41 ++++++ aqhome/events/eventsubscription_p.h | 31 +++++ aqhome/events/timer.c | 194 ++++++++++++++++++++++++++++ aqhome/events/timer.h | 65 ++++++++++ aqhome/events/timer_p.h | 34 +++++ 11 files changed, 761 insertions(+) create mode 100644 aqhome/events/0BUILD create mode 100644 aqhome/events/eventhandler.c create mode 100644 aqhome/events/eventhandler.h create mode 100644 aqhome/events/eventhandler_p.h create mode 100644 aqhome/events/eventsubscription.c create mode 100644 aqhome/events/eventsubscription.h create mode 100644 aqhome/events/eventsubscription_p.h create mode 100644 aqhome/events/timer.c create mode 100644 aqhome/events/timer.h create mode 100644 aqhome/events/timer_p.h diff --git a/aqhome/0BUILD b/aqhome/0BUILD index f70c046..2c1f92a 100644 --- a/aqhome/0BUILD +++ b/aqhome/0BUILD @@ -69,6 +69,7 @@ mqtt hexfile data + events @@ -79,6 +80,7 @@ aqhmqtt aqhhexfile aqhdata + aqhevents diff --git a/aqhome/events/0BUILD b/aqhome/events/0BUILD new file mode 100644 index 0000000..045fad1 --- /dev/null +++ b/aqhome/events/0BUILD @@ -0,0 +1,87 @@ + + + + + + + + $(gwenhywfar_cflags) + $(aqdatabase_cflags) + -I$(topsrcdir) + -I$(topbuilddir) + + + + --include=$(builddir) + --include=$(srcdir) + --include=$(aqdatabase_AQDATABASE_TYPEMAKERDIR)/c + + + + + + $(visibility_cflags) + + + + --api=AQHOME_API + + + + + + + + + + + + + + + + + + $(local/built_headers_pub) + + + + + eventsubscription.h + timer.h + eventhandler.h + + + + + eventsubscription_p.h + timer_p.h + eventhandler_p.h + + + + + $(local/typefiles) + + eventsubscription.c + timer.c + eventhandler.c + + + + + + + + + + + + + + + + + + + diff --git a/aqhome/events/eventhandler.c b/aqhome/events/eventhandler.c new file mode 100644 index 0000000..a4083b7 --- /dev/null +++ b/aqhome/events/eventhandler.c @@ -0,0 +1,138 @@ +/**************************************************************************** + * 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. + ****************************************************************************/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "./eventhandler_p.h" + +#include + + + +GWEN_INHERIT_FUNCTIONS(AQH_EVENT_HANDLER) +GWEN_LIST_FUNCTIONS(AQH_EVENT_HANDLER, AQH_EventHandler) + + + + +AQH_EVENT_HANDLER *AQH_EventHandler_new() +{ + AQH_EVENT_HANDLER *evh; + + GWEN_NEW_OBJECT(AQH_EVENT_HANDLER, evh); + GWEN_INHERIT_INIT(AQH_EVENT_HANDLER, evh); + GWEN_LIST_INIT(AQH_EVENT_HANDLER, evh); + + evh->timerList=AQH_EventTimer_List_new(); + evh->subscriptionList=AQH_EventSubscription_List_new(); + + return evh; +} + + + +void AQH_EventHandler_free(AQH_EVENT_HANDLER *evh) +{ + if (evh) { + GWEN_LIST_FINI(AQH_EVENT_HANDLER, evh); + GWEN_INHERIT_FINI(AQH_EVENT_HANDLER, evh); + + AQH_EventSubscription_List_free(evh->subscriptionList); + AQH_EventTimer_List_free(evh->timerList); + GWEN_FREE_OBJECT(evh); + } +} + + + +AQH_EVENT_TIMER_LIST *AQH_EventHandler_GetTimerList(const AQH_EVENT_HANDLER *evh) +{ + return evh?evh->timerList:NULL; +} + + + +void AQH_EventHandler_AddTimer(AQH_EVENT_HANDLER *evh, AQH_EVENT_TIMER *evt) +{ + if (evh && evt) { + AQH_EventTimer_SetId(evt, ++(evh->lastTimerId)); + AQH_EventTimer_List_Add(evt, evh->timerList); + } +} + + + +AQH_EVENT_SUBSCRIPTION_LIST *AQH_EventHandler_GetSubscriptionList(const AQH_EVENT_HANDLER *evh) +{ + return evh?evh->subscriptionList:NULL; +} + + + +void AQH_EventHandler_AddSubscription(AQH_EVENT_HANDLER *evh, AQH_EVENT_SUBSCRIPTION *evs) +{ + if (evh && evs) + AQH_EventSubscription_List_Add(evs, evh->subscriptionList); +} + + + +void AQH_EventHandler_HandleTimeTick(AQH_EVENT_HANDLER *evh, uint64_t t) +{ + if (evh) { + AQH_EVENT_TIMER *evt; + + evt=AQH_EventTimer_List_First(evh->timerList); + while(evt) { + AQH_EVENT_TIMER *evtNext; + + evtNext=AQH_EventTimer_List_Next(evt); + if (AQH_EventTimer_CheckWhetherTickTriggers(evt, t)) { + AQH_EventHandler_HandleEvent(evh, AQH_EventTimer_GetEventType(evt), AQH_EventTimer_GetId(evt)); + if (AQH_EventTimer_GetFlags(evt) & AQH_EVENT_TIMER_FLAGS_DELETE_IF_TRIGGERED) { + DBG_INFO(AQH_LOGDOMAIN, "Deleting timer after trigger"); + AQH_EventTimer_List_Del(evt); + AQH_EventTimer_free(evt); + } + } + evt=evtNext; + } + } +} + + + +void AQH_EventHandler_HandleEvent(AQH_EVENT_HANDLER *evh, int eventType, uint64_t objectId) +{ + if (evh) { + AQH_EVENT_SUBSCRIPTION *evs; + + evs=AQH_EventSubscription_List_First(evh->subscriptionList); + while(evs) { + if (AQH_EventSubscription_GetEventType(evs)==eventType) { + int objectIdFromSubscription; + + objectIdFromSubscription=AQH_EventSubscription_GetObjectId(evs); + if (objectIdFromSubscription==0 || objectIdFromSubscription==objectId) + AQH_EventSubscription_CallHandler(evs, eventType, objectId); + } + + evs=AQH_EventSubscription_List_Next(evs); + } + } +} + + + + + + + + diff --git a/aqhome/events/eventhandler.h b/aqhome/events/eventhandler.h new file mode 100644 index 0000000..8493591 --- /dev/null +++ b/aqhome/events/eventhandler.h @@ -0,0 +1,46 @@ +/**************************************************************************** + * 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_EVENT_HANDLER_H +#define AQH_EVENT_HANDLER_H + + +#include "aqhome/api.h" + +#include +#include + + + +typedef struct AQH_EVENT_HANDLER AQH_EVENT_HANDLER; +GWEN_INHERIT_FUNCTION_LIB_DEFS(AQH_EVENT_HANDLER, AQHOME_API) +GWEN_LIST_FUNCTION_LIB_DEFS(AQH_EVENT_HANDLER, AQH_EventHandler, AQHOME_API) + +#include "aqhome/events/timer.h" +#include "aqhome/events/eventsubscription.h" + + + +AQHOME_API AQH_EVENT_HANDLER *AQH_EventHandler_new(); +AQHOME_API void AQH_EventHandler_free(AQH_EVENT_HANDLER *evh); + +AQHOME_API AQH_EVENT_TIMER_LIST *AQH_EventHandler_GetTimerList(const AQH_EVENT_HANDLER *evh); +AQHOME_API void AQH_EventHandler_AddTimer(AQH_EVENT_HANDLER *evh, AQH_EVENT_TIMER *evt); + +AQHOME_API AQH_EVENT_SUBSCRIPTION_LIST *AQH_EventHandler_GetSubscriptionList(const AQH_EVENT_HANDLER *evh); +AQHOME_API void AQH_EventHandler_AddSubscription(AQH_EVENT_HANDLER *evh, AQH_EVENT_SUBSCRIPTION *evs); + + +AQHOME_API void AQH_EventHandler_HandleTimeTick(AQH_EVENT_HANDLER *evh, uint64_t t); +AQHOME_API void AQH_EventHandler_HandleEvent(AQH_EVENT_HANDLER *evh, int eventType, uint64_t objectId); + + + +#endif + + diff --git a/aqhome/events/eventhandler_p.h b/aqhome/events/eventhandler_p.h new file mode 100644 index 0000000..6e8ef78 --- /dev/null +++ b/aqhome/events/eventhandler_p.h @@ -0,0 +1,30 @@ +/**************************************************************************** + * 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_EVENT_HANDLER_P_H +#define AQH_EVENT_HANDLER_P_H + + +#include "aqhome/events/eventhandler.h" + + + +struct AQH_EVENT_HANDLER { + GWEN_INHERIT_ELEMENT(AQH_EVENT_HANDLER) + GWEN_LIST_ELEMENT(AQH_EVENT_HANDLER) + + uint64_t lastTimerId; + AQH_EVENT_TIMER_LIST *timerList; + AQH_EVENT_SUBSCRIPTION_LIST *subscriptionList; +}; + + + +#endif + + diff --git a/aqhome/events/eventsubscription.c b/aqhome/events/eventsubscription.c new file mode 100644 index 0000000..7ff5a7c --- /dev/null +++ b/aqhome/events/eventsubscription.c @@ -0,0 +1,93 @@ +/**************************************************************************** + * 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. + ****************************************************************************/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "./eventsubscription_p.h" + +#include + + + + +GWEN_INHERIT_FUNCTIONS(AQH_EVENT_SUBSCRIPTION) +GWEN_LIST_FUNCTIONS(AQH_EVENT_SUBSCRIPTION, AQH_EventSubscription) + + + + +AQH_EVENT_SUBSCRIPTION *AQH_EventSubscription_new() +{ + AQH_EVENT_SUBSCRIPTION *evs; + + GWEN_NEW_OBJECT(AQH_EVENT_SUBSCRIPTION, evs); + GWEN_INHERIT_INIT(AQH_EVENT_SUBSCRIPTION, evs); + GWEN_LIST_INIT(AQH_EVENT_SUBSCRIPTION, evs); + + return evs; +} + + + +void AQH_EventSubscription_free(AQH_EVENT_SUBSCRIPTION *evs) +{ + if (evs) { + GWEN_LIST_FINI(AQH_EVENT_SUBSCRIPTION, evs); + GWEN_INHERIT_FINI(AQH_EVENT_SUBSCRIPTION, evs); + GWEN_FREE_OBJECT(evs); + } +} + + + +int AQH_EventSubscription_GetEventType(const AQH_EVENT_SUBSCRIPTION *evs) +{ + return evs?evs->eventType:0; +} + + + +void AQH_EventSubscription_SetEventType(AQH_EVENT_SUBSCRIPTION *evs, int i) +{ + if (evs) + evs->eventType=i; +} + + + +uint64_t AQH_EventSubscription_GetObjectId(const AQH_EVENT_SUBSCRIPTION *evs) +{ + return evs?evs->objectId:0; +} + + + +void AQH_EventSubscription_SetObjectId(AQH_EVENT_SUBSCRIPTION *evs, uint64_t i) +{ + if (evs) + evs->objectId=i; +} + + + +int AQH_EventSubscription_CallHandler(AQH_EVENT_SUBSCRIPTION *evs, int eventType, uint64_t objectId) +{ + if (evs && evs->handlerFn) + return evs->handlerFn(evs, eventType, objectId); + return 0; +} + + + + + + + + diff --git a/aqhome/events/eventsubscription.h b/aqhome/events/eventsubscription.h new file mode 100644 index 0000000..65db2d7 --- /dev/null +++ b/aqhome/events/eventsubscription.h @@ -0,0 +1,41 @@ +/**************************************************************************** + * 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_EVENTSUBSCRIPTION_H +#define AQH_EVENTSUBSCRIPTION_H + + +#include "aqhome/api.h" + +#include +#include + + + +typedef struct AQH_EVENT_SUBSCRIPTION AQH_EVENT_SUBSCRIPTION; +GWEN_INHERIT_FUNCTION_LIB_DEFS(AQH_EVENT_SUBSCRIPTION, AQHOME_API) +GWEN_LIST_FUNCTION_LIB_DEFS(AQH_EVENT_SUBSCRIPTION, AQH_EventSubscription, AQHOME_API) + +typedef int (*AQH_EVENT_SUBSCRIPTION_HANDLER_FN)(AQH_EVENT_SUBSCRIPTION *evs, int eventType, uint64_t objectId); + + +AQHOME_API AQH_EVENT_SUBSCRIPTION *AQH_EventSubscription_new(); +AQHOME_API void AQH_EventSubscription_free(AQH_EVENT_SUBSCRIPTION *evs); + +AQHOME_API int AQH_EventSubscription_GetEventType(const AQH_EVENT_SUBSCRIPTION *evs); +AQHOME_API void AQH_EventSubscription_SetEventType(AQH_EVENT_SUBSCRIPTION *evs, int i); + +AQHOME_API uint64_t AQH_EventSubscription_GetObjectId(const AQH_EVENT_SUBSCRIPTION *evs); +AQHOME_API void AQH_EventSubscription_SetObjectId(AQH_EVENT_SUBSCRIPTION *evs, uint64_t i); + +AQHOME_API int AQH_EventSubscription_CallHandler(AQH_EVENT_SUBSCRIPTION *evs, int eventType, uint64_t objectId); + + +#endif + + diff --git a/aqhome/events/eventsubscription_p.h b/aqhome/events/eventsubscription_p.h new file mode 100644 index 0000000..22cc43f --- /dev/null +++ b/aqhome/events/eventsubscription_p.h @@ -0,0 +1,31 @@ +/**************************************************************************** + * 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_EVENTSUBSCRIPTION_P_H +#define AQH_EVENTSUBSCRIPTION_P_H + + +#include "aqhome/events/eventsubscription.h" + + + +struct AQH_EVENT_SUBSCRIPTION { + GWEN_INHERIT_ELEMENT(AQH_EVENT_SUBSCRIPTION) + GWEN_LIST_ELEMENT(AQH_EVENT_SUBSCRIPTION) + + int eventType; + uint64_t objectId; + + AQH_EVENT_SUBSCRIPTION_HANDLER_FN handlerFn; +}; + + + +#endif + + diff --git a/aqhome/events/timer.c b/aqhome/events/timer.c new file mode 100644 index 0000000..d96f857 --- /dev/null +++ b/aqhome/events/timer.c @@ -0,0 +1,194 @@ +/**************************************************************************** + * 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. + ****************************************************************************/ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "./timer_p.h" + +#include + + + +GWEN_INHERIT_FUNCTIONS(AQH_EVENT_TIMER) +GWEN_LIST_FUNCTIONS(AQH_EVENT_TIMER, AQH_EventTimer) + + + + +AQH_EVENT_TIMER *AQH_EventTimer_new() +{ + AQH_EVENT_TIMER *evt; + + GWEN_NEW_OBJECT(AQH_EVENT_TIMER, evt); + GWEN_INHERIT_INIT(AQH_EVENT_TIMER, evt); + GWEN_LIST_INIT(AQH_EVENT_TIMER, evt); + + return evt; +} + + + +void AQH_EventTimer_free(AQH_EVENT_TIMER *evt) +{ + if (evt) { + GWEN_LIST_FINI(AQH_EVENT_TIMER, evt); + GWEN_INHERIT_FINI(AQH_EVENT_TIMER, evt); + + GWEN_FREE_OBJECT(evt); + } +} + + + +uint32_t AQH_EventTimer_GetFlags(const AQH_EVENT_TIMER *evt) +{ + return evt?evt->flags:0; +} + + + +void AQH_EventTimer_SetFlags(AQH_EVENT_TIMER *evt, uint32_t f) +{ + if (evt) + evt->flags=f; +} + + + +void AQH_EventTimer_AddFlags(AQH_EVENT_TIMER *evt, uint32_t f) +{ + if (evt) + evt->flags|=f; +} + + + +void AQH_EventTimer_SubFlags(AQH_EVENT_TIMER *evt, uint32_t f) +{ + if (evt) + evt->flags&=~f; +} + + + +int AQH_EventTimer_GetTimerType(const AQH_EVENT_TIMER *evt) +{ + return evt?evt->timerType:0; +} + + + +void AQH_EventTimer_SetTimerType(AQH_EVENT_TIMER *evt, int i) +{ + if (evt) + evt->timerType=i; +} + + + +uint64_t AQH_EventTimer_GetId(const AQH_EVENT_TIMER *evt) +{ + return evt?evt->id:0; +} + + + +void AQH_EventTimer_SetId(AQH_EVENT_TIMER *evt, uint64_t i) +{ + if (evt) + evt->id=i; +} + + + +uint64_t AQH_EventTimer_GetCurrentValue(const AQH_EVENT_TIMER *evt) +{ + return evt?evt->currentValue:0; +} + + + +void AQH_EventTimer_SetCurrentValue(AQH_EVENT_TIMER *evt, uint64_t i) +{ + if (evt) + evt->currentValue=i; +} + + + +uint64_t AQH_EventTimer_GetReloadOrAlarmValue(const AQH_EVENT_TIMER *evt) +{ + return evt?evt->reloadOrAlarmValue:0; +} + + + +void AQH_EventTimer_SetReloadOrAlarmValue(AQH_EVENT_TIMER *evt, uint64_t i) +{ + if (evt) + evt->reloadOrAlarmValue=i; +} + + + +int AQH_EventTimer_GetEventType(const AQH_EVENT_TIMER *evt) +{ + return evt?evt->eventType:0; +} + + + +void AQH_EventTimer_SetEventType(AQH_EVENT_TIMER *evt, int i) +{ + if (evt) + evt->eventType=i; +} + + + +int AQH_EventTimer_CheckWhetherTickTriggers(AQH_EVENT_TIMER *evt, uint64_t t) +{ + if (evt && evt->flags & AQH_EVENT_TIMER_FLAGS_RUNNING) { + if (evt->timerType==AQH_EventTimerType_CountDown) { + if (evt->currentValue>0) { + evt->currentValue--; + if (evt->currentValue==0) { + if (evt->flags & AQH_EVENT_TIMER_FLAGS_RESTART) { + DBG_INFO(AQH_LOGDOMAIN, "Timer %lu expired, restarting", (unsigned long int) (evt->id)); + evt->currentValue=evt->reloadOrAlarmValue; + } + else { + DBG_INFO(AQH_LOGDOMAIN, "Timer %lu expired", (unsigned long int) (evt->id)); + evt->flags&=~AQH_EVENT_TIMER_FLAGS_RUNNING; + } + return 1; + } + } + } + else if (evt->timerType==AQH_EventTimerType_Alarm) { + if (t>=evt->reloadOrAlarmValue) { + evt->flags&=~AQH_EVENT_TIMER_FLAGS_RUNNING; + return 1; + } + } + else { + DBG_INFO(AQH_LOGDOMAIN, "Unknown timer type %d", evt->timerType); + } + } + + return 0; +} + + + + + + + diff --git a/aqhome/events/timer.h b/aqhome/events/timer.h new file mode 100644 index 0000000..f72ddd4 --- /dev/null +++ b/aqhome/events/timer.h @@ -0,0 +1,65 @@ +/**************************************************************************** + * 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_EVENT_TIMER_H +#define AQH_EVENT_TIMER_H + + +#include "aqhome/api.h" + +#include +#include + + +enum { + AQH_EventTimerType_CountDown=0, + AQH_EventTimerType_Alarm +} AQH_EVENT_TIMER_TYPE; + + +#define AQH_EVENT_TIMER_FLAGS_RUNNING 0x0001 +#define AQH_EVENT_TIMER_FLAGS_RESTART 0x0002 +#define AQH_EVENT_TIMER_FLAGS_DELETE_IF_TRIGGERED 0x0004 + + + +typedef struct AQH_EVENT_TIMER AQH_EVENT_TIMER; +GWEN_INHERIT_FUNCTION_LIB_DEFS(AQH_EVENT_TIMER, AQHOME_API) +GWEN_LIST_FUNCTION_LIB_DEFS(AQH_EVENT_TIMER, AQH_EventTimer, AQHOME_API) + + +AQHOME_API AQH_EVENT_TIMER *AQH_EventTimer_new(); +AQHOME_API void AQH_EventTimer_free(AQH_EVENT_TIMER *evt); + +AQHOME_API uint32_t AQH_EventTimer_GetFlags(const AQH_EVENT_TIMER *evt); +AQHOME_API void AQH_EventTimer_SetFlags(AQH_EVENT_TIMER *evt, uint32_t f); +AQHOME_API void AQH_EventTimer_AddFlags(AQH_EVENT_TIMER *evt, uint32_t f); +AQHOME_API void AQH_EventTimer_SubFlags(AQH_EVENT_TIMER *evt, uint32_t f); + +AQHOME_API int AQH_EventTimer_GetTimerType(const AQH_EVENT_TIMER *evt); +AQHOME_API void AQH_EventTimer_SetTimerType(AQH_EVENT_TIMER *evt, int i); + +AQHOME_API uint64_t AQH_EventTimer_GetId(const AQH_EVENT_TIMER *evt); +AQHOME_API void AQH_EventTimer_SetId(AQH_EVENT_TIMER *evt, uint64_t i); + +AQHOME_API uint64_t AQH_EventTimer_GetCurrentValue(const AQH_EVENT_TIMER *evt); +AQHOME_API void AQH_EventTimer_SetCurrentValue(AQH_EVENT_TIMER *evt, uint64_t i); + +AQHOME_API uint64_t AQH_EventTimer_GetReloadOrAlarmValue(const AQH_EVENT_TIMER *evt); +AQHOME_API void AQH_EventTimer_SetReloadOrAlarmValue(AQH_EVENT_TIMER *evt, uint64_t i); + +AQHOME_API int AQH_EventTimer_GetEventType(const AQH_EVENT_TIMER *evt); +AQHOME_API void AQH_EventTimer_SetEventType(AQH_EVENT_TIMER *evt, int i); + + +AQHOME_API int AQH_EventTimer_CheckWhetherTickTriggers(AQH_EVENT_TIMER *evt, uint64_t t); + + +#endif + + diff --git a/aqhome/events/timer_p.h b/aqhome/events/timer_p.h new file mode 100644 index 0000000..c6da06b --- /dev/null +++ b/aqhome/events/timer_p.h @@ -0,0 +1,34 @@ +/**************************************************************************** + * 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_EVENT_TIMER_P_H +#define AQH_EVENT_TIMER_P_H + + +#include "aqhome/events/timer.h" + + + +struct AQH_EVENT_TIMER { + GWEN_INHERIT_ELEMENT(AQH_EVENT_TIMER) + GWEN_LIST_ELEMENT(AQH_EVENT_TIMER) + + uint32_t flags; + int timerType; + uint64_t id; + uint64_t currentValue; + uint64_t reloadOrAlarmValue; + + int eventType; +}; + + + +#endif + +