Hello,
I’m familiar with using stringstreams to format my serial or tcp communications.
But since mbed-os-6 I have a problem with inserting numbers parameters to the stream.
Example with mbed-os-5.15.3 work fine
#include "mbed.h"
#include <sstream>
Serial pc(USBTX, USBRX, 115200);
int main(void)
{
stringstream sstream;
sstream << "\nMbed OS " << MBED_VERSION;
pc.printf("%s", sstream.str().c_str());
}
Answer: Mbed OS 51503
Example with mbed-os-6.0.0 don’t work
#include "mbed.h"
#include <sstream>
UnbufferedSerial pc(USBTX, USBRX, 115200);
int main(void)
{
stringstream sstream;
sstream << "\nMbed OS " << MBED_VERSION;
pc.write(sstream.str().c_str(), sstream.str().size());
}
Answer: Mbed OS
I tried it with online compiler and mbed studio is the same thing.
Does anyone have any ideas on how to solve this problem?
Thank you,
YSI