I just updated from Arduino IDE 1x to 2.3.3 and wading through the various compilation errors. I don't have a theory about this one though, anyone have any idea?
Snippet:
class ButtonsCallbacks : public BLECharacteristicCallbacks
{
void onWrite(BLECharacteristic *pCharacteristic)
{
std::string rxValue = pCharacteristic->getValue();
if (rxValue.length() > 0)
{
Gives the error:
Compilation error: conversion from 'String' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
That's referring to the line that starts with " std::string". Any theory by chance?
I think that there are conversions going on behind the scenes and probably takes more instructions than the the return of the String to wind up in the same place.
With an esp32, there is no real need to eliminate Strings or std::string from your code and use c-strings like on the smaller memory arduinos.
In my opinion, I would use what the library has been coded to do, and not find a work around which gets to the same place.
I agree generally and use String when needed, but the issue here is that the rest of my code expects rxValue to be a string (small s), so changing it's variable type to the radically different String type causes other issues that I'd rather avoid.
the issue here is that the rest of my code expects rxValue to be a string (small s)
If that was the case, then why were you typing the rxValue as std::string which is a String object, and not a string(small s) which is the typical nomenclature for a c-string or null terminated character array.
It's your code, and I don't think there is any issue with what you are doing.
I don't think the error is related to 1.8.19 or 2.3.3, but rather a change in the esp32 BLE library.
@sterretje thanks for your concern and suggestions but i am actually new to this forum so i didnt knew if there was any message functionality in the forum else i would have used that but thank you now i will search how can i access it and get in touch with @wrybread
thank you .i deleted my thread containing my mail id .I couldnt get the message or inbox thing but that i will learn later .i have mailed my query to wrybread .but thanks to you for making me learn this thing.
Ah, you're too new and your trust level is "new user". You'll have to hang around a little longer, read some topics etc (not sure what exactly). Once you get promoted to "basic user", you can send PMs.
@sterretje can you help me with the problem i am encountering ...
i want to send data or write from phone's nfc and want to read it using pn532 .all this using SPI on the esp32.