EasyManua.ls Logo

Echelon SLTA-10 - Calling the Network Driver from a Host Application

Echelon SLTA-10
128 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
SLTA-10 Adapter User’s Guide 73
Table 15 Configuration Switches and DOS Driver Options
Input Input State Driver Option
Switch2/CFG 2 Local Host; No Transport Protocol
/M
not specified
Switch2/CFG 2 Remote Host; Reliable Transport
Protocol
/M
specified
Switch1/CFG 3 ALERT/ACK Link Protocol
/N
not specified
Switch1/CFG 3 Buffered Link Protocol
/N
specified
Calling the Network Driver from a Host Application
The SLTA-10 MIP mode network driver for DOS supports the
open
,
close
,
read
,
write
, and
ioctl
DOS calls. See Chapter 4 of the
Host Application Programmer's Guide
for more details.
When the SLTA-10 MIP mode network driver for DOS is loaded during execution of the
CONFIG.SYS
file, it does not attempt to communicate with the SLTA-10 Adapter.
When the network driver is opened with the DOS
open
call, it establishes communications with
the SLTA-10 Adapter. The network driver returns an error if this fails, for example, if the
SLTA-10 Adapter is disconnected, powered down, or configured incorrectly. If the open call
succeeds, the driver enables network communications by clearing the SLTA-10 Adapter
FLUSH
state, if configured to do so.
The DOS
read
call is defined to return the number of bytes read from the device. Some
L
ON
W
ORKS
standard network drivers return 0 if there are no uplink messages available. DOS
reports this as an end-of-file condition and prevents further reads from succeeding. However, the
SLTA-10 Adapter driver returns a length of 2, and sets the first byte of the caller's buffer (the
cmd/queue byte) to 0 to indicate that there is no uplink message available.
Normally, the DOS
read
and
write
calls are not used with L
ON
W
ORKS
standard network
drivers. This is because any error from the network interface will display the familiar
Abort
,
Retry
,
Fail
?
error message from DOS, unless the caller has installed a critical error device
handler. Therefore, DOS applications using a network device typically call direct entry points into
the driver. This also allows more detailed error status to be returned to the application. The
addresses of these entry points are obtained by calling the
ioctl()
function of the driver.
This function call is used as follows:
int ioctl(int handle, int func, void far *argdx, int argcx);
•
handle
is an integer returned by an earlier successful call to
open()
, specifying the
L
ON
W
ORKS
network driver
LONn
to be opened.
•
func
is the value 2, meaning that the application is reading information from the driver. For
L
ON
W
ORKS
standard DOS network drivers, the information returned is the network interface
direct call structure.

Table of Contents