Skip to content

Commit 798a559

Browse files
committed
fix(nimble): Add a way to make blufi advertising customizable
Based on changes in #8958
1 parent e5f1552 commit 798a559

File tree

1 file changed

+4
-4
lines changed
  • components/bt/common/btc/profile/esp/blufi/nimble_host

1 file changed

+4
-4
lines changed

components/bt/common/btc/profile/esp/blufi/nimble_host/esp_blufi.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ int esp_blufi_gatt_svr_deinit(void)
298298
return 0;
299299
}
300300

301-
static int
301+
int
302302
esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
303303
{
304304
struct ble_gap_conn_desc desc;
@@ -331,7 +331,7 @@ esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
331331
}
332332
if (event->connect.status != 0) {
333333
/* Connection failed; resume advertising. */
334-
esp_blufi_adv_start();
334+
((void(*)(void))arg)();
335335
}
336336
return 0;
337337
case BLE_GAP_EVENT_DISCONNECT:
@@ -366,7 +366,7 @@ esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
366366
case BLE_GAP_EVENT_ADV_COMPLETE:
367367
ESP_LOGI(TAG, "advertise complete; reason=%d",
368368
event->adv_complete.reason);
369-
esp_blufi_adv_start();
369+
((void(*)(void))arg)();
370370
return 0;
371371

372372
case BLE_GAP_EVENT_SUBSCRIBE:
@@ -461,7 +461,7 @@ void esp_blufi_adv_start(void)
461461
adv_params.conn_mode = BLE_GAP_CONN_MODE_UND;
462462
adv_params.disc_mode = BLE_GAP_DISC_MODE_GEN;
463463
rc = ble_gap_adv_start(own_addr_type, NULL, BLE_HS_FOREVER,
464-
&adv_params, esp_blufi_gap_event, NULL);
464+
&adv_params, esp_blufi_gap_event, esp_blufi_adv_start);
465465
if (rc != 0) {
466466
ESP_LOGE(TAG, "error enabling advertisement; rc=%d", rc);
467467
return;

0 commit comments

Comments
 (0)