Skip to content

BluetoothSerial: register_callback compile error #9244

Closed
@ericlangel

Description

@ericlangel

Board

ESP32 Dev Module

Device Description

DevKitC

Hardware Configuration

no

Version

latest development Release Candidate (RC-X)

IDE Name

Arduino IDE 1.8.19

Operating System

Windows

Flash frequency

PSRAM enabled

no

Upload speed

Description

same Problem as #7675 but with actual 3.0.0 alpha

Sketch

#include "BluetoothSerial.h"
 
BluetoothSerial SerialBT;
 
void callback(esp_spp_cb_event_t event, esp_spp_cb_param_t *param){
  if(event == ESP_SPP_SRV_OPEN_EVT){
    Serial.println("Client Connected");
  }
 
  if(event == ESP_SPP_CLOSE_EVT ){
    Serial.println("Client disconnected");
  }
}
 
void setup() {
  Serial.begin(115200);
 
  SerialBT.register_callback(callback);
 
  if(!SerialBT.begin("ESP32")){
    Serial.println("An error occurred initializing Bluetooth");
  }else{
    Serial.println("Bluetooth initialized");
  }
}
 
void loop() {}

Debug Message

C:\Users\Win10 Home x64\Desktop\Tuberlog\Firmware\ESP32\ESP32_Tuberlog6\ESP32_Tuberlog6.ino: In function 'void setup()':
ESP32_Tuberlog6:58:30: error: cannot convert 'void(esp_spp_cb_event_t, esp_spp_cb_param_t*)' to 'void (**)(esp_spp_cb_event_t, esp_spp_cb_param_t*)'
   58 |   SerialBT.register_callback(callback);
      |                              ^~~~~~~~
      |                              |
      |                              void(esp_spp_cb_event_t, esp_spp_cb_param_t*)
In file included from C:\Users\Win10 Home x64\Desktop\Tuberlog\Firmware\ESP32\ESP32_Tuberlog6\ESP32_Tuberlog6.ino:4:
C:\Users\Win10 Home x64\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha3\libraries\BluetoothSerial\src/BluetoothSerial.h:60:52: note:   initializing argument 1 of 'esp_err_t BluetoothSerial::register_callback(void (**)(esp_spp_cb_event_t, esp_spp_cb_param_t*))'
   60 |         esp_err_t register_callback(esp_spp_cb_t * callback);
      |                                     ~~~~~~~~~~~~~~~^~~~~~~~
Bibliothek BluetoothSerial in Version 2.0.0 im Ordner: C:\Users\Win10 Home x64\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0-alpha3\libraries\BluetoothSerial  wird verwendet
exit status 1
cannot convert 'void(esp_spp_cb_event_t, esp_spp_cb_param_t*)' to 'void (**)(esp_spp_cb_event_t, esp_spp_cb_param_t*)'

Other Steps to Reproduce

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions