ESP 32 gatt client连接ble设备注册NOTIFY无效的问题
Posted: Mon Feb 05, 2024 1:31 pm
ESP32,IDF版本5.1.2。连接某一ble设备,版本据说是5.0,没法验证,通过手机BLE调试APP操作反应正常,其通知和写特征值是分开的,注册NOTIFY服务后,写入成功后,设备会自动应答,但NOTIFY动作无反应。
若单独注册NOTIFY服务,则报错:
代码基于gatt_client例程,与类似设备(ble 4.0版本,服务和特征UUID完全相同)连接正常运行,见附件。请问是什么原因?
Code: Select all
I (7578) GATTC_DEMO: ESP_GATTC_CONNECT_EVT conn_id 0, if 3
I (7578) GATTC_DEMO: REMOTE BDA:
I (7578) GATTC_DEMO: 25 79 62 57 60 74[attachment=0]gattc_demo.c[/attachment]
I (7578) GATTC_DEMO: open success
I (8208) GATTC_DEMO: discover service complete conn_id 0
I (8208) GATTC_DEMO: SEARCH RES: conn_id = 0 is primary service 1
I (8208) GATTC_DEMO: start handle 20 end handle 25 current handle value 20
I (8218) GATTC_DEMO: service found
I (8218) GATTC_DEMO: UUID16: fff0
I (8228) GATTC_DEMO: Get service information from remote device
I (8238) GATTC_DEMO: ESP_GATTC_SEARCH_CMPL_EVT
I (8238) GATTC_DEMO: ESP_GATTC_CFG_MTU_EVT, Status 0, MTU 248, conn_id 0
I (8248) GATTC_DEMO: ESP_GATTC_REG_FOR_NOTIFY_EVT
E (8248) GATTC_DEMO: decsr not found
I (8298) GATTC_DEMO: write char success
Code: Select all
I (5918) GATTC_DEMO: connect to the remote device.
I (5938) GATTC_DEMO: stop scan successfully
I (6998) GATTC_DEMO: ESP_GATTC_CONNECT_EVT conn_id 0, if 3
I (6998) GATTC_DEMO: REMOTE BDA:
I (6998) GATTC_DEMO: 25 79 62 57 60 74
I (7008) GATTC_DEMO: open success
I (7628) GATTC_DEMO: discover service complete conn_id 0
I (7638) GATTC_DEMO: SEARCH RES: conn_id = 0 is primary service 1
I (7638) GATTC_DEMO: start handle 20 end handle 25 current handle value 20
I (7638) GATTC_DEMO: service found
I (7648) GATTC_DEMO: UUID16: fff0
I (7648) GATTC_DEMO: Get service information from remote device
I (7658) GATTC_DEMO: ESP_GATTC_SEARCH_CMPL_EVT
I (7668) GATTC_DEMO: ESP_GATTC_CFG_MTU_EVT, Status 0, MTU 248, conn_id 0
I (7668) GATTC_DEMO: ESP_GATTC_REG_FOR_NOTIFY_EVT
E (7708) BT_L2CAP: slave connection parameters update failed, the parameters are out of range
I (7708) GATTC_DEMO: write descr success