Skip to content

BluetoothSerial: register_callback compile error #9244

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

Closed
1 task done
ericlangel opened this issue Feb 13, 2024 · 2 comments · Fixed by #9245
Closed
1 task done

BluetoothSerial: register_callback compile error #9244

ericlangel opened this issue Feb 13, 2024 · 2 comments · Fixed by #9245
Assignees
Labels
Milestone

Comments

@ericlangel
Copy link

ericlangel commented Feb 13, 2024

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.
@SuGlider
Copy link
Collaborator

@ericlangel Thanks for reporting! PR #9245 shall solve it.

@ericlangel
Copy link
Author

yes, it worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging a pull request may close this issue.

2 participants