User Manual

LonTalk Stack Developer’s Guide 217
sts = router.Start(0, ltUid, pLtChannel,
1, ipUid, ipAddress, ipPort);
}
if (sts == LT_NO_ERROR)
{
printHelp();
printf("> ");
while (TRUE)
{
char c = toupper(getchar());
if (c == 'S')
{
printf("Sending service pin...\n");
router.sendServicePinMsg();
}
else if (c == 'Q' || c == 'E')
{
printf("Exiting...\n");
break;
}
else if (c == 0x0a)
{
printf("> ");
;
}
else
{
if (c != '?')
{
printf("Unrecognized command\n");
}
printHelp();
}
}
}
else
{
printf("Initialization error %d\n", sts);
}
router.Shutdown();
delete pLtChannel;
return 0;
}