A Complete PDK Program

This program is available in the PDK as pdktest.c in the etc/pdktest directory. pdktest demonstrates how to start worker threads and how to us the eCos Control API to remotely control the worker thread. The worker thread simply makes a log entry at a user configurable interval. The application options in wxpxscontrol allow you to start, stop and query the state of the worker thread and to change the log entry interval.

When executed on the PXS, the following output appears in the remote log server's log file:

Nov 02 13:33:57 2004 Info : pxs-1309671422 : eCos starting pdktest version 1.17.
Nov 02 13:33:57 2004 Info : pxs-1309671422 : PXS Test starting.
Nov 02 13:33:57 2004 Info : pxs-1309671422 : Starting worker thread.
Nov 02 13:33:57 2004 Info : pxs-1309671422 : Entering worker thread.
Nov 02 13:33:57 2004 Info : pxs-1309671422 : PXS control server listening on port 2719.
Nov 02 13:33:57 2004 Info : pxs-1309671422 : Entering command loop.
Nov 02 13:34:07 2004 Info : pxs-1309671422 : Worker thread timeout at 10000 msecs.
Nov 02 13:34:17 2004 Info : pxs-1309671422 : Worker thread timeout at 10000 msecs.
Nov 02 13:34:27 2004 Info : pxs-1309671422 : Worker thread timeout at 10000 msecs.
Nov 02 13:34:37 2004 Info : pxs-1309671422 : Worker thread timeout at 10000 msecs.
Nov 02 13:34:47 2004 Info : pxs-1309671422 : Worker thread timeout at 10000 msecs.
Nov 02 13:34:57 2004 Info : pxs-1309671422 : Worker thread timeout at 10000 msecs.
Nov 02 13:34:58 2004 Info : pxs-1309671422 : Remote command 'State' received.
Nov 02 13:35:06 2004 Info : pxs-1309671422 : Remote command 'Stop' received.
Nov 02 13:35:06 2004 Info : pxs-1309671422 : Stopping worker thread.
Nov 02 13:35:06 2004 Info : pxs-1309671422 : Leaving worker thread.
Nov 02 13:35:16 2004 Info : pxs-1309671422 : Remote command 'Start' received.
Nov 02 13:35:16 2004 Info : pxs-1309671422 : Starting worker thread.
Nov 02 13:35:16 2004 Info : pxs-1309671422 : Entering worker thread.
Nov 02 13:35:26 2004 Info : pxs-1309671422 : Worker thread timeout at 10000 msecs.
Nov 02 13:35:35 2004 Info : pxs-1309671422 : Remote command 'Halt' received.
Nov 02 13:35:35 2004 Info : pxs-1309671422 : Leaving command loop.
Nov 02 13:35:35 2004 Info : pxs-1309671422 : Stopping worker thread.
Nov 02 13:35:35 2004 Info : pxs-1309671422 : Leaving worker thread.
Nov 02 13:35:35 2004 Info : pxs-1309671422 : PXS Test stopped.
Nov 02 13:35:35 2004 Info : pxs-1309671422 : eCos exiting pdktest version 1.17.

This session shows where the worker thread was stopped and restarted using wxpxscontrol, and finally, where the program was halted in preparation for rebooting to PXS.