Stack applications – Echelon LonTal Stack User Manual
Page 222
210
Appendix G: Appendix G
Example LonTalk
Stack Applications
"\n"
"
for the IP-852\n"
" interface\n"
"
IP852 interface\n"
"\n"
);
return
1;
}
#else
if
(argc < 2)
{
printf(
"Run a simple LonTalk Device using a standard LonTalk
network interface\n\n"
"Syntax:\n"
" SimpleLtDevice
"\n"
"
network interface\n"
"\n"
);
return
1;
}
else
{
SetMyNetworkInterface(argv[1]);
}
#endif
if
(OsalCreateEvent(&eventReadyHandle) == OSALSTS_SUCCESS)
{
OsalHandle taskHandle;
OsalTaskId taskId;
appTaskRunning = TRUE;
if
(OsalCreateTask(appTask, 0
/* Not used */
, 64*1024, 11,
&taskHandle, &taskId) == OSALSTS_SUCCESS)
{
printHelp();
printf(
"> "
);
while
(appTaskRunning)
{
char
c = toupper(getchar());
if
(c ==
'S'
)
{
sendServicPin = TRUE;
printf(
"Sending service pin...\n"
);
OsalSetEvent(eventReadyHandle);
}
else
if
(c ==
'Q'
|| c ==
'E'
)
{
shutdownApp = TRUE;
printf(
"Exiting...\n"
);
OsalSetEvent(eventReadyHandle);
break
;
}
else
if
(c == 0x0a)
{
printf(
"> "
);
;
}
else
{
if
(c !=
'?'
)
{
printf(
"Unrecognized command\n"
);
}
printHelp();
}
}
while
(appTaskRunning)
{