Closed
Description
Service
objects contain a fieldmp_obj_list_t *characteristic_list
, which is meant to be a Python list ofCharacteristic
objects.Characteristic
objects containbleio_descriptor_obj_t *descriptor_list
, which is meant to be a linked list ofDescriptor
objects.Descriptor
objects containstruct _bleio_descriptor_obj* next
, which is used for the linked list.
But, there's this code:
which treats
descriptor_list
as a Python list. This is bad. Figure out what is wrong.
I have this vague and possibly wrong memory: I think I originally used Python lists, and then decided that I should not do storage allocation in the SD event handlers, and changed to a linked list instead. But clearly this changeover was not done consistently. I think all of these could be linked lists.
The code above is only used for remote Descriptors
(it's called in discovery), and the descriptor_list
is used as a linked list in common_hal_bleio_characteristic_add_descriptor()
, which is for local Descriptors
. So perhaps that's this inconsistency is not breaking anything, but it's still not right.