User Manual

Appendix B - Sample Programs
________________________________
Boomer II User Manual & Integrator’s Guide
Wavenet Technology 130 BM210012WT09
Server Application
The server program is a Windows NT command line program that
connects to the DataTAC
®
network switch and waits to receive data
from wireless client devices. Any data received from wireless clients is
echoed back to the same client on the same session. The server
program can handle simultaneous connections from multiple clients.
All activity indications (data transfer, connections and disconnections)
are logged to the screen. The server program operates without requiring
any user input.
Communications to the RNG are established either via a TCP/IP or an
X.25 connection, based on command line parameters.
The server program is implemented in a single module: server.c.
The server program uses SCR API to decode, encode, and interpret the
messages from the network. The server program contains code to
communicate with the network switch or RNG via either X.25 or
TCP/IP. The X.25 connection code is written using the EICON X.25
Developer's Tools for Win32. To run the application over an X.25
connection, you must have an X.25 connection to the switch, as well as
an EICON X.25 card plus EICON WAN Services drivers for this card.
To run the sample application via TCP1IP, you must have a TCP/IP
connection to the network switch. For help in getting this connection
set up, contact your DataTAC network operator.
The following pseudo code outlines the implementation of the main() function.
ma i n ( )
{
I ni t i a l i z e a ppl i c a t i on va r i a bl e s
Se t d e f a ul t v a l ue s f o r us e r c on f i g ur a bl e pa r a me t e r s
Pr oc e s s c omma nd l i ne a nd up d a t e pa r a me t e r s
I n i t i a l i z e X. 2 5 API o r Wi n s oc k DLL ( c o nn e c t i on t o
RNG)
I n i t i a l i z e SCR API u s i ng s c r _ I n i t ( )
Es t a bl i s h a c onn e c t i on t o t he Da t a TAC ne t wor k
whi l e ( ! t e r mi n a t e ) {
Re a d d a t a f r om t he n e t wor k
Ha nd l e Me s s a ge z Ha nd l e Me s s a g e ( )
}
Te r mi na t e c on n e c t i on t o RNG
Cl e a n up
}