https://toitlang.org/ logo
When you are done just `read-characteristic.unsubs...
# general
f
When you are done just
read-characteristic.unsubscribe
and then
break
to get out of the loop. Or, if you only need one notification, don't even write the loop.
Copy code
read-characteristic.subscribe
incoming-data := read-characteristic.wait-for-notification
read-characteristic.unsubscribe
If it's an RPC and you only do one RPC call, you can probably even avoid the task:
Copy code
read-characteristic.subscribe
write-characteristic.write #[some-message]
incoming := read-characteristic.wait-for-notification
read-characteristic.unsubscribe