User`s guide
E - 6
K
A
DAK
KwikNet Sample Program Architecture
The sample program begins operation at task level once the high priority startup task
terminates. The client task executes and calls function
app_enter(), the entry point to
the main body of the sample program.
The client task starts
KwikNet with a call to KwikNet procedure kn_enter(). KwikNet
initializes all of its private resources and starts the KwikNet Task which prepares all
network interfaces and their associated device drivers for use.
If the client task provides an interactive user interface, the console driver is initialized
with a call to procedure knconinit(). Thereafter, the client task orchestrates the
sequence of network operations it is designed to illustrate.
The termination process is handled by the client task. If the console driver was in use, it
is closed with a call to
knconexit(). KwikNet is stopped with a call to kn_exit(). After
a brief pause to allow
KwikNet to stop, the RTOS shutdown is initiated with a call to
sam_osshutdown() which, if possible, forces the RTOS to terminate execution in an
orderly fashion.
If the RTOS ceases operation, it returns to the main() function from which it was
launched. One final call to procedure kn_osfinish() in your KwikNet OS Interface
Module KN_OSIF.C (in the KwikNet Library) breaks the connection between KwikNet and
your RTOS. In many cases, procedure kn_osfinish() will also stop your KwikNet clock
driver with a call to its termination procedure kn_uclockexit().