@@ -539,7 +539,7 @@ void att_remove_connection(uint16_t conn_handle, uint8_t reason) {
539539                .len  =  sizeof (zero ),
540540            };
541541
542-             if  (MP_OBJ_IS_TYPE (attribute_obj , & bleio_descriptor_type )) {
542+             if  (mp_obj_is_type (attribute_obj , & bleio_descriptor_type )) {
543543                bleio_descriptor_obj_t  * descriptor  =  MP_OBJ_TO_PTR (attribute_obj );
544544                if  (bleio_uuid_get_uuid16_or_unknown (descriptor -> uuid ) ==  BLE_UUID_CCCD ) {
545545                    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
800800        // Fetch the uuid for the given attribute, which might be a characteristic or a descriptor. 
801801        bleio_uuid_obj_t  * uuid ;
802802
803-         if  (MP_OBJ_IS_TYPE (attribute_obj , & bleio_characteristic_type )) {
803+         if  (mp_obj_is_type (attribute_obj , & bleio_characteristic_type )) {
804804            bleio_characteristic_obj_t  * characteristic  =  MP_OBJ_TO_PTR (attribute_obj );
805805            if  (characteristic -> handle  !=  handle ) {
806806                // 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
971971        }
972972
973973        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 )) {
975975            bleio_service_obj_t  * service  =  MP_OBJ_TO_PTR (attribute_obj );
976976
977977            // 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
10831083    size_t  rsp_length  =  sizeof (rsp_t );
10841084
10851085    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 )) {
10871087        if  (offset ) {
10881088            send_error (conn_handle , BT_ATT_ERR_ATTRIBUTE_NOT_LONG , handle , BT_ATT_ERR_INVALID_PDU );
10891089            return ;
@@ -1095,7 +1095,7 @@ STATIC void process_read_or_read_blob_req(uint16_t conn_handle, uint16_t mtu, ui
10951095        common_hal_bleio_uuid_pack_into (service -> uuid , rsp -> r .value );
10961096        rsp_length  +=  sizeof_service_uuid ;
10971097
1098-     } else  if  (MP_OBJ_IS_TYPE (attribute_obj , & bleio_characteristic_type )) {
1098+     } else  if  (mp_obj_is_type (attribute_obj , & bleio_characteristic_type )) {
10991099        bleio_characteristic_obj_t  * characteristic  =  MP_OBJ_TO_PTR (attribute_obj );
11001100        if  (characteristic -> decl_handle  ==  handle ) {
11011101            // 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
11351135            memcpy (rsp -> r .value , bufinfo .buf  +  offset , value_length );
11361136            rsp_length  +=  value_length ;
11371137        }
1138-     } else  if  (MP_OBJ_IS_TYPE (attribute_obj , & bleio_descriptor_type )) {
1138+     } else  if  (mp_obj_is_type (attribute_obj , & bleio_descriptor_type )) {
11391139        bleio_descriptor_obj_t  * descriptor  =  MP_OBJ_TO_PTR (attribute_obj );
11401140
11411141        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
12031203        mp_obj_t  * attribute_obj  =  bleio_adapter_get_attribute (& common_hal_bleio_adapter_obj , handle );
12041204
12051205        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 )) {
12071207            // Request is for characteristic declarations. 
12081208            bleio_characteristic_obj_t  * characteristic  =  MP_OBJ_TO_PTR (attribute_obj );
12091209
@@ -1250,7 +1250,7 @@ STATIC void process_read_type_req(uint16_t conn_handle, uint16_t mtu, uint8_t dl
12501250            rsp_length  +=  data_length ;
12511251            no_data  =  false;
12521252
1253-         } else  if  (MP_OBJ_IS_TYPE (attribute_obj , & bleio_descriptor_type )) {
1253+         } else  if  (mp_obj_is_type (attribute_obj , & bleio_descriptor_type )) {
12541254            // See if request is for a descriptor value with a 16-bit UUID, such as the CCCD. 
12551255            bleio_descriptor_obj_t  * descriptor  =  MP_OBJ_TO_PTR (attribute_obj );
12561256            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
12711271                break ;
12721272            }
12731273
1274-         } else  if  (MP_OBJ_IS_TYPE (attribute_obj , & bleio_characteristic_type )) {
1274+         } else  if  (mp_obj_is_type (attribute_obj , & bleio_characteristic_type )) {
12751275            // See if request is for a characteristic value with a 16-bit UUID. 
12761276            bleio_characteristic_obj_t  * characteristic  =  MP_OBJ_TO_PTR (attribute_obj );
12771277            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
13591359
13601360    mp_obj_t  attribute_obj  =  bleio_adapter_get_attribute (& common_hal_bleio_adapter_obj , req -> handle );
13611361
1362-     if  (MP_OBJ_IS_TYPE (attribute_obj , & bleio_characteristic_type )) {
1362+     if  (mp_obj_is_type (attribute_obj , & bleio_characteristic_type )) {
13631363        bleio_characteristic_obj_t  * characteristic  =  MP_OBJ_TO_PTR (attribute_obj );
13641364
13651365        //  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
13771377        // Just change the local value. Don't fire off notifications, etc. 
13781378        bleio_characteristic_set_local_value (characteristic , & bufinfo );
13791379
1380-     } else  if  (MP_OBJ_IS_TYPE (attribute_obj , & bleio_descriptor_type )) {
1380+     } else  if  (mp_obj_is_type (attribute_obj , & bleio_descriptor_type )) {
13811381        bleio_descriptor_obj_t  * descriptor  =  MP_OBJ_TO_PTR (attribute_obj );
13821382        // Only CCCD's are writable. 
13831383        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_
14271427
14281428    mp_obj_t  * attribute  =  bleio_adapter_get_attribute (& common_hal_bleio_adapter_obj , handle );
14291429
1430-     if  (!MP_OBJ_IS_TYPE (attribute , & bleio_characteristic_type )) {
1430+     if  (!mp_obj_is_type (attribute , & bleio_characteristic_type )) {
14311431        send_error (conn_handle , BT_ATT_OP_PREPARE_WRITE_REQ , handle , BT_ATT_ERR_ATTRIBUTE_NOT_LONG );
14321432        return ;
14331433    }
0 commit comments