summaryrefslogtreecommitdiff
path: root/shared-bindings
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2019-01-03 21:42:42 -0500
committerDan Halbert <halbert@halwitz.org>2019-01-03 21:42:42 -0500
commita77b2363eff14ae5b19c50a7d25b3db4ef6b200c (patch)
tree3b27fef3faf091e584b9990bf4a6f51cc1edb2c4 /shared-bindings
parent8dea6f53bbba5b76a5ed0965b44ad1bde4640609 (diff)
evt handler list bugs; unique evt handler names; remove uuid128_reference
Diffstat (limited to 'shared-bindings')
-rw-r--r--shared-bindings/bleio/Characteristic.c12
-rw-r--r--shared-bindings/bleio/UUID.c25
2 files changed, 11 insertions, 26 deletions
diff --git a/shared-bindings/bleio/Characteristic.c b/shared-bindings/bleio/Characteristic.c
index 7cffd2261..1d414b6d3 100644
--- a/shared-bindings/bleio/Characteristic.c
+++ b/shared-bindings/bleio/Characteristic.c
@@ -35,15 +35,21 @@
//| :class:`Characteristic` -- BLE service characteristic
//| =========================================================
//|
-//| Stores information about a BLE service characteristic and allows to read
-//| and write the characteristic's value.
+//| Stores information about a BLE service characteristic and allows reading
+//| and writing of the characteristic's value.
//|
//|
//| .. class:: Characteristic(uuid, *, broadcast=False, indicate=False, notify=False, read=False, write=False, write_no_response=False)
//|
//| Create a new Characteristic object identified by the specified UUID.
//|
-//| :param bleio.UUID uuid: The uuid of the characteristic (read_only)
+//| :param bleio.UUID uuid: The uuid of the characteristic
+//| :param bool broadcast: Allowed in advertising packets
+//| :param bool indicate: Server will indicate to the client when the value is set and wait for a response
+//| :param bool notify: Server will notify the client when the value is set
+//| :param bool read: Clients may read this characteristic
+//| :param bool write: Clients may write this characteristic; a response will be sent back
+//| :param bool write_no_response: Clients may write this characteristic; no response will be sent back
//|
STATIC mp_obj_t bleio_characteristic_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *pos_args) {
mp_arg_check_num(n_args, n_kw, 1, 1, true);
diff --git a/shared-bindings/bleio/UUID.c b/shared-bindings/bleio/UUID.c
index 7cef8c47f..2b42ab05c 100644
--- a/shared-bindings/bleio/UUID.c
+++ b/shared-bindings/bleio/UUID.c
@@ -109,8 +109,8 @@ const mp_obj_property_t bleio_uuid_uuid16_obj = {
//| .. attribute:: uuid128
//|
-//| The 128-bit value of the UUID, return as a bytes().
-//| Throws AttributeError if this is a 16-bit UUID. (read-only)
+//| The 128-bit value of the UUID, returned as bytes.
+//| Raises AttributeError if this is a 16-bit UUID. (read-only)
//|
STATIC mp_obj_t bleio_uuid_get_uuid128(mp_obj_t self_in) {
bleio_uuid_obj_t *self = MP_OBJ_TO_PTR(self_in);
@@ -131,26 +131,6 @@ const mp_obj_property_t bleio_uuid_uuid128_obj = {
(mp_obj_t)&mp_const_none_obj},
};
-//| .. attribute:: uuid128_reference
-//|
-//| An opaque reference representing the 128-bit UUID. (read-only)
-//| Returns None if this is a 16-bit UUID.
-//|
-STATIC mp_obj_t bleio_uuid_get_uuid128_reference(mp_obj_t self_in) {
- bleio_uuid_obj_t *self = MP_OBJ_TO_PTR(self_in);
- uint32_t reference = common_hal_bleio_uuid_get_uuid128_reference(self);
- return reference == 0 ? mp_const_none : MP_OBJ_NEW_SMALL_INT(reference);
-}
-
-MP_DEFINE_CONST_FUN_OBJ_1(bleio_uuid_get_uuid128_reference_obj, bleio_uuid_get_uuid128_reference);
-
-const mp_obj_property_t bleio_uuid_uuid128_reference_obj = {
- .base.type = &mp_type_property,
- .proxy = {(mp_obj_t)&bleio_uuid_get_uuid128_reference_obj,
- (mp_obj_t)&mp_const_none_obj,
- (mp_obj_t)&mp_const_none_obj},
-};
-
//| .. attribute:: size
//|
//| Returns 128 if this UUID represents a 128-bit vendor-specific UUID.
@@ -174,7 +154,6 @@ const mp_obj_property_t bleio_uuid_size_obj = {
STATIC const mp_rom_map_elem_t bleio_uuid_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_uuid16), MP_ROM_PTR(&bleio_uuid_uuid16_obj) },
{ MP_ROM_QSTR(MP_QSTR_uuid128), MP_ROM_PTR(&bleio_uuid_uuid128_obj) },
- { MP_ROM_QSTR(MP_QSTR_uuid128_reference), MP_ROM_PTR(&bleio_uuid_uuid128_reference_obj) },
{ MP_ROM_QSTR(MP_QSTR_size), MP_ROM_PTR(&bleio_uuid_size_obj) },
};