From 6a33bde1bfc2872e26399a74089eccff0b853f86 Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Fri, 23 Jul 2021 15:13:50 +1000 Subject: [PATCH] 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 --- micropython/bluetooth/aioble/README.md | 2 +- micropython/bluetooth/aioble/aioble/server.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/micropython/bluetooth/aioble/README.md b/micropython/bluetooth/aioble/README.md index 5d4208c0d..dd2318ee0 100644 --- a/micropython/bluetooth/aioble/README.md +++ b/micropython/bluetooth/aioble/README.md @@ -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 -------- diff --git a/micropython/bluetooth/aioble/aioble/server.py b/micropython/bluetooth/aioble/aioble/server.py index c037cc83d..f87e47329 100644 --- a/micropython/bluetooth/aioble/aioble/server.py +++ b/micropython/bluetooth/aioble/aioble/server.py @@ -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 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