You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am a newbie with rust. I would like to a sample/example of writing to a BLE characteristics with notify. I really appreciate if someone is kind enough give me a helping hand. Thank you,
The text was updated successfully, but these errors were encountered:
I can't give you a full blown example, but the basic idea is to scan for peripherals from your central device (that is the adapter in ble terminology):
let predicate = ...let p = central.peripherals().into_iter().find(predicate)
if you have a peripheral, scan for characteristics:
let chars = p.discover_characteristics()
then find your characteristic
let rx_char = chars
.clone().into_iter().find(|c| RECEIVE_CHARACTERISTIC == c.uuid).expect("Could not find given characteristic");
RECEIVE_CHARACTERISTIC is a UUID. From here, you can call methods like subscribe, send , on_notification and so on. Hope that helps.
I am a newbie with rust. I would like to a sample/example of writing to a BLE characteristics with notify. I really appreciate if someone is kind enough give me a helping hand. Thank you,
The text was updated successfully, but these errors were encountered: