IOCTL_FARC_EXTND_FUNCTIONS

Purpose: set/get extended parameters (20022, 20020C only)

Parameter:
IN:   struct ARCNET_EXTND (declared in FARC.H)
OUT:  struct ARCNET_EXTND

Comment:
Should be performed before doing a IOCTL_FARC_INIT !
The function returns the previously set values.
New values only take effect by performing a IOCTL_FARC_INIT

Note, that SH ARC-USB does not support ReceiveAll feature.

Possible errors (see also Error codes):
E_FARC_INVALID_HANDLE
E_FARC_BUFFER_TOO_SMALL

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_EXTND extnd_new, extnd_old;

overlapped.Offset = 0;
overlapped.OffsetHigh = 0;
overlapped.hEvent = CreateEvent(NULL,TRUE,FALSE,NULL);

...
// Set Clock multiplier of 20020C
// new baudrate: 5 Mpbs
extnd_new.z_ckup_0 = 1;
extnd_new.z_ckup_1 = 0;
extnd_new.z_receiveall = 0;

ret = DeviceIoControl(drvhandle,
    IOCTL_FARC_EXTND_FUNCTIONS,
    &extnd_new, sizeof(extnd_new),
    &extnd_old, sizeof(extnd_old),
    &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
   }
}
// Now do DeviceIoControl(..., IOCTL_FARC_INIT, ...)
...

Programmer's Guide
Contents