discovery needs to be stopped before connecting is possible
This commit is contained in:
parent
0720a31280
commit
f2a128bf53
1 changed files with 5 additions and 2 deletions
|
@ -341,8 +341,11 @@ static int ble_gap_event(struct ble_gap_event *event, void *arg) {
|
|||
|
||||
if(strstr(name, "BARBACK") != NULL) {
|
||||
ESP_LOGI(TAG, "Let's Party!");
|
||||
uint8_t addr_type = *(uint8_t*)arg;
|
||||
(ble_gap_connect(addr_type, &(event->disc).addr, 30000, NULL, ble_gap_event, NULL));
|
||||
uint8_t addr_type;
|
||||
ble_gap_disc_cancel();
|
||||
|
||||
ESP_ERROR_CHECK(ble_hs_id_infer_auto(0, &addr_type));
|
||||
ESP_ERROR_CHECK(ble_gap_connect(addr_type, &event->disc.addr, 30000, NULL, ble_gap_event, NULL));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue