User`s guide
Purpose of the Network Driver
The network driver provides a hardware-independent interface between the host
application and the network interface. By using network drivers with consistent
calling conventions, host applications can be transparently moved between different
network interfaces. For example, the standard SLTA-10 MIP mode DOS network
driver, together with the Windows 3.1x DLL software, allows DOS and Windows 3.1x
applications, such as those based on the LonManager API, to be debugged using the
network driver for the LonBuilder Development Station. These applications can later
be used with the network driver for the SLTA-10 Adapter, without modifying the host
application.
A LONWORKS standard network driver must supply the functions defined under
Network Driver Services in Chapter 4 of the LONWORKS Host Application
Programmer’s Guide. The Windows 3.1x DLL software is described in Appendix A.
Example Network Drivers
The Connectivity Starter Kit includes source code for an example DOS network
driver; the Echelon web site contains source code for an example UNIX network
driver. The DOS driver is used for both DOS and Windows 3.1x applications. See the
comments in the source code of the network drivers for an explanation of how the
network drivers work. These drivers can be used as templates for a LONWORKS
standard network driver. The DOS network driver is compatible with the
LonManager APIs for DOS and Windows, the LonManager LonMaker installation
tool, and the LonManager DDE Server. A sample host application for DOS is also
supplied. The functions ldv~open(),ldv~read(),ldv~write(), and ldv-close0
form a suitable operating-system independent definition for the network driver.
These functions support multiple network interfaces, and hide the DOS-specific
aspects of the DOS network driver.
The UNIX network driver is a source library that uses the UNIX serial device driver.
It also supportsthe ldv-open(),ldv-read(),ldv-write(), and ldv-close0
functions.
Implementing an SLTA-10 MIP Mode Network Driver
The network driver manages the physical interface with the SLTA-10 Adapter,
implements the network interface protocol, performs flow control, manages input and
output buffers, and provides a read/write interface to the host application.
Figure 9.1 illustrates how the network driver fits into the host application
architecture.
9-2
Creating an SLTA-10 MIP Mode Driver