Skip to content

Commit 0a2a487

Browse files
authored
Fixes Pointer and Call using Serial BT callback (#9245)
* SerialBT (fix): fixes the callback function pointer * SerialBT(fix): fixes callback pointer reference and call * Update BluetoothSerial.h
1 parent 3de1d5b commit 0a2a487

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

libraries/BluetoothSerial/src/BluetoothSerial.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static TaskHandle_t _spp_task_handle = NULL;
5555
static EventGroupHandle_t _spp_event_group = NULL;
5656
static EventGroupHandle_t _bt_event_group = NULL;
5757
static boolean secondConnectionAttempt;
58-
static esp_spp_cb_t * custom_spp_callback = NULL;
58+
static esp_spp_cb_t custom_spp_callback = NULL;
5959
static BluetoothSerialDataCb custom_data_callback = NULL;
6060
static esp_bd_addr_t current_bd_addr;
6161
static ConfirmRequestCb confirm_request_callback = NULL;
@@ -945,7 +945,7 @@ void BluetoothSerial::confirmReply(boolean confirm)
945945
}
946946

947947

948-
esp_err_t BluetoothSerial::register_callback(esp_spp_cb_t * callback)
948+
esp_err_t BluetoothSerial::register_callback(esp_spp_cb_t callback)
949949
{
950950
custom_spp_callback = callback;
951951
return ESP_OK;

libraries/BluetoothSerial/src/BluetoothSerial.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "BTScan.h"
2929
#include "BTAdvertisedDevice.h"
3030

31-
3231
typedef std::function<void(const uint8_t *buffer, size_t size)> BluetoothSerialDataCb;
3332
typedef std::function<void(uint32_t num_val)> ConfirmRequestCb;
3433
typedef std::function<void()> KeyRequestCb;
@@ -57,7 +56,7 @@ class BluetoothSerial: public Stream
5756
void memrelease();
5857
void setTimeout(int timeoutMS);
5958
void onData(BluetoothSerialDataCb cb);
60-
esp_err_t register_callback(esp_spp_cb_t * callback);
59+
esp_err_t register_callback(esp_spp_cb_t callback);
6160

6261
#ifdef CONFIG_BT_SSP_ENABLED
6362
void onConfirmRequest(ConfirmRequestCb cb);

0 commit comments

Comments
 (0)