I'm a huge fan of Teensy (I have 7 of them!) and have recently started a project that needs to be a little more polished and reliable. To help this, I'm trying to create a robust 'debug console' for easy status checking, configuration update and debugging when things inevitably go wrong.
My project uses a WIZ820io & Micro SD Card Adaptor so I have an ethernet port available. The core of my code only uses 1 of the WIZ820io's 4 available sockets, so it is my intention to have the other 3 sockets available on port 23 (i.e. telnet). Also assume that the Teensy is on a secure subnet (I'm aware Telnet is terrible for security). It is also possible to connect via USB serial for debugging.
In summary; when my code generates a debug message (which there are different levels of so the user can change the verbosity of the debug output), I'd like the message to go to (in the 'worse' case) the USB serial, and 3 sockets.
I really like the ease of use of 'print' and 'println' and the built in conversions from ints to strings and more. So I'd like to be able to call something like 'Debug.println("")' and under the hood it calls 'Serial.println("")', 'TelnetClient1.println("")', 'TelnetClient2.println("")', etc. (Where 'TelnetClientX' is of type EthernetClient)
My investigation so far has told me that I will probably have to create a class that inherits from some built in arduino type ('printable' possibly?), and I haven't been able to find an example of where this kind of advanced debug console functionality exists which does surprise me. Can anyone please help me with suggestions?
Thanks,
Mark
My project uses a WIZ820io & Micro SD Card Adaptor so I have an ethernet port available. The core of my code only uses 1 of the WIZ820io's 4 available sockets, so it is my intention to have the other 3 sockets available on port 23 (i.e. telnet). Also assume that the Teensy is on a secure subnet (I'm aware Telnet is terrible for security). It is also possible to connect via USB serial for debugging.
In summary; when my code generates a debug message (which there are different levels of so the user can change the verbosity of the debug output), I'd like the message to go to (in the 'worse' case) the USB serial, and 3 sockets.
I really like the ease of use of 'print' and 'println' and the built in conversions from ints to strings and more. So I'd like to be able to call something like 'Debug.println("")' and under the hood it calls 'Serial.println("")', 'TelnetClient1.println("")', 'TelnetClient2.println("")', etc. (Where 'TelnetClientX' is of type EthernetClient)
My investigation so far has told me that I will probably have to create a class that inherits from some built in arduino type ('printable' possibly?), and I haven't been able to find an example of where this kind of advanced debug console functionality exists which does surprise me. Can anyone please help me with suggestions?
Thanks,
Mark