From 23c702cdc1f7da6a60a45607e12ca1278c205cb7 Mon Sep 17 00:00:00 2001 From: Roshan Bangar Date: Thu, 14 Mar 2024 16:25:16 +0530 Subject: [PATCH] fix(nimble): Fix compilation issues and Minor enhancements to esp_hid --- components/bt/host/nimble/nimble | 2 +- examples/bluetooth/esp_hid_device/main/esp_hid_gap.c | 12 +++++++++--- examples/bluetooth/esp_hid_host/main/esp_hid_gap.c | 2 ++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index c0dd77a8355d..28844aaa7fa5 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit c0dd77a8355dd82d0bc1b501e6d118a91eb14df1 +Subproject commit 28844aaa7fa5dd2587ea4fb297e0a71af8c5465c diff --git a/examples/bluetooth/esp_hid_device/main/esp_hid_gap.c b/examples/bluetooth/esp_hid_device/main/esp_hid_gap.c index 74542ae6f3c2..6cba455f5753 100644 --- a/examples/bluetooth/esp_hid_device/main/esp_hid_gap.c +++ b/examples/bluetooth/esp_hid_device/main/esp_hid_gap.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Unlicense OR CC0-1.0 */ @@ -13,7 +13,6 @@ #include "freertos/task.h" #include "freertos/semphr.h" -#include "esp_bt_device.h" #include "esp_hid_gap.h" #if CONFIG_BT_NIMBLE_ENABLED @@ -23,6 +22,8 @@ #include "host/ble_hs_adv.h" #include "nimble/ble.h" #include "host/ble_sm.h" +#else +#include "esp_bt_device.h" #endif static const char *TAG = "ESP_HID_GAP"; @@ -726,9 +727,13 @@ esp_err_t esp_hid_ble_gap_adv_start(void) return esp_ble_gap_start_advertising(&hidd_adv_params); } #endif /* CONFIG_BT_BLE_ENABLED */ + #if CONFIG_BT_NIMBLE_ENABLED -static struct ble_hs_adv_fields fields; #define GATT_SVR_SVC_HID_UUID 0x1812 + +extern void ble_hid_task_start_up(void); +static struct ble_hs_adv_fields fields; + esp_err_t esp_hid_ble_gap_adv_init(uint16_t appearance, const char *device_name) { ble_uuid16_t *uuid16, *uuid16_1; @@ -835,6 +840,7 @@ nimble_hid_gap_event(struct ble_gap_event *event, void *arg) event->enc_change.status); rc = ble_gap_conn_find(event->enc_change.conn_handle, &desc); assert(rc == 0); + ble_hid_task_start_up(); return 0; case BLE_GAP_EVENT_NOTIFY_TX: diff --git a/examples/bluetooth/esp_hid_host/main/esp_hid_gap.c b/examples/bluetooth/esp_hid_host/main/esp_hid_gap.c index dd9b6e53f6d9..4b0eb7c3eb6d 100644 --- a/examples/bluetooth/esp_hid_host/main/esp_hid_gap.c +++ b/examples/bluetooth/esp_hid_host/main/esp_hid_gap.c @@ -26,6 +26,8 @@ #include "nimble/ble.h" #include "host/ble_sm.h" #define BLE_HID_SVC_UUID 0x1812 /* HID Service*/ +#else +#include "esp_bt_device.h" #endif static const char *TAG = "ESP_HID_GAP";