Skip to content

Commit b0ff23b

Browse files
committed
aioble: Add support for write-with-update.
Signed-off-by: Jim Mussared <[email protected]>
1 parent 3c383f6 commit b0ff23b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

micropython/bluetooth/aioble/aioble/server.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,15 @@ def read(self):
8383
return ble.gatts_read(self._value_handle)
8484

8585
# Write value to local db.
86-
def write(self, data):
86+
def write(self, data, send_update=False):
8787
if self._value_handle is None:
8888
self._initial = data
8989
else:
90-
ble.gatts_write(self._value_handle, data)
90+
if send_update:
91+
# Send_update arg only added in 1.17, don't pass this arg unless required.
92+
ble.gatts_write(self._value_handle, data, True)
93+
else:
94+
ble.gatts_write(self._value_handle, data)
9195

9296
# Wait for a write on this characteristic.
9397
# Returns the device that did the write.

0 commit comments

Comments
 (0)