From c18f2f62473a7aa529acc8bcd945ddfb151f43af Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz Date: Wed, 25 Oct 2023 11:34:32 +0200 Subject: [PATCH] BluetoothSerial: Fix SPP service mode --- libraries/BluetoothSerial/src/BluetoothSerial.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libraries/BluetoothSerial/src/BluetoothSerial.cpp b/libraries/BluetoothSerial/src/BluetoothSerial.cpp index 419809d3f25..dfdbfbecd86 100644 --- a/libraries/BluetoothSerial/src/BluetoothSerial.cpp +++ b/libraries/BluetoothSerial/src/BluetoothSerial.cpp @@ -257,10 +257,8 @@ static void esp_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param) #else esp_bt_gap_set_scan_mode(ESP_BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE); #endif - if (!_isMaster) { - log_i("ESP_SPP_INIT_EVT: slave: start"); - esp_spp_start_srv(ESP_SPP_SEC_NONE, ESP_SPP_ROLE_SLAVE, 0, _spp_server_name); - } + log_i("ESP_SPP_INIT_EVT: %s: start", _isMaster ? "master" : "slave"); + esp_spp_start_srv(ESP_SPP_SEC_NONE, _isMaster ? ESP_SPP_ROLE_MASTER : ESP_SPP_ROLE_SLAVE, 0, _spp_server_name); xEventGroupSetBits(_spp_event_group, SPP_RUNNING); break;