IOCTL_FARC_GET_NETMAP

Description:
retrieve current netmap

Parameters:

Parameter Type Description
Input
return condition
(optional)
struct ARCNET_NETMAP If NULL the function returns result immediately

If ARCNET_NETMAP was specified, then the driver compares the input netmap with the real netmap and returns results only if differences are detected or the specified timeout was elapsed.
The timeout is specified in 10ms units and has 1 special cases:
  • 0 - the function returns immediately with the current netmap.
  • 0xFFFF - the functions wait infinitely for a netmap change.
Note: this value is ignore by SH ARC-USB driver.
Output
current net map struct ARCNET_NETMAP the number of interrupts, that occured since the last initialization of the ARCNET-adapter

Possible errors (see also Error codes):
E_FARC_ABORT
E_FARC_NOT_INITED,
E_FARC_EXCESSIVE_RECON,
E_FARC_BUFFER_TOO_SMALL,
E_FARC_NETMAP_PENDING,
E_FARC_NETMAP_NO_CHANGE

Remarks:
Only one request of this call can be pending, otherwise an error will be returned.

A pending request will be cancelled if IOCTL_FARC_DEINIT is performed.

In case of SH ARC-USB this functions returns result immediately due to the design limitations.

Requirements:

this function is supported by:
- all ARCNET adapters with COM2002x controller and SOHARD URAW API driver;
- SH ARC-USB since driver v4.4.

Notes:

1) This feature allows only simple and rudimentary netmap detection. The driver may NOT detect glitches in the netmap. Furthermore this funtion may return "ghost nodes". You should only look at that nodes that are set in the previous call to IOCTL_FARC_NETMAP_SETTINGS.

2) This feature does not supported by SH ARC-66

3)If you need a safe and reliable node/netmap detection, use SH ARCALYZER.

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_NETMAP sNetmap; ARCNET_NETMAP sNetmapNew; overlapped.Offset = 0; overlapped.OffsetHigh = 0; overlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); ... memset(&sNetmap,0,sizeof(sNetmap)); // only nodes 1..3 and 7 are expected to be active sNetmap.ba_netmap[0] = 0x8E; // wait 100ms for a netmap schange // function should return, if detected netmap is different or at least after 100ms sNetmap.w_timeout = 10; ret = DeviceIoControl(drvhandle, IOCTL_FARC_GET_NETMAP, &sNetmap, sizeof(sNetmap), &sNetmapNew, sizeof(sNetmapNew), &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 { // netmap retrieved after timeout or change detected } } else { // other error occured, perhaps wrong handle } } else { // netmap immediately retrieved } ...

See also:
DeviceIoControl()
IOCTL_FARC_NETMAP_SETTINGS
IOCTL_FARC_DEINIT
ARCNET_NETMAP

Back to Programming Guide Contact Copyright and Disclaimer