Ralim / IronOS

Open Source Soldering Iron firmware
https://ralim.github.io/IronOS/
GNU General Public License v3.0
7.09k stars 707 forks source link

use notify for real time BLE data #1559

Open TomW1605 opened 1 year ago

TomW1605 commented 1 year ago

Describe the solution you'd like

curently you need to poll data from BLE however BLE provids functions for the server to notify the client of changes in data. this would prevent spaming data requests and provide more realtime data

Additional context

i have started working on this and got a basic proof of concept working using the bulk data polling callback to trigger a notify on the temp. this worked however given it still relies on poling dosnt really help. unfortunatly i dont know/understand enough about the program flow of the code to work out where best to put the notify callback.

here is what i have so far https://github.com/TomW1605/IronOS/commit/330761cbde81234337f49f435f186d8e60f1f8a5

i do intend to keep working on this however i think it will either take a long time or i will need help from someone with a better understanding of the code

TomW1605 commented 1 year ago

there is one option that uses notify to make more eficent use of data while still triggering with polling. if you have a spesific BLE characteristic that is polled it can trigger a notify for any values that have changed while not sending ones that havnt. im not sure how much this would help to make it worth it for the possible issues of storing the last value but it might help.

Particpant commented 7 months ago

Oh, this would be really helpful.