Skip to content

Commit f7f5f69

Browse files
committed
remove old refactored code
1 parent d99740f commit f7f5f69

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

Diff for: cores/esp32/esp32-hal-bt.h

-2
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ typedef enum {
3131
BT_MODE_BTDM
3232
} bt_mode;
3333

34-
bool btStarted();
3534
bool btStart();
36-
bool btStartMode(bt_mode mode);
3735
bool btStop();
3836

3937
#ifdef __cplusplus

Diff for: libraries/BluetoothSerial/src/BluetoothSerial.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ static bool _init_bt(const char *deviceName, bt_mode mode) {
660660
}
661661
}
662662

663-
if (!btStarted() && !btStartMode(mode)) {
663+
if (!btStart()) {
664664
log_e("initialize controller failed");
665665
return false;
666666
}
@@ -729,7 +729,7 @@ static bool _init_bt(const char *deviceName, bt_mode mode) {
729729
}
730730

731731
static bool _stop_bt() {
732-
if (btStarted()) {
732+
if (btStart()) {
733733
if (_spp_client) {
734734
esp_spp_disconnect(_spp_client);
735735
}
@@ -1115,7 +1115,7 @@ bool BluetoothSerial::isReady(bool checkMaster, int timeout) {
11151115
log_e("Master mode is not active. Call begin(localName, true) to enable Master mode");
11161116
return false;
11171117
}
1118-
if (!btStarted()) {
1118+
if (!btStart()) {
11191119
log_e("BT is not initialized. Call begin() first");
11201120
return false;
11211121
}

Diff for: libraries/SimpleBLE/src/SimpleBLE.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static void _on_gap(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param)
6060
}
6161

6262
static bool _init_gap(const char *name) {
63-
if (!btStarted() && !btStart()) {
63+
if (!btStart()) {
6464
log_e("btStart failed");
6565
return false;
6666
}
@@ -93,7 +93,7 @@ static bool _init_gap(const char *name) {
9393
}
9494

9595
static bool _stop_gap() {
96-
if (btStarted()) {
96+
if (btStart()) {
9797
esp_bluedroid_disable();
9898
esp_bluedroid_deinit();
9999
btStop();

0 commit comments

Comments
 (0)