bluerange-io / bluerange-mesh

BlueRange Mesh (formerly FruityMesh) - The first completely connection-based open source mesh on top of Bluetooth Low Energy (4.1/5.0 or higher)
https://bluerange.io/
Other
287 stars 109 forks source link

Added button state to button handler #126

Closed NilsMinor closed 3 years ago

NilsMinor commented 4 years ago

I added an ButtonState enum to with the states INITAL, PRESSED, RELEASED. I also added a new variable 'ButtonState button1State' to . The button handler will be called on falling and rising edge and still stores the hold time in button1HoldTimeDs. Inside the overwritten Module::ButtonHandler function the user can use the new parameter 'ButtonState buttonState' to check whether it is a pressed or released event. #123

mariusheil commented 4 years ago

Hi,

that looks perfect, thanks. There is one thing however. My boss mentioned to me, that because we are GPL based, we need to make sure that all contributions can be used under GPL. He told me that he will follow up with you on how this is done.

Marius

NilsMinor commented 4 years ago

Hi Marius,

sounds good :) I never really contributed to other projects so let me know if you boss has any issues with my PR or with the license. My code would of course not change your GPL license.

Nils

viveknath93 commented 4 years ago

Hi, I have a doubt! I am new to this open-source development. As per my understanding, you are using the button for unenrolling the beacons by sending unenrollment packets to other nodes. I need to use the button for different functionality - For Enrolling as well as Unenrolling / To trigger some messages to another node.

What if the existing development is conflicting than that I need? Should I create local copies and use ?

Thanks in advance!

mariusheil commented 4 years ago

Hi, the ButtonHandler is only implemented in the different Vendor modules with some functionality, so you will only have access to your own implementation. Whenever we used the button for some functionality in the open source modules, we also added a configuration variable to activate or deactivate this behaviour. You can simply disable this behaviour in your own featureset by activating what you want and disabling what you do not want. We also use the button for different functionality for different featuresets that we develop.

viveknath93 commented 4 years ago

Hi, the ButtonHandler is only implemented in the different Vendor modules with some functionality, so you will only have access to your own implementation. Whenever we used the button for some functionality in the open source modules, we also added a configuration variable to activate or deactivate this behaviour. You can simply disable this behaviour in your own featureset by activating what you want and disabling what you do not want. We also use the button for different functionality for different featuresets that we develop.

Thank you for the information.