thelsing / knx

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

Add activity callback function #264

Closed Ing-Dom closed 6 months ago

Ing-Dom commented 6 months ago

Add the possibility to have a callback function signaling knx activity (for e.g. flashing LEDs)

Can be enabled with KNX_ACTIVITYCALLBACK

thelsing commented 6 months ago

For achitectional reasons I will not merge this. The knx-Facade implements the facade pattern an simplifies usage for lib users. It is completely optional. Therefore you can't use it in any of the other parts of the stack. For the same reason its global instance must not be used in the stack.

The correct way is to add the callback to be Bau. There can be multiple Baus (in routers for example) and each can have its own callback.

Ing-Dom commented 6 months ago

yes you are right. I'll rework it. do you really mean bau, because the router baus in the stack are "single" I think you mean more then one link layer do you, like in the bau091A ? (or the other coupler baus)

Ing-Dom commented 6 months ago

Hi Thomas,

I redesigned the feature according you hints.

thelsing commented 6 months ago

I mean more than one logical device in one physical device. My ip router for example has one PA for the router application and a different one for additional stuff like providing time to the bus. The facade was never meant for bigger stuff like openknx with people who know how the stack is structured, but for simple sketches for typical arduino users.

Ing-Dom commented 6 months ago

I mean more than one logical device in one physical device. My ip router for example has one PA for the router application and a different one for additional stuff like providing time to the bus. The facade was never meant for bigger stuff like openknx with people who know how the stack is structured, but for simple sketches for typical arduino users.

I work on an ip router (091A) based on this stack for alomost one year (PR will come if its a little more field tested). For this I thought about how to solve the second application (virtual knx device) but I think that will not be so easy - some sort of bus-access splitter (or however you call it) would be neccessary, right?

thelsing commented 6 months ago

I work on an ip router (091A) based on this stack for alomost one year (PR will come if its a little more field tested). For this I thought about how to solve the second application (virtual knx device) but I think that will not be so easy - some sort of bus-access splitter (or however you call it) would be neccessary, right?

For knx-ip you should be able open more than one multicast connection from one host and use them in parallel.