IOCTL_FARC_SET_READ_TIMEOUT

Description:
Set timeout value in ms units for subsequent ReadFile() operations on the driver.

By default the driver does not complete ReadFile() request until the ARCNET data packet was received. After the timeout was set to any non-zero value the ReadFile() request will be completed with:

Parameters:

Parameter Type Description
Input
Timeout ULONG Timeout value in milliseconds.
Value 0 means that timeout is disabled and ReadFile() waits infinetely for the receipt of an ARCNET data packet.
Output
- - -

Possible errors (see also Error codes):
E_FARC_INVALID_HANDLE
E_FARC_NO_PARAMETERS

Notes:

If several ReadFile requests are started, only the oldest ReadFile will return with errorcode E_FARC_READ_TIMEOUT. Then the next ReadFile request is monitored with the restarted timeout.

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; ULONG ulTimeout; overlapped.Offset = 0; overlapped.OffsetHigh = 0; overlapped.hEvent = CreateEvent(NULL,TRUE,FALSE,NULL); ... ulTimeout = 5000; // wait 5 seconds for data ret = DeviceIoControl(drvhandle, IOCTL_FARC_SET_READ_TIMEOUT, &ulTimeout, sizeof(ulTimeout), 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 { // other error occured, perhaps wrong handle } } // All subsequent ReadFile() requests from here are monitored with the previously set timeout. ...

See also:
DeviceIoControl()
ReadFile()
IOCTL_FARC_GET_READ_TIMEOUT

Back to Programming Guide