IOCTL_FARC_GET_RXSTATUS

Description:
check out if any packets have been received.

Parameters:

Parameter Type Description
Input
- - -
Output
packet availability UCHAR 0x1 if new packet are available or 0x0 otherwise

Possible errors (see also Error codes):
E_FARC_INVALID_HANDLE
E_FARC_BUFFER_TOO_SMALL

Note:

It is not recommended to use this function for new packet detection in network with high traffic. The controller itself is capable to receive only 2 packets and no further buffering is existing within the driver. So the call of DeviceIoControl with IOCTL_FARC_GET_RXSTATUS will only inroduce the time delay between packet arrive in controller and time when packet will be read by application. And as result probaility of data loss will be only increased.

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; UCHAR rxStatus; overlapped.Offset = 0; overlapped.OffsetHigh = 0; overlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); ... ret = DeviceIoControl(drvhandle, IOCTL_FARC_GET_RXSTATUS, NULL, 0, &rxStatus, sizeof(rxStatus), &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 } } if (rxStatus) { // some unread packets available; } ...

See also:
DeviceIoControl()
ReadFile()

Back to Programming Guide