IOCTL_FARC_GET_NETSTATE

Description:
Query the net status of the controller on the ARCNET adapter.

Parameters:

Parameter Type Description
Input
- - -
Output
net state struct ARCNET_NETSTATE Return following information:
  • status of network activity (1 - detected, 0 - otherwise)
  • status of token detection (1 - detected, 0 - otherwise)
  • status of transmitter (1 - enabled, 0 - otherwise)

Possible errors (see also Error codes):
E_FARC_INVALID_HANDLE
E_FARC_BUFFER_TOO_SMALL

Remarks:
This function can be used to detect the current status of the network. If the network is running, all items should be set to 1.

Example:
Note, that the following example is only a fragment. It is recommended, that the driver is opened in asynchronous mode and a handle to the driver is available.

OVERLAPPED overlapped; DWORD read, err; BOOL ret; ARCNET_NETSTATE netstate; overlapped.Offset = 0; overlapped.OffsetHigh = 0; overlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); ... ret = DeviceIoControl(drvhandle, IOCTL_FARC_GET_NETSTATE, NULL, 0, &netstate, sizeof(netstate), &read, &overlapped); if (!ret) { err = GetLastError(); if (err == E_FARC_PENDING) { ret = GetOverlappedResult(drvhandle, &overlapped, &read, TRUE); if (!ret) { err = GetLastError(); // do errorhandling here } } else { // other error occured, perhaps wrong handle } } printf("netstate.z_token_seen = %u",netstate.z_token_seen); ...

See also:
DeviceIoControl()

Back to Programming Guide Contact Copyright and Disclaimer