Skip to content

Fixes Pointer and Call using Serial BT callback #9245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libraries/BluetoothSerial/src/BluetoothSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions libraries/BluetoothSerial/src/BluetoothSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "BTScan.h"
#include "BTAdvertisedDevice.h"


typedef std::function<void(const uint8_t *buffer, size_t size)> BluetoothSerialDataCb;
typedef std::function<void(uint32_t num_val)> ConfirmRequestCb;
typedef std::function<void()> KeyRequestCb;
Expand Down Expand Up @@ -57,7 +56,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);
Expand Down