i am trying to find an equivalent function on ESP-IDF that will be like Stream() of arduino , what i am trying to do is to make an MSP function to communicate with the MSP protocol with the ESPs UART, i am using ESP-IDF and Free-Rtos in an Ubuntu environment and cmake to built
https://www.arduino.cc/reference/en/language/functions/communication/stream/ https://github.com/yajo10/MSP-Arduino/blob/master/MSP.cpp
i tryied to use std::ostringstream* but obviously doesnt make the same job
ostringstream
is a specialisedostream
where the "device" is a memory buffer.Stream
is an unspecialised base class for a number of device sub-classes, and it is bi-directional. The standard library equivalent given a suitable stream I/O driver would bestd::istream
andstd::ostream
for input and output respectively, each opened on the specific device. In most cases you would use the derivedstd::ifstream
andstd::ofstream
class s and open the device as a "file stream".If you require an identical interface in order to use the code unmodified, then implementing
Stream
as a wrapper aroundiostream
is feasible.