37
PCI-1680U/1682U User Manual
Chapter 4
S
oftware
R
equirements
Return Value
It will be considered successful if non-zero values are returned in the following situa-
tions:
1.
The driver reads data and there is no data in the receive buffer. At this time, the
data received is less than the requested data.
2.
The driver reads all the requested data.
3.
The driver can not read any data and time is out.
It will be considered unsuccessful if zero values are returned in the following situa-
tions. Please call GetLastError.
If users cancel the operation or reset chip while drivers are receiving data, GetLas-
tError will be called to return ERROR_OPERATION_ABORTED.
If busoff of device is discovered before drivers read any frames, GetLastError will be
called to return ERROR_GEN_FAILURE.
If drivers cannot allocate resources according to the number defined by the third
parameter frame, GetLastError will be called to return
ERROR_INVALID_PARAMETER.
In asynchronous mode, operation will be pending if drivers cannot complete user's
read request, and GetLastError will be called to return ERROR_IO_PENDING.
See MSDN for more information.
Example
Read one frame data in synchronous mode.
DWORD dwRead;
canmsg_t ReadBuffer;
ZeroMemory(&ReadBuffer, sizeof(canmsg_t));
BOOL bSuccess = ReadFile(hDevice, &ReadBuffer, 1, &dwRead,
0);
if(bSuccess)
{
if(dwRead == 1)
{
//SUCCESS
if(ReadBuffer.flags & MSG_EXT)
{
//Extended frame
}
else{
//Standard frame
}
if(ReadBuffer.flags & MSG_RTR)
{
//Remote frame
}
if(ReadBuffer.flags & MSG_SELF)
{
//self reception
}
if(ReadBuffer.flags & MSG_BOVR)
Содержание PCI-1680U
Страница 10: ...PCI 1680U 1682U User Manual 4 ...
Страница 16: ...PCI 1680U 1682U User Manual 10 5 Click Next as the following 6 Click Next as the following ...
Страница 22: ...PCI 1680U 1682U User Manual 16 ...
Страница 26: ...PCI 1680U 1682U User Manual 20 Figure 3 2 PCI 1682U Silk Screen ...
Страница 29: ...Chapter 4 4 Software Requirements This chapter has information on the software of PCI 1680U 1682U ...
Страница 85: ...79 PCI 1680U 1682U User Manual Chapter 4 Software Requirements WDM CE ...
Страница 89: ...83 PCI 1680U 1682U User Manual Chapter 4 Software Requirements CE 4 8 2 Flow Chart 4 8 2 1 Send flow chart ...
Страница 90: ...PCI 1680U 1682U User Manual 84 4 8 2 2 Receive flow chart ...
Страница 91: ...85 PCI 1680U 1682U User Manual Chapter 4 Software Requirements 4 8 2 3 Configure flow chart ...
Страница 92: ...PCI 1680U 1682U User Manual 86 4 8 2 4 Event flow chart Either flow chart of the two sub threads is as below ...
Страница 103: ...97 PCI 1680U 1682U User Manual Chapter 5 Pin Assignments and Wiring ...