Skip to content

Commit f04b7d9

Browse files
authored
BluetoothSerial: Fix SPP service mode (#8806)
1 parent 78ac143 commit f04b7d9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

+2-4
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,8 @@ static void esp_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
257257
#else
258258
esp_bt_gap_set_scan_mode(ESP_BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE);
259259
#endif
260-
if (!_isMaster) {
261-
log_i("ESP_SPP_INIT_EVT: slave: start");
262-
esp_spp_start_srv(ESP_SPP_SEC_NONE, ESP_SPP_ROLE_SLAVE, 0, _spp_server_name);
263-
}
260+
log_i("ESP_SPP_INIT_EVT: %s: start", _isMaster ? "master" : "slave");
261+
esp_spp_start_srv(ESP_SPP_SEC_NONE, _isMaster ? ESP_SPP_ROLE_MASTER : ESP_SPP_ROLE_SLAVE, 0, _spp_server_name);
264262
xEventGroupSetBits(_spp_event_group, SPP_RUNNING);
265263
break;
266264

0 commit comments

Comments
 (0)