IOCTL_FARC_DISABLE_RECEIVE
Purpose: disable the receiver of the ARCNET-controller
Parameter:
IN: -
OUT: -
Comment:
After performing a IOCTL_FARC_DISABLE_RECEIVE, up to 2 packets can
be received, before the receiver is locked.
This command is executed by the controller the next time, when the
token is received. It takes 2 tokens to complete.
After the command has finished, the controller responds with NAK to
nodes, that try to send a packet to it.
Possible errors (see also Error codes):
E_FARC_INVALID_HANDLE
E_FARC_NOT_INITED
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;
overlapped.Offset = 0;
overlapped.OffsetHigh = 0;
overlapped.hEvent = CreateEvent(NULL,
TRUE, FALSE, NULL);
...
ret = DeviceIoControl(drvhandle,
IOCTL_FARC_DISABLE_RECEIVE,
NULL, 0,
NULL, 0,
&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
{
// Receiver now disabled
}
}
else
{
//
other error occured, perhaps wrong handle
}
}
...