Skip to content

aioble: Add support for write-with-update. #437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion micropython/bluetooth/aioble/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ aioble

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

**Note**: aioble requires MicroPython v1.15 or higher.
**Note**: aioble requires MicroPython v1.17 or higher.

Features
--------
Expand Down
6 changes: 3 additions & 3 deletions micropython/bluetooth/aioble/aioble/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ def read(self):
else:
return ble.gatts_read(self._value_handle)

# Write value to local db.
def write(self, data):
# Write value to local db, and optionally notify/indicate subscribers.
def write(self, data, send_update=False):
if self._value_handle is None:
self._initial = data
else:
ble.gatts_write(self._value_handle, data)
ble.gatts_write(self._value_handle, data, send_update)

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