Closed ChocolateLoverRaj closed 9 months ago
The current behavior is expected. Notify is not automatically invoked so that users can use it when they want to.
However, I did not realize that it is a hard to call notify when writing from the outside. So, I added notify funciton to OnWriteArgs so that you can easily notify as follows.
characteristic
.lock()
.on_write(|args| {
args.notify();
});
I connected to an ESP32-C3 BLE server and there is a read, write, and notify characteristic. I enabled notifications on the first device and then changed the value with the second device. The first device did not get a notification. When I read the value with the first device manually, I saw the updated value. When I added
notify()
to the code on write, notifications worked as expected.