From c36dbf0fd35085b55acd2c33a240941bef676aab Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Mon, 9 Jan 2023 11:44:21 +0200 Subject: [PATCH] Fix BluetoothSerial compilation caused by upstream change Fixes: https://github.com/espressif/arduino-esp32/issues/7675 The signature of `esp_spp_cb_t` has changed in recent ESP-IDF v4.4.3, so this fix targets to accomodate that change in Arduino --- libraries/BluetoothSerial/src/BluetoothSerial.cpp | 4 ++-- libraries/BluetoothSerial/src/BluetoothSerial.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/BluetoothSerial/src/BluetoothSerial.cpp b/libraries/BluetoothSerial/src/BluetoothSerial.cpp index e430fe7255e..800ef97e68c 100644 --- a/libraries/BluetoothSerial/src/BluetoothSerial.cpp +++ b/libraries/BluetoothSerial/src/BluetoothSerial.cpp @@ -54,7 +54,7 @@ static TaskHandle_t _spp_task_handle = NULL; static EventGroupHandle_t _spp_event_group = NULL; static EventGroupHandle_t _bt_event_group = NULL; static boolean secondConnectionAttempt; -static esp_spp_cb_t * custom_spp_callback = NULL; +static esp_spp_cb_t custom_spp_callback = NULL; static BluetoothSerialDataCb custom_data_callback = NULL; static esp_bd_addr_t current_bd_addr; static ConfirmRequestCb confirm_request_callback = NULL; @@ -886,7 +886,7 @@ void BluetoothSerial::confirmReply(boolean confirm) } -esp_err_t BluetoothSerial::register_callback(esp_spp_cb_t * callback) +esp_err_t BluetoothSerial::register_callback(esp_spp_cb_t callback) { custom_spp_callback = callback; return ESP_OK; diff --git a/libraries/BluetoothSerial/src/BluetoothSerial.h b/libraries/BluetoothSerial/src/BluetoothSerial.h index 0c087b06360..4b225239333 100644 --- a/libraries/BluetoothSerial/src/BluetoothSerial.h +++ b/libraries/BluetoothSerial/src/BluetoothSerial.h @@ -53,7 +53,7 @@ class BluetoothSerial: public Stream void end(void); void setTimeout(int timeoutMS); void onData(BluetoothSerialDataCb cb); - esp_err_t register_callback(esp_spp_cb_t * callback); + esp_err_t register_callback(esp_spp_cb_t callback); void onConfirmRequest(ConfirmRequestCb cb); void onAuthComplete(AuthCompleteCb cb);