diff options
author | Jim Mussared <jim.mussared@gmail.com> | 2023-03-02 15:40:59 +1100 |
---|---|---|
committer | Jim Mussared <jim.mussared@gmail.com> | 2023-04-26 11:37:20 +1000 |
commit | bc9ec1cf718361c1f361bb4ff6de3c660d84696d (patch) | |
tree | f4234b532df54ae9577f10cdc5aa385ce97c77d4 /docs/library/bluetooth.rst | |
parent | 9e6885ad820a9f42bf93df56eb3f3be0c8639622 (diff) | |
download | micropython-bc9ec1cf718361c1f361bb4ff6de3c660d84696d.tar.gz micropython-bc9ec1cf718361c1f361bb4ff6de3c660d84696d.zip |
extmod/modbluetooth: Merge gatts_notify/indicate implementation.
Makes gatts_notify and gatts_indicate work in the same way: by default they
send the DB value, but you can manually override the payload.
In other words, makes gatts_indicate work the same as gatts_notify.
Note: This removes support for queuing notifications and indications on
btstack when the ACL buffer is full. This functionality will be
reimplemented in a future commit.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'docs/library/bluetooth.rst')
-rw-r--r-- | docs/library/bluetooth.rst | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/docs/library/bluetooth.rst b/docs/library/bluetooth.rst index 8f7041e8d3..63578af16e 100644 --- a/docs/library/bluetooth.rst +++ b/docs/library/bluetooth.rst @@ -514,19 +514,24 @@ writes from a client to a given characteristic, use Sends a notification request to a connected client. - If *data* is not ``None``, then that value is sent to the client as part of - the notification. The local value will not be modified. + If *data* is ``None`` (the default), then the current local value (as set + with :meth:`gatts_write <BLE.gatts_write>`) will be sent. - Otherwise, if *data* is ``None``, then the current local value (as - set with :meth:`gatts_write <BLE.gatts_write>`) will be sent. + Otherwise, if *data* is not ``None``, then that value is sent to the client + as part of the notification. The local value will not be modified. **Note:** The notification will be sent regardless of the subscription status of the client to this characteristic. -.. method:: BLE.gatts_indicate(conn_handle, value_handle, /) +.. method:: BLE.gatts_indicate(conn_handle, value_handle, data=None, /) - Sends an indication request containing the characteristic's current value to - a connected client. + Sends a indication request to a connected client. + + If *data* is ``None`` (the default), then the current local value (as set + with :meth:`gatts_write <BLE.gatts_write>`) will be sent. + + Otherwise, if *data* is not ``None``, then that value is sent to the client + as part of the indication. The local value will not be modified. On acknowledgment (or failure, e.g. timeout), the ``_IRQ_GATTS_INDICATE_DONE`` event will be raised. |