ESP32使用GATTC连接蓝牙设备写入特征值显示错误 write char failed, error status = 85

wanyubin
Posts: 3
Joined: Sat Oct 29, 2022 8:13 am

ESP32使用GATTC连接蓝牙设备写入特征值显示错误 write char failed, error status = 85

Postby wanyubin » Tue Nov 15, 2022 7:26 am

  1. I (1188) GATTC_MULTIPLE_DEMO: ESP_GATTC_OPEN_EVT conn_id 0, if 3, status 0, mtu 23
  2. I (1188) GATTC_MULTIPLE_DEMO: REMOTE BDA:
  3. I (1198) GATTC_MULTIPLE_DEMO: ce 13 21 00 e8 02
  4. I (1198) GATTC_MULTIPLE_DEMO: update connection params status = 0, min_int = 18, max_int = 18,conn_int = 18,latency = 4, timeout = 300
  5. I (1218) GATTC_MULTIPLE_DEMO: REG_EVT
  6. I (1888) GATTC_MULTIPLE_DEMO: Status 0, MTU 23, conn_id 0
  7. I (1888) GATTC_MULTIPLE_DEMO: SEARCH RES: conn_id = 0 is primary service 1
  8. I (1888) GATTC_MULTIPLE_DEMO: start handle 48 end handle 65535 current handle value 48
  9. I (1898) GATTC_MULTIPLE_DEMO: UUID16: ff00
  10. I (2018) GATTC_MULTIPLE_DEMO: write descr success
  11. E (2088) GATTC_MULTIPLE_DEMO: write char failed, error status = 85
查了一下错误状态码是gatt_error类型 但是不知道出现此错误的原因 希望大佬们指点一下

ESP_XuLZ
Posts: 173
Joined: Fri Mar 26, 2021 6:04 am

Re: ESP32使用GATTC连接蓝牙设备写入特征值显示错误 write char failed, error status = 85

Postby ESP_XuLZ » Tue Nov 15, 2022 9:33 am

可能是 handle 值选择不对, 一般这个 gatt client 示例都是过滤特定的 service 和 characteristic UUID 的, 与 gatt_server 或 gatt_server_service_table 示例 配合使用的
这里你可以用手机 BLE app 分别去连运行 gatt_server_service_table 的 esp 设备 和 你要连接的其他蓝牙设备,比较下 characteristic 和 service 的差别
然后再看看进一步修改 gatt client 示例
有条件抓包的就抓包看下,更直观些

Who is online

Users browsing this forum: Majestic-12 [Bot], virgil and 76 guests