Skip to content

Commit 25facff

Browse files
author
Victor Tchistiak
committed
20190916 - misc
1 parent 0531490 commit 25facff

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

libraries/BluetoothSerial/src/BluetoothSerial.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,13 @@ static bool get_name_from_eir(uint8_t *eir, char *bdname, uint8_t *bdname_len)
9292
uint8_t *rmt_bdname = NULL;
9393
uint8_t rmt_bdname_len = 0;
9494

95-
if (bdname) {
96-
*bdname_len = 0;
97-
*bdname = 0;
98-
}
99-
10095
if (!eir || !bdname || !bdname_len) {
10196
return false;
10297
}
10398

99+
*bdname_len = 0;
100+
*bdname = 0;
101+
104102
rmt_bdname = esp_bt_gap_resolve_eir_data(eir, ESP_BT_EIR_TYPE_CMPL_LOCAL_NAME, &rmt_bdname_len);
105103
if (!rmt_bdname) {
106104
rmt_bdname = esp_bt_gap_resolve_eir_data(eir, ESP_BT_EIR_TYPE_SHORT_LOCAL_NAME, &rmt_bdname_len);

0 commit comments

Comments
 (0)