Skip to content

Commit 2a760b7

Browse files
committed
Fix BLE crash issue when do long time test
1. Reinitial the BLE MAC address to avoid BLE start timer
1 parent 64f1181 commit 2a760b7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

system/libarc32_arduino101/framework/src/services/ble/gap.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ void on_nble_gap_adv_report_evt(const struct nble_gap_adv_report_evt *evt,
465465
check_pending_conn(&evt->addr, &evt->addr, evt->adv_type);
466466
#endif /* CONFIG_BLUETOOTH_CENTRAL */
467467
}
468-
468+
#if 0
469469
static int set_random_address(const bt_addr_t *addr)
470470
{
471471
struct nble_set_bda_req req = {0};
@@ -486,6 +486,7 @@ static int le_set_nrpa(void)
486486

487487
return set_random_address(&nrpa);
488488
}
489+
#endif
489490

490491
#if defined(CONFIG_BLUETOOTH_PRIVACY)
491492
int le_set_rpa(void)
@@ -504,6 +505,7 @@ static int start_le_scan(uint8_t scan_type, uint16_t interval, uint16_t window,
504505
uint8_t filter_dup)
505506
{
506507
struct nble_gap_start_scan_req params;
508+
#if 0
507509
int err;
508510

509511
#if defined(CONFIG_BLUETOOTH_PRIVACY)
@@ -522,7 +524,7 @@ static int start_le_scan(uint8_t scan_type, uint16_t interval, uint16_t window,
522524
}
523525
}
524526
#endif
525-
527+
#endif
526528
params.scan_params.interval = interval;
527529
params.scan_params.window = window;
528530
params.scan_params.scan_type = scan_type;
@@ -594,13 +596,15 @@ static void nble_get_bda_cb_init(const bt_addr_le_t *bda, void *user_data)
594596

595597
static int common_init(void)
596598
{
599+
#if 0
597600
struct nble_get_bda_req req;
598601

599602
req.cb = nble_get_bda_cb_init;
600603
req.user_data =NULL;
601604

602605
/* read nble identity address */
603606
nble_get_bda_req(&req);
607+
#endif
604608
return 0;
605609
}
606610

@@ -1179,6 +1183,7 @@ void bt_le_set_mac_address(bt_addr_le_t bda)
11791183
params.bda = bda;
11801184

11811185
nble_set_bda_req(&params);
1186+
nble_get_bda_cb_init(&bda, NULL);
11821187
}
11831188

11841189
void on_nble_common_rsp(const struct nble_common_rsp *rsp)
-1.93 KB
Binary file not shown.

0 commit comments

Comments
 (0)