
45 PCI-1680U/1682U User Manual
Chapter 4 Software Requirements
Example
Wait event in synchronous mode.
DWORD dwMask;
BOOL bSuccess = WaitCommEvent(hDevice, &dwMask, NULL);
if(bSuccess)
{
if(dwMask & EV_ERR)
{
//to do
DWORD dwError;
bSuccess = ClearCommError(hDevice, &dwError, NULL);
if(bSuccess)
{
//to do
if(dwError& CE_FRAME || dwError& CE_BREAK)
{
CanStatusPar_t status;
DWORD dwReturned;
DeviceIoControl (hDevice,
CAN_IOCTL_STATUS,
NULL,
0,
&status,
sizeof(CanStatusPar_t),
&dwReturned,
NULL
);
}
}
}
See Also
WaitCommEvent
DeviceIoControl
Comentarios a estos manuales