@@ -539,7 +539,7 @@ void att_remove_connection(uint16_t conn_handle, uint8_t reason) {
539
539
.len = sizeof (zero ),
540
540
};
541
541
542
- if (MP_OBJ_IS_TYPE (attribute_obj , & bleio_descriptor_type )) {
542
+ if (mp_obj_is_type (attribute_obj , & bleio_descriptor_type )) {
543
543
bleio_descriptor_obj_t * descriptor = MP_OBJ_TO_PTR (attribute_obj );
544
544
if (bleio_uuid_get_uuid16_or_unknown (descriptor -> uuid ) == BLE_UUID_CCCD ) {
545
545
common_hal_bleio_descriptor_set_value (descriptor , & zero_cccd_value );
@@ -800,7 +800,7 @@ STATIC void process_find_info_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl
800
800
// Fetch the uuid for the given attribute, which might be a characteristic or a descriptor.
801
801
bleio_uuid_obj_t * uuid ;
802
802
803
- if (MP_OBJ_IS_TYPE (attribute_obj , & bleio_characteristic_type )) {
803
+ if (mp_obj_is_type (attribute_obj , & bleio_characteristic_type )) {
804
804
bleio_characteristic_obj_t * characteristic = MP_OBJ_TO_PTR (attribute_obj );
805
805
if (characteristic -> handle != handle ) {
806
806
// If the handles don't match, this is the characteristic definition attribute.
@@ -971,7 +971,7 @@ void process_read_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t dlen, ui
971
971
}
972
972
973
973
mp_obj_t * attribute_obj = bleio_adapter_get_attribute (& common_hal_bleio_adapter_obj , handle );
974
- if (MP_OBJ_IS_TYPE (attribute_obj , & bleio_service_type )) {
974
+ if (mp_obj_is_type (attribute_obj , & bleio_service_type )) {
975
975
bleio_service_obj_t * service = MP_OBJ_TO_PTR (attribute_obj );
976
976
977
977
// Is this a 16-bit or a 128-bit uuid? It must match in size with any previous attribute
@@ -1083,7 +1083,7 @@ STATIC void process_read_or_read_blob_req(uint16_t conn_handle, uint16_t mtu, ui
1083
1083
size_t rsp_length = sizeof (rsp_t );
1084
1084
1085
1085
mp_obj_t * attribute_obj = bleio_adapter_get_attribute (& common_hal_bleio_adapter_obj , handle );
1086
- if (MP_OBJ_IS_TYPE (attribute_obj , & bleio_service_type )) {
1086
+ if (mp_obj_is_type (attribute_obj , & bleio_service_type )) {
1087
1087
if (offset ) {
1088
1088
send_error (conn_handle , BT_ATT_ERR_ATTRIBUTE_NOT_LONG , handle , BT_ATT_ERR_INVALID_PDU );
1089
1089
return ;
@@ -1095,7 +1095,7 @@ STATIC void process_read_or_read_blob_req(uint16_t conn_handle, uint16_t mtu, ui
1095
1095
common_hal_bleio_uuid_pack_into (service -> uuid , rsp -> r .value );
1096
1096
rsp_length += sizeof_service_uuid ;
1097
1097
1098
- } else if (MP_OBJ_IS_TYPE (attribute_obj , & bleio_characteristic_type )) {
1098
+ } else if (mp_obj_is_type (attribute_obj , & bleio_characteristic_type )) {
1099
1099
bleio_characteristic_obj_t * characteristic = MP_OBJ_TO_PTR (attribute_obj );
1100
1100
if (characteristic -> decl_handle == handle ) {
1101
1101
// Read characteristic declaration. Return properties, value handle, and uuid.
@@ -1135,7 +1135,7 @@ STATIC void process_read_or_read_blob_req(uint16_t conn_handle, uint16_t mtu, ui
1135
1135
memcpy (rsp -> r .value , bufinfo .buf + offset , value_length );
1136
1136
rsp_length += value_length ;
1137
1137
}
1138
- } else if (MP_OBJ_IS_TYPE (attribute_obj , & bleio_descriptor_type )) {
1138
+ } else if (mp_obj_is_type (attribute_obj , & bleio_descriptor_type )) {
1139
1139
bleio_descriptor_obj_t * descriptor = MP_OBJ_TO_PTR (attribute_obj );
1140
1140
1141
1141
mp_buffer_info_t bufinfo ;
@@ -1203,7 +1203,7 @@ STATIC void process_read_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl
1203
1203
mp_obj_t * attribute_obj = bleio_adapter_get_attribute (& common_hal_bleio_adapter_obj , handle );
1204
1204
1205
1205
if (type_uuid == BLE_UUID_CHARACTERISTIC &&
1206
- MP_OBJ_IS_TYPE (attribute_obj , & bleio_characteristic_type )) {
1206
+ mp_obj_is_type (attribute_obj , & bleio_characteristic_type )) {
1207
1207
// Request is for characteristic declarations.
1208
1208
bleio_characteristic_obj_t * characteristic = MP_OBJ_TO_PTR (attribute_obj );
1209
1209
@@ -1250,7 +1250,7 @@ STATIC void process_read_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl
1250
1250
rsp_length += data_length ;
1251
1251
no_data = false;
1252
1252
1253
- } else if (MP_OBJ_IS_TYPE (attribute_obj , & bleio_descriptor_type )) {
1253
+ } else if (mp_obj_is_type (attribute_obj , & bleio_descriptor_type )) {
1254
1254
// See if request is for a descriptor value with a 16-bit UUID, such as the CCCD.
1255
1255
bleio_descriptor_obj_t * descriptor = MP_OBJ_TO_PTR (attribute_obj );
1256
1256
if (bleio_uuid_get_uuid16_or_unknown (descriptor -> uuid ) == type_uuid ) {
@@ -1271,7 +1271,7 @@ STATIC void process_read_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl
1271
1271
break ;
1272
1272
}
1273
1273
1274
- } else if (MP_OBJ_IS_TYPE (attribute_obj , & bleio_characteristic_type )) {
1274
+ } else if (mp_obj_is_type (attribute_obj , & bleio_characteristic_type )) {
1275
1275
// See if request is for a characteristic value with a 16-bit UUID.
1276
1276
bleio_characteristic_obj_t * characteristic = MP_OBJ_TO_PTR (attribute_obj );
1277
1277
if (bleio_uuid_get_uuid16_or_unknown (characteristic -> uuid ) == type_uuid ) {
@@ -1359,7 +1359,7 @@ STATIC void process_write_req_or_cmd(uint16_t conn_handle, uint16_t mtu, uint8_t
1359
1359
1360
1360
mp_obj_t attribute_obj = bleio_adapter_get_attribute (& common_hal_bleio_adapter_obj , req -> handle );
1361
1361
1362
- if (MP_OBJ_IS_TYPE (attribute_obj , & bleio_characteristic_type )) {
1362
+ if (mp_obj_is_type (attribute_obj , & bleio_characteristic_type )) {
1363
1363
bleio_characteristic_obj_t * characteristic = MP_OBJ_TO_PTR (attribute_obj );
1364
1364
1365
1365
// Don't write the characteristic declaration.
@@ -1377,7 +1377,7 @@ STATIC void process_write_req_or_cmd(uint16_t conn_handle, uint16_t mtu, uint8_t
1377
1377
// Just change the local value. Don't fire off notifications, etc.
1378
1378
bleio_characteristic_set_local_value (characteristic , & bufinfo );
1379
1379
1380
- } else if (MP_OBJ_IS_TYPE (attribute_obj , & bleio_descriptor_type )) {
1380
+ } else if (mp_obj_is_type (attribute_obj , & bleio_descriptor_type )) {
1381
1381
bleio_descriptor_obj_t * descriptor = MP_OBJ_TO_PTR (attribute_obj );
1382
1382
// Only CCCD's are writable.
1383
1383
if (bleio_uuid_get_uuid16_or_unknown (descriptor -> uuid ) != BLE_UUID_CCCD ) {
@@ -1427,7 +1427,7 @@ STATIC void process_prepare_write_req(uint16_t conn_handle, uint16_t mtu, uint8_
1427
1427
1428
1428
mp_obj_t * attribute = bleio_adapter_get_attribute (& common_hal_bleio_adapter_obj , handle );
1429
1429
1430
- if (!MP_OBJ_IS_TYPE (attribute , & bleio_characteristic_type )) {
1430
+ if (!mp_obj_is_type (attribute , & bleio_characteristic_type )) {
1431
1431
send_error (conn_handle , BT_ATT_OP_PREPARE_WRITE_REQ , handle , BT_ATT_ERR_ATTRIBUTE_NOT_LONG );
1432
1432
return ;
1433
1433
}
0 commit comments