NordicSemiconductor / Android-BLE-Library

A library that makes working with Bluetooth LE on Android a pleasure. Seriously.
BSD 3-Clause "New" or "Revised" License
2.03k stars 417 forks source link

Sending a notification when not enabled returns a failure #490

Closed philips77 closed 1 year ago

philips77 commented 1 year ago

This PR fixes #474.

Before the change, if notifications or indications were not enabled by client and the server tried to send one, the request was quietly ignored. This might have caused issues when using suspend(), as such suspension would never finish. After the change such request will return in a failure with status FailCallback.REASON_NOT_ENABLED. suspend() or await() methods should throw RequestFailedException with that status.