Calling ad2dp_sink.start with identifier taken from a String #722
-
Hi, I have a basic implementation working but I would like to be able to take the name for the Bluetooth device from the chipID for the ESP32 controller so that the device can have a unique name, as I'm intending to have multiple setups and want to use something unique to the device. I can find the chipID easily using some code lifted from the ESP32 examples in the Arduino IDE:
What I can't then get to work is to be able to run a2dp_sink.start(chipId). This fails to compile, I initially thought this was because it is an integer. I have then tried using the following to convert the chipID to a string, before starting the A2DP sink but this also fails to compile with "no matching function for call to 'BluetoothA2DPSink::start(String&)'":
I have also tried concatenating other things together but it appears you can't set a string to be used as the A2DP sink name. Apologies if I have missed something here. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
you would use the c_str() method of String! |
Beta Was this translation helpful? Give feedback.
-
Thanks. Was able to get this to work with a string of text added in front of the chip ID:
|
Beta Was this translation helpful? Give feedback.
you would use the c_str() method of String!