From 6710517055d20a3d6ab3fe72e09512b838df700a Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Tue, 13 Feb 2024 15:57:13 -0300 Subject: [PATCH 1/3] SerialBT (fix): fixes the callback function pointer --- libraries/BluetoothSerial/src/BluetoothSerial.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/BluetoothSerial/src/BluetoothSerial.h b/libraries/BluetoothSerial/src/BluetoothSerial.h index 574b96af089..491057dba00 100644 --- a/libraries/BluetoothSerial/src/BluetoothSerial.h +++ b/libraries/BluetoothSerial/src/BluetoothSerial.h @@ -57,7 +57,7 @@ class BluetoothSerial: public Stream void memrelease(); 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); #ifdef CONFIG_BT_SSP_ENABLED void onConfirmRequest(ConfirmRequestCb cb); From 825a077628229dbda71327e5207f3b72b02a78c7 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Tue, 13 Feb 2024 16:00:50 -0300 Subject: [PATCH 2/3] SerialBT(fix): fixes callback pointer reference and call --- libraries/BluetoothSerial/src/BluetoothSerial.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/BluetoothSerial/src/BluetoothSerial.cpp b/libraries/BluetoothSerial/src/BluetoothSerial.cpp index 8bdf7657ae4..eb6b9043d58 100644 --- a/libraries/BluetoothSerial/src/BluetoothSerial.cpp +++ b/libraries/BluetoothSerial/src/BluetoothSerial.cpp @@ -55,7 +55,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; @@ -945,7 +945,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; From a4f2477a9d0f3bcb1942bfe39c1e0ab3b2b20ec7 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Tue, 13 Feb 2024 16:20:19 -0300 Subject: [PATCH 3/3] Update BluetoothSerial.h --- libraries/BluetoothSerial/src/BluetoothSerial.h | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/BluetoothSerial/src/BluetoothSerial.h b/libraries/BluetoothSerial/src/BluetoothSerial.h index 491057dba00..0041c1eb47e 100644 --- a/libraries/BluetoothSerial/src/BluetoothSerial.h +++ b/libraries/BluetoothSerial/src/BluetoothSerial.h @@ -28,7 +28,6 @@ #include "BTScan.h" #include "BTAdvertisedDevice.h" - typedef std::function BluetoothSerialDataCb; typedef std::function ConfirmRequestCb; typedef std::function KeyRequestCb;