Skip to content

Commit ad466b3

Browse files
committed
bleio: Let Characteristic inherit the Services UUID length
1 parent beee58a commit ad466b3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

shared-bindings/bleio/Service.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ STATIC mp_obj_t bleio_service_add_characteristic(mp_obj_t self_in, mp_obj_t char
113113
bleio_service_obj_t *self = MP_OBJ_TO_PTR(self_in);
114114
bleio_characteristic_obj_t *characteristic = MP_OBJ_TO_PTR(characteristic_in);
115115

116-
// TODO: If service is 128b then update Chara UUID to be 128b too
116+
if (self->uuid->type == UUID_TYPE_128BIT) {
117+
characteristic->uuid->type = UUID_TYPE_128BIT;
118+
characteristic->uuid->uuid_vs_idx = self->uuid->uuid_vs_idx;
119+
}
117120

118121
common_hal_bleio_service_add_characteristic(self, characteristic);
119122

0 commit comments

Comments
 (0)