floitsch
12/08/2025, 12:58 PMread-characteristic.unsubscribe and then break to get out of the loop.
Or, if you only need one notification, don't even write the loop.
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:
read-characteristic.subscribe
write-characteristic.write #[some-message]
incoming := read-characteristic.wait-for-notification
read-characteristic.unsubscribe