User`s guide
E - 4
K
A
DAK
KwikNet Sample Program Architecture
The sample program begins operation at task level once AMX completes its startup
processing. 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 sample program requires AMX/FS file services, procedure sam_osfsprep() in the
Application OS Interface module KNSAMOS.C is called to prepare the AMX/FS File
System 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 simply requests AMX to exit in its usual orderly fashion.
AMX executes the sample program Exit Procedure exproc() which calls
chclockexit() to disable the AMX clock driver. Once all Exit Procedures have been
called, AMX ceases operation and returns to the main() function from which AMX was
launched. One final call to procedure kn_osfinish() in the KwikNet OS Interface
Module KN_OSIF.C (in the KwikNet Library) breaks the connection between KwikNet and
its RTOS interface.