Debug Output

I’m trying to implent a UDP broadcast responder (see the thread “UDP Broadcast”). I would like to print some debugging information to whatever location is possible. E.g. to the USB serial port where the SimpleShell module is running. But i have no idea how to do this. Maybe extend the SimpleShell Class with an ::Print method? But how do i call this method? Where is the pointer to the SimpleShell instance? Any hint is very welcome. Thank You.

Christof

Imported from wikidot

You probably want to do something like this : 

https://github.com/Smoothieware/Smoothieware/blob/edge/src/modules/tools/endstops/Endstops.cpp#L303

Thanks. This looks promising :slight_smile:

Now, THEKERNEL is undefined. I tried inserting

#include "libs/Module.h"
#include "libs/Kernel.h"

which results in some more compilation errors. Do You have a quick suggestion? I will dig through the header files, but maybe is the solution a simple oneliner :slight_smile:

Best Regards,

Christof

Update:

dhcp.c is pure C source code, therefore i can’t use anything like THEKERNEL. I will try to build some wrapper or move my code into a C++ Module which will be called by dhcp.c

I’ve got it working by implementing a Module (like described in the documention) which (being C++) is able to call THEKERNEL->….
This class has a static member, extern “C” which i call from the low level routines in UIP. I can then see my output on the virtual serial port at the USB connection.

if someone is interested i can post the Source Code

Best Regards,

Christof.