(Page 13 of 14 in this chapter)


agmOpenDriver

Description

Opens the AG device driver and returns a handle to a wait object, and the major and minor revision numbers of the driver.

Prototype

DWORD agmOpenDriver ( AGMHD agmhd,
MUX_HANDLE *muxhd,
unsigned *majorrev,
unsigned *minorrev)

agmhd Handle returned by agmOpen.

muxhd Pointer to a variable to receive a mux handle that will be used to indicate the presence of queued driver messages.

majorrev Pointer to a variable to receive the major revision number of the AG device driver.

minorrev Pointer to a variable to receive the minor revision number of the AG device driver.

Return Values

Details

This function opens the AG device driver and returns a handle to a mux handle.

agmOpenDriver should only be used after the AG device drivers have been installed and started. agmLoadDriver is used to install drivers. The drivers only need to be installed once, system-wide, for each hardware and/or AG configuration file change. If the AG device drivers have already been installed and started by some other process (including the system boot sequence), processes may call agmOpenDriver without first calling agmLoadDriver.

Note: muxhd is a pointer to the returned wait object. This wait object is used to wait for events coming up from the AG board.
Under Windows NT, muxhd may be used in the Win32 WaitForSingleObject and WaitForMultipleObjects functions. Under UNIX, muxhd may be used for polling using the UNIX poll function.

See Also

agmLoadDriver, agmOpen

Example


{
AGMHD agmhd;
MUX_HANDLE muxhd;
unsigned majorrev, minorrev;

/* Call agmOpen and, if necessary, agmLoadDriver here. */
...

if (agmOpenDriver (agmhd, &muxhd, &majorrev, &minorrev)
!= SUCCESS)
{
printf ("agmOpenDriver failed.");
exit (-1);
}
printf ("AG Driver version: %d.%d\n", majorrev, minorrev);

/* Check configuration, etc. */
...
}


(Page 13 of 14 in this chapter)


tech_support@nmss.com
Copyright © 1998, Natural MicroSystems, Inc. All rights reserved.