Skip to content

Commit 6a33bde

Browse files
committed
aioble: Add support for write-with-update.
This allows a server to write a characteristic and automatically notify/indicate all subscribed clients. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
1 parent 43cad17 commit 6a33bde

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

micropython/bluetooth/aioble/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ aioble
33

44
This library provides an object-oriented, asyncio-based wrapper for MicroPython's [ubluetooth](https://docs.micropython.org/en/latest/library/ubluetooth.html) API.
55

6-
**Note**: aioble requires MicroPython v1.15 or higher.
6+
**Note**: aioble requires MicroPython v1.17 or higher.
77

88
Features
99
--------

micropython/bluetooth/aioble/aioble/server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ def read(self):
8888
else:
8989
return ble.gatts_read(self._value_handle)
9090

91-
# Write value to local db.
92-
def write(self, data):
91+
# Write value to local db, and optionally notify/indicate subscribers.
92+
def write(self, data, send_update=False):
9393
if self._value_handle is None:
9494
self._initial = data
9595
else:
96-
ble.gatts_write(self._value_handle, data)
96+
ble.gatts_write(self._value_handle, data, send_update)
9797

9898
# Wait for a write on this characteristic. Returns the connection that did
9999
# the write, or a tuple of (connection, value) if capture is enabled for

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy