ESP32C3模块与手机蓝牙兼容性问题
ESP32C3模块与手机蓝牙兼容性问题
使用ESP32C3模块与三星S9手机连接.在模块发送蓝牙数据时关闭手机上的系统蓝牙,模块依然保持蓝牙连接状态."ESP_GATTS_DISCONNECT_EVT"事件没有触发.直至模块进入睡眠模式或关闭手机电源才恢复正常.idf版本为5.0.1.求大神解答.
-
- Posts: 42
- Joined: Thu May 04, 2023 3:49 am
Re: ESP32C3模块与手机蓝牙兼容性问题
你好,我这面没有三星 S9 手机,我是用 OnePlus 5T 手机和 example(位置esp-idf/examples/bluetooth/bluedroid/ble/gatt_server)作了测试,分别连接了两次并断开,下面是测试的结果:
```
I (529) GATTS_DEMO: ADD_DESCR_EVT, status 0, attr_handle 47, service_handle 44
I (153339) GATTS_DEMO: ESP_GATTS_CONNECT_EVT, conn_id 0, remote 5f:ef:df:f0:02:5a:
I (153339) GATTS_DEMO: CONNECT_EVT, conn_id 0, remote 5f:ef:df:f0:02:5a:
I (153879) GATTS_DEMO: update connection params status = 0, min_int = 16, max_int = 32,conn_int = 6,latency = 0, timeout = 500
I (154249) GATTS_DEMO: update connection params status = 0, min_int = 0, max_int = 0,conn_int = 32,latency = 0, timeout = 400
W (159369) BT_HCI: hcif disc complete: hdl 0x1, rsn 0x13
I (159369) GATTS_DEMO: ESP_GATTS_DISCONNECT_EVT, disconnect reason 0x13
I (164189) GATTS_DEMO: ESP_GATTS_CONNECT_EVT, conn_id 0, remote 5f:ef:df:f0:02:5a:
I (164189) GATTS_DEMO: CONNECT_EVT, conn_id 0, remote 5f:ef:df:f0:02:5a:
I (164879) GATTS_DEMO: update connection params status = 0, min_int = 16, max_int = 32,conn_int = 32,latency = 0, timeout = 400
I (165359) GATTS_DEMO: update connection params status = 0, min_int = 0, max_int = 0,conn_int = 6,latency = 0, timeout = 500
I (165639) GATTS_DEMO: update connection params status = 0, min_int = 0, max_int = 0,conn_int = 32,latency = 0, timeout = 400
W (168079) BT_HCI: hcif disc complete: hdl 0x1, rsn 0x13
I (168079) GATTS_DEMO: ESP_GATTS_DISCONNECT_EVT, disconnect reason 0x13
```
可以看出,两次断开 ESP_GATTS_CONNECT_EVT 事件都上来了。
你那面可以提供一下 ESP32C3 的一些 LOG 来帮助分析吗?
```
I (529) GATTS_DEMO: ADD_DESCR_EVT, status 0, attr_handle 47, service_handle 44
I (153339) GATTS_DEMO: ESP_GATTS_CONNECT_EVT, conn_id 0, remote 5f:ef:df:f0:02:5a:
I (153339) GATTS_DEMO: CONNECT_EVT, conn_id 0, remote 5f:ef:df:f0:02:5a:
I (153879) GATTS_DEMO: update connection params status = 0, min_int = 16, max_int = 32,conn_int = 6,latency = 0, timeout = 500
I (154249) GATTS_DEMO: update connection params status = 0, min_int = 0, max_int = 0,conn_int = 32,latency = 0, timeout = 400
W (159369) BT_HCI: hcif disc complete: hdl 0x1, rsn 0x13
I (159369) GATTS_DEMO: ESP_GATTS_DISCONNECT_EVT, disconnect reason 0x13
I (164189) GATTS_DEMO: ESP_GATTS_CONNECT_EVT, conn_id 0, remote 5f:ef:df:f0:02:5a:
I (164189) GATTS_DEMO: CONNECT_EVT, conn_id 0, remote 5f:ef:df:f0:02:5a:
I (164879) GATTS_DEMO: update connection params status = 0, min_int = 16, max_int = 32,conn_int = 32,latency = 0, timeout = 400
I (165359) GATTS_DEMO: update connection params status = 0, min_int = 0, max_int = 0,conn_int = 6,latency = 0, timeout = 500
I (165639) GATTS_DEMO: update connection params status = 0, min_int = 0, max_int = 0,conn_int = 32,latency = 0, timeout = 400
W (168079) BT_HCI: hcif disc complete: hdl 0x1, rsn 0x13
I (168079) GATTS_DEMO: ESP_GATTS_DISCONNECT_EVT, disconnect reason 0x13
```
可以看出,两次断开 ESP_GATTS_CONNECT_EVT 事件都上来了。
你那面可以提供一下 ESP32C3 的一些 LOG 来帮助分析吗?
Who is online
Users browsing this forum: No registered users and 72 guests