DiagTask is a debugging tool (compiled in embedded firmare) that allows to register "hooks". On serial console diagtask waits for user input and calles registerred functions. Those functions can then print infos or control the behavior of the software.