nSerialSend
Function: int nSERIALSend (long session, short port, unsigned short flush, long timeout,
short terminator, short length, char FAR *data, short FAR *xlength, unsigned short
FAR *status);
Parameters:
Long session The session handle of the NetScan
Short port The port being read from.
Unsigned short flush Flag to indicate if the receive buffer should
be cleared.
long timeout The time, in milliseconds, to wait for
received data.
Short terminator The terminator to be used for serial input.
Short length The maximum number of characters to be
Transmitted from the data buffer.
Char FAR * data A buffer where the transmitted
Data resides.
Short FAR * xlength The number of characters that were sent.
Unsigned short FAR * status Not used
Parameter Values:
Port NetScan = 1
Aux = 0
Flush retain = 0
Empty = 1
Terminator none = -1
CRLF = -3
User defined = 0 to 255
Returns: 0 if successful, error code or war ning if command not completed.
Description: This functions primary use is to send data to the NetScans ethernet interface. The secondary use is to
flush all characters from the NetScans ethernet interface receive buffer. Because this function may take some time
to complete, the return value must be tested to see if the command has completed. The return value for command
pending is –801.
Example:
Do { ErrVal = nSERIALSend(session, 1, 0, 1000, 13, 100, &dataBuffer,
&xlength, &status);
} while (errVal == -801) ;
nSessionEnd
Function: int nSessionEnd (long session);
Parameters:
long session The session handle of the NetScan
Returns: 0 if successful, error code if not.
Description: This function is used to end an active session. When operations with the NetScan are
completed, this function should be called to end the session.
nSwDeinit
Function: int nSWDeinit (void);
Parameters: None
Returns:0 if successful, error code if not.
Description: This function is used to de-initialize all resources allocated by the nSWInit function.
This is the last function that should be called.