From f7e8fec2ff212d5e7e0343b524ac7751c15527c5 Mon Sep 17 00:00:00 2001 From: Waldemar Porscha Date: Fri, 1 Apr 2022 18:04:01 +0200 Subject: [PATCH] GroupObjects can communicate internally - GroupObjects use callback infrastructure also during write to bus - external and internal write of a GO can be handled identically - needs #define INTERNAL_GROUPOBJECT --- src/knx/bau_systemB_device.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/knx/bau_systemB_device.cpp b/src/knx/bau_systemB_device.cpp index 37289af..8821744 100644 --- a/src/knx/bau_systemB_device.cpp +++ b/src/knx/bau_systemB_device.cpp @@ -69,8 +69,15 @@ void BauSystemBDevice::sendNextGroupTelegram() if (flag != ReadRequest && flag != WriteRequest) continue; +#ifdef INTERNAL_GROUPOBJECT + if (flag == WriteRequest) + GroupObject::processClassCallback(go); +#endif if (!go.communicationEnable()) + { + go.commFlag(Ok); continue; + } SecurityControl goSecurity; goSecurity.toolAccess = false; // Secured group communication never uses the toolkey. ETS knows all keys, also the group keys. @@ -113,7 +120,10 @@ void BauSystemBDevice::updateGroupObject(GroupObject & go, uint8_t * data, uint8 memcpy(goData, data, length); - go.commFlag(Updated); +#ifdef INTERNAL_GROUPOBJECT + if (go.commFlag() != WriteRequest) + { +#endif #ifdef SMALL_GROUPOBJECT GroupObject::processClassCallback(go); #else @@ -121,6 +131,10 @@ void BauSystemBDevice::updateGroupObject(GroupObject & go, uint8_t * data, uint8 if (handler) handler(go); #endif +#ifdef INTERNAL_GROUPOBJECT + } +#endif + go.commFlag(Updated); } bool BauSystemBDevice::configured()