Skip to content

Commit

Permalink
Merge branch 'bugfix/fixed_task_invokation_after_pairing_v5.2' into '…
Browse files Browse the repository at this point in the history
…release/v5.2'

fix(nimble): Fixed the call to ble_hid_task_startup after pairing (v5.2)

See merge request espressif/esp-idf!29695
  • Loading branch information
rahult-github committed Mar 20, 2024
2 parents ec7e307 + 24e0a12 commit 962d9de
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/bt/host/nimble/nimble
11 changes: 9 additions & 2 deletions examples/bluetooth/esp_hid_device/main/esp_hid_gap.c
Original file line number Diff line number Diff line change
@@ -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
*/
Expand All @@ -22,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";
Expand Down Expand Up @@ -725,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;
Expand Down Expand Up @@ -834,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:
Expand Down
2 changes: 2 additions & 0 deletions examples/bluetooth/esp_hid_host/main/esp_hid_gap.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,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";
Expand Down

0 comments on commit 962d9de

Please sign in to comment.