Stream class should use mbed::fdopen() to attach a stream
mbed::fdopen() is provided in mbed_retarget.cpp which will attach a stream to the given FileHandle. Removing mbed_set_unbuffered_stream() from stream class as it is defined in mbed_retarget.cpp. Stream class should not decide whether it wants to detach buffers from c library or not. mbed::fdopen() will do that based upon isatty() call. So if a FileHandle is not a tty, i.e., is not a device type, c library buffering will not be turned off. For device type FileHandles, c library buffering is turned off. |
---|
|
drivers/RawSerial.cpp |
---|
drivers/SerialBase.h |
---|
platform/Stream.cpp |
---|
platform/Stream.h |
---|