Search found 38 matches

by ESP_zhanghaipeng
Sun Oct 08, 2023 11:29 am
Forum: ESP-IDF
Topic: BLE 4 Coded
Replies: 4
Views: 1692

Re: BLE 4 Coded

How do you use the `esp_ble_gap_set_preferred_phy` API? ``` //when connected esp_bd_addr_t remote_device_address = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC};//peer bluetooth addr esp_ble_gap_all_phys_t all_phys = 0; esp_ble_gap_phy_mask_t tx_phy = ESP_BLE_GAP_PHY_2M_PREF_MASK; // 2Mbps data rate esp_ble_...
by ESP_zhanghaipeng
Mon Sep 11, 2023 8:34 am
Forum: ESP IoT Solution 中文讨论版
Topic: gatt_server_service_table()历程触发方式,使用freeRTOS的方式
Replies: 1
Views: 15669

Re: gatt_server_service_table()历程触发方式,使用freeRTOS的方式

你好,

1.gatts_profile_event_handler()回调函数是在中断中运行的还是在任务正运行的

2.通过蓝牙收到的数据需要等到 通过usb-cdc将成功数据回传到设备后,在通过蓝牙回传微信小程序接收成功,蓝牙回调在中断里面运行,esp_ble_gatts_send_response(),可以单独创建一个FressRTOS任务里面回传。
by ESP_zhanghaipeng
Wed Aug 23, 2023 11:27 am
Forum: ESP-IDF 中文讨论版
Topic: 紧急求助,使用gatt读写时,client端write某个char的时候报错。
Replies: 3
Views: 1533

Re: 紧急求助,使用gatt读写时,client端write某个char的时候报错。

ESP_GATT_INSUF_AUTHENTICATION 错误码的意思是在进行 GATT 操作时,由于缺乏足够的身份验证,操作被拒绝或不能成功完成。一般是由于没有加密成功造成。请确保已经加密成功。
你可以提供一下完整的 log 和 database 的代码吗?
by ESP_zhanghaipeng
Wed Aug 23, 2023 10:05 am
Forum: ESP-IDF 中文讨论版
Topic: esp32 gatt_server 在一个gatt服务下创建多个特征
Replies: 5
Views: 1667

Re: esp32 gatt_server 在一个gatt服务下创建多个特征

方式一:
注释掉非必要的代码
方式二:
使用 idf.py menuconfig 命令,
找到 (Top) → Example 'GATT SERVER' Config,打开 [*] Use raw data for advertising packets and scan response data


推荐第二种方法,如下图
by ESP_zhanghaipeng
Wed Aug 23, 2023 7:54 am
Forum: ESP-IDF 中文讨论版
Topic: esp32 gatt_server 在一个gatt服务下创建多个特征
Replies: 5
Views: 1667

Re: esp32 gatt_server 在一个gatt服务下创建多个特征

bluedroid 支持两种建 service 的方式,你可以参考下面两个 example,每一个 example 对应着一种创建 service 的方式: https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/bluedroid/ble/gatt_server https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/bluedroid/ble/gatt_server_service_table 特征是建立在 service 里面,他...