I’m writing a Stream writer for the ArduinoJSON library and I want to dump the JSON packet to the stdout console. Later on, I plan to retarget the console to SWO as I need the debug UART for other purposes.
I was thinking to just call the get_console
function in mbed_retarget.cpp but it is declared static
and therefore inaccessible in other source files (similar to a private
member of a class).
I’m wondering if there’s any real design decision behind this? I am not aware of another way to get the default stdio FileHandle instance without reimplementing get_console
verbatim (ie: checking for overrides on the application and target level first).
This is fine if you only plan on using C-style function calls, but I want to use the STDIO FileHandle as a C++ object.