summaryrefslogtreecommitdiff
path: root/shared-bindings/bleio/CharacteristicBuffer.c
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2019-07-18 10:08:58 -0700
committerGitHub <noreply@github.com>2019-07-18 10:08:58 -0700
commit74be29cbf923fc2a40c103ab722e996045b72827 (patch)
tree30e6f405cd6da1fc0067ca304c2b0ebd4460e9fe /shared-bindings/bleio/CharacteristicBuffer.c
parentd12e1a8d74ebb8d5d32ab0de47d3097e80c5d4fd (diff)
parent1c31cf5f6a6d9cff6f086114f6e0a03b5247c623 (diff)
Merge pull request #1993 from dhalbert/ble-scanner5.0.0-alpha.0
bleio: add central and scanner functionality, cleanup bleio API, some code restructure
Diffstat (limited to 'shared-bindings/bleio/CharacteristicBuffer.c')
-rw-r--r--shared-bindings/bleio/CharacteristicBuffer.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/shared-bindings/bleio/CharacteristicBuffer.c b/shared-bindings/bleio/CharacteristicBuffer.c
index a1dc663fd..26f9e012b 100644
--- a/shared-bindings/bleio/CharacteristicBuffer.c
+++ b/shared-bindings/bleio/CharacteristicBuffer.c
@@ -49,10 +49,13 @@ STATIC void raise_error_if_not_connected(bleio_characteristic_buffer_obj_t *self
//|
//| .. class:: CharacteristicBuffer(characteristic, *, timeout=1, buffer_size=64)
//|
-//| Create a new Characteristic object identified by the specified UUID.
+//| Monitor the given Characteristic. Each time a new value is written to the Characteristic
+//| add the newly-written bytes to a FIFO buffer.
//|
-//| :param bleio.Characteristic characteristic: The characteristic to monitor
-//| :param int timeout: the timeout in seconds to wait for the first character and between subsequent characters.//|
+//| :param bleio.Characteristic characteristic: The Characteristic to monitor.
+//| It may be a local Characteristic provided by a Peripheral Service, or a remote Characteristic
+//| in a remote Service that a Central has connected to.
+//| :param int timeout: the timeout in seconds to wait for the first character and between subsequent characters.
//| :param int buffer_size: Size of ring buffer that stores incoming data coming from client.
//| Must be >= 1.
//|
@@ -85,9 +88,8 @@ STATIC mp_obj_t bleio_characteristic_buffer_make_new(const mp_obj_type_t *type,
bleio_characteristic_buffer_obj_t *self = m_new_obj(bleio_characteristic_buffer_obj_t);
self->base.type = &bleio_characteristic_buffer_type;
- self->characteristic = MP_OBJ_TO_PTR(characteristic);
- common_hal_bleio_characteristic_buffer_construct(self, self->characteristic, timeout, buffer_size);
+ common_hal_bleio_characteristic_buffer_construct(self, MP_OBJ_TO_PTR(characteristic), timeout, buffer_size);
return MP_OBJ_FROM_PTR(self);
}