summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarturo182 <arturo182@tlen.pl>2018-07-25 23:20:40 +0200
committerarturo182 <arturo182@tlen.pl>2018-10-21 16:00:01 +0200
commitad466b3edbf5848febf062dff125e6a019ac88f5 (patch)
treecf0a609b0e5bd1e9ef3d51d367b18ac3db4e9ae4
parentbeee58a56f8105efa5c4d1b4450636fd14ef4bc3 (diff)
bleio: Let Characteristic inherit the Services UUID length
-rw-r--r--shared-bindings/bleio/Service.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/shared-bindings/bleio/Service.c b/shared-bindings/bleio/Service.c
index 94d245d7f..a5043a346 100644
--- a/shared-bindings/bleio/Service.c
+++ b/shared-bindings/bleio/Service.c
@@ -113,7 +113,10 @@ STATIC mp_obj_t bleio_service_add_characteristic(mp_obj_t self_in, mp_obj_t char
bleio_service_obj_t *self = MP_OBJ_TO_PTR(self_in);
bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(characteristic_in);
- // TODO: If service is 128b then update Chara UUID to be 128b too
+ if (self->uuid->type == UUID_TYPE_128BIT) {
+ characteristic->uuid->type = UUID_TYPE_128BIT;
+ characteristic->uuid->uuid_vs_idx = self->uuid->uuid_vs_idx;
+ }
common_hal_bleio_service_add_characteristic(self, characteristic);