GroupObjects can communicate internally (#194)

* 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

* FIX-Works now also if SMALL_GROUPOBJECT is not set

* Remove #ifdef INTERNAL_GROUPOBJECT

Co-authored-by: Waldemar Porscha <waldemar.porscha@sap.com>
This commit is contained in:
mumpf 2022-04-12 00:28:21 +02:00 committed by GitHub
parent 2453c3ce5d
commit 9c620a013d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,8 +69,21 @@ void BauSystemBDevice::sendNextGroupTelegram()
if (flag != ReadRequest && flag != WriteRequest)
continue;
if (flag == WriteRequest)
{
#ifdef SMALL_GROUPOBJECT
GroupObject::processClassCallback(go);
#else
GroupObjectUpdatedHandler handler = go.callback();
if (handler)
handler(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 +126,8 @@ void BauSystemBDevice::updateGroupObject(GroupObject & go, uint8_t * data, uint8
memcpy(goData, data, length);
go.commFlag(Updated);
if (go.commFlag() != WriteRequest)
{
#ifdef SMALL_GROUPOBJECT
GroupObject::processClassCallback(go);
#else
@ -121,6 +135,8 @@ void BauSystemBDevice::updateGroupObject(GroupObject & go, uint8_t * data, uint8
if (handler)
handler(go);
#endif
}
go.commFlag(Updated);
}
bool BauSystemBDevice::configured()