This example shows how to implement two debug commands.
- The first one will output "Hello World" if "hw" is entered in the "Send Debug Text" box of the Netcruzer USB Terminal
- The second one will output our current IP address if "ip" is entered in the "Send Debug Text" box of the Netcruzer USB Terminal
void debugService(void) {
if (debugHasString()) {
debugStrLen =
strlen(debugGetString());
switch(debugGetString()[0]) {
case 'h':
if (debugStrLen==2 && debugGetString()[1]=='w') {
debugRemoveString();
}
break;
case 'i':
if (debugStrLen==2 && debugGetString()[1]=='p') {
debugRemoveString();
}
break;
}
}
}