Skip to content

Commit 0531490

Browse files
author
Victor Tchistiak
committed
20190916 - break property for loop during scan when name matches.
1 parent ad72ac3 commit 0531490

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libraries/BluetoothSerial/src/BluetoothSerial.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ static void esp_bt_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *pa
335335
log_i("ESP_BT_GAP_DISC_RES_EVT");
336336
char bda_str[18];
337337
log_i("Scanned device: %s", bda2str(param->disc_res.bda, bda_str, 18));
338-
for (int i = 0; i < param->disc_res.num_prop; i++){
338+
for (int i = 0; i < param->disc_res.num_prop; i++) {
339339
uint8_t peer_bdname_len;
340340
char peer_bdname[ESP_BT_GAP_MAX_BDNAME_LEN + 1];
341341
switch(param->disc_res.prop[i].type) {
@@ -375,6 +375,8 @@ static void esp_bt_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *pa
375375
default:
376376
break;
377377
}
378+
if (_isRemoteAddressSet)
379+
break;
378380
}
379381
break;
380382
case ESP_BT_GAP_DISC_STATE_CHANGED_EVT:

0 commit comments

Comments
 (0)