thelsing / knx

knx stack (TP, IP and RF) for arduino and linux, Can be configured with ETS
GNU General Public License v3.0
276 stars 95 forks source link

GroupObjects can communicate internally #194

Closed mumpf closed 2 years ago

mumpf commented 2 years ago

Without INTERNAL_GROUPOBJECT the behaviour is not changed. Otherwise the callback, which indicates a GO change is called also as soon as an GO value is sent to the KNX-Bus. In most cases such a behaviour is not necessary. I need it for my generic logicmodule to allow generic connections of Output-GO with Input-GO without sending anything to the KNX bus.

The change is as minimal invasive as I could do...

Regards, Waldemar

thelsing commented 2 years ago

Can't you just move the whole callback handling to the front of the function? Without any ifdefs. The code is simpler I don't see any case where this would hurt.

mumpf commented 2 years ago

Just to mention possible side effects:

ifdef SMALL_GROUPOBJECT is necessary for all users, which use the former large Groupobjects. But I think, you ment

ifdef INTERNAL_GROUPOBJECT.

If I remove this, there is one marginal sideeffect for existing firmwares: For pure outputs (GO with CRT-Flags - German: KLÜ-Flags), now an additional callback will be raised. This might be a problem for existing firmwares. Otherwise: The same would also happen without my change, if in ETS someone sets the W-Flag (German: S-Flag) to this GO, so the event handling should already be aware of such a case. Because users do not very often change flags, developers might not be aware of this case.

I can remove #ifdef INTERNAL_GROUPOBJECT, but I just want doblecheck with you if it is ok with this potential sideeffect.

Regards, Waldemar

thelsing commented 2 years ago

Yes I'm fine with that. Simplicity rules!

mumpf commented 2 years ago

Hi, I removed the #ifdef INTERNAL_GROUPOBJECT parts. As already explained, SMALL_GROUPOBJECT cannot be removed.

Regards, Waldemar