- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all, I'm developing a multithreading C++ application on a PC104 board with the EG20T CAN Controller and Windows 7 Embedded. I'm using the intel library (EG20T_WinXP_WePOS_Package_241) to use that controller. My application has two thread, one to Write and the other to Read on the CAN bus.
These threads call the following function:
Write Thread -> bRet = DeviceIoControl(hDevice, IOCTL_CAN_WRITE, &msg, sizeof(msg), NULL, 0, &dwBytesReturned, NULL);
Read Thread -> bRet = DeviceIoControl(hDevice, IOCTL_CAN_READ, NULL, 0, &msg, sizeof(msg), &dwBytesReturned, NULL);
But when the Read function is called in the Read Thread (it could be in blocking mode) the Write one doesn't work, the Write function doesn't write any bytes on the CAN bus until something is received from the Read.
This seems that this library can't be used in multithreading application, is it right?
Have you any suggestion?
Best regards.
Link Copied
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page