Download EMS Portable Workflow - Computer Science

Transcript
A collection of Net Library functions are used to give the desired functionality to these functions.
Each of these Net Library functions is defined in NetMgr.h.
4.2.1.1 SendData
The SendData function sends an XML string containing incident report information. It is the
function that is called when a user wishes to send an incident report. To send the string, the Net
Library must be opened so the NetLib function calls can be utilized. With the Net Library open,
SendData can verify a host name and service name and make a socket connection to the server. At
this point, data can be sent or received. When finished with all network transactions, the socket, as
well as the Net Library, is closed, and the status of the transmission is returned.
4.2.1.1.1
Find/Open Net Library
The Net Library must first be found using the SysLibFind system function before it can be opened.
Err SysLibFind (const Char *nameP,UInt16 *refNumP)
Function
Return a reference number for a library that is already loaded, given its name.
Purpose
Parameters nameP – Pointer to the name of a loaded library.
Result
Called By
refNumP - Pointer to a variable for returning the library reference number (on failure, this
variable is undefined)
0 if no error; otherwise: sysErrLibNotFound (if the library is not yet loaded), or another error
returned from the library's install entry point.
This method is called from the SendData() function in EIRXMIT.c
When the Net Library has been found, it is then opened by calling NetLibOpen. This call reads
from the network configuration file on the handheld, making a physical connection to the wireless
medium via one of WPI’s wireless access points. The function then loads the network protocol stack.
Err NetLibOpen (UInt16 libRefnum, UInt16 *netIFErrsP)
Function
Opens and initializes the Net Library.
Purpose
Parameters libRefnum – Reference number to the Net Library.
Result
Called By
netIFErrsP – First error encountered when bringing up network interfaces.
0 - if no error
netErrAlreadyOpen – returned if library is already open
netErrOutOfMemory – not enough memory available to open library.
netErrNoInterfaces – incorrect setup.
netErrPrefNotFound – incorrect setup.
This method is called from the SendData() function in EIRXMIT.c
69