diff --git a/pycardium/modules/modbluetooth_card10.c b/pycardium/modules/modbluetooth_card10.c index 9923a2fd6728ba305f32c5c8744d774557b672f7..55bdb99f77802752b474821eb2eadcd17debb5dd 100644 --- a/pycardium/modules/modbluetooth_card10.c +++ b/pycardium/modules/modbluetooth_card10.c @@ -99,6 +99,8 @@ static void handle_att_event(struct epic_att_event *att_event) uint16_t end_handle = (v[i + 3] << 8) | v[i + 2]; mp_obj_bluetooth_uuid_t service_uuid; + service_uuid.base.type = + &mp_type_bluetooth_uuid; if (entry_size == 6) { memcpy(service_uuid.data, v + i + 4, 2); service_uuid.type = @@ -142,6 +144,8 @@ static void handle_att_event(struct epic_att_event *att_event) uint16_t value_handle = (v[i + 4] << 8) | v[i + 3]; mp_obj_bluetooth_uuid_t characteristic_uuid; + characteristic_uuid.base.type = + &mp_type_bluetooth_uuid; if (entry_size == 2 + 1 + 2 + 2) { memcpy(characteristic_uuid.data, v + i + 5, @@ -189,6 +193,8 @@ static void handle_att_event(struct epic_att_event *att_event) uint16_t descriptor_handle = (v[i + 1] << 8) | v[i]; mp_obj_bluetooth_uuid_t descriptor_uuid; + descriptor_uuid.base.type = + &mp_type_bluetooth_uuid; if (entry_size == 2 + 2) { memcpy(descriptor_uuid.data, v + i + 2, diff --git a/pycardium/mpconfigport.h b/pycardium/mpconfigport.h index fbe33070bc8425a91f7a12cfe6ca35a16ea71a0f..943f9c4a55233b7c400e575a692cc1b4cffc0b6d 100644 --- a/pycardium/mpconfigport.h +++ b/pycardium/mpconfigport.h @@ -56,6 +56,7 @@ int mp_hal_csprng_read_int(void); #define MICROPY_PY_BLUETOOTH (1) #define MICROPY_PY_BUILTINS_MEMORYVIEW (1) #define MICROPY_PY_BLUETOOTH_ENABLE_CENTRAL_MODE (1) +#define MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS (1) /* Modules */ #define MODULE_BHI160_ENABLED (1)