-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add activity callback function #264
Conversation
…y (for e.g. flashing LEDs) Can be enabled with KNX_ACTIVITYCALLBACK # Conflicts: # src/knx/ip_data_link_layer.cpp
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment on PR:
yes you are right. |
…ore flexible approach. For performace reasons, the calls in the actual link layer is only activated when KNX_ACTIVITYCALLBACK is defined. There is now a DataLinkLayerCallback class where a specific Bau *can* inherit from and - if the specific link layer supports it, pass itself to that linklayer(s).
Hi Thomas, I redesigned the feature according you hints. |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This version is fine beside some minor style issues. Sorry for being nitpicky but I have to work with code at work were people weren't for a few years...
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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All ok now.
For knx-ip you should be able open more than one multicast connection from one host and use them in parallel. |
Add the possibility to have a callback function signaling knx activity (for e.g. flashing LEDs)
Can be enabled with KNX_ACTIVITYCALLBACK