Unverified Commit 0a2a4872 authored by Rodrigo Garcia's avatar Rodrigo Garcia Committed by GitHub

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
parent 3de1d5b5
...@@ -55,7 +55,7 @@ static TaskHandle_t _spp_task_handle = NULL; ...@@ -55,7 +55,7 @@ static TaskHandle_t _spp_task_handle = NULL;
static EventGroupHandle_t _spp_event_group = NULL; static EventGroupHandle_t _spp_event_group = NULL;
static EventGroupHandle_t _bt_event_group = NULL; static EventGroupHandle_t _bt_event_group = NULL;
static boolean secondConnectionAttempt; 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 BluetoothSerialDataCb custom_data_callback = NULL;
static esp_bd_addr_t current_bd_addr; static esp_bd_addr_t current_bd_addr;
static ConfirmRequestCb confirm_request_callback = NULL; static ConfirmRequestCb confirm_request_callback = NULL;
...@@ -945,7 +945,7 @@ void BluetoothSerial::confirmReply(boolean confirm) ...@@ -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; custom_spp_callback = callback;
return ESP_OK; return ESP_OK;
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "BTScan.h" #include "BTScan.h"
#include "BTAdvertisedDevice.h" #include "BTAdvertisedDevice.h"
typedef std::function<void(const uint8_t *buffer, size_t size)> BluetoothSerialDataCb; 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(uint32_t num_val)> ConfirmRequestCb;
typedef std::function<void()> KeyRequestCb; typedef std::function<void()> KeyRequestCb;
...@@ -57,7 +56,7 @@ class BluetoothSerial: public Stream ...@@ -57,7 +56,7 @@ class BluetoothSerial: public Stream
void memrelease(); void memrelease();
void setTimeout(int timeoutMS); void setTimeout(int timeoutMS);
void onData(BluetoothSerialDataCb cb); 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 #ifdef CONFIG_BT_SSP_ENABLED
void onConfirmRequest(ConfirmRequestCb cb); void onConfirmRequest(ConfirmRequestCb cb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment