Hello,
We had a USB2CAN converter to add to our project and received the v1.0.6 DLL files but I made some changes (as you can see in lines 982 and 1028 of usb2canobj.cpp ) that has the benefit that an external reading thread could wait on m_receiveDataEvent before calling CanalReceive function, similar to Peak USB to CAN driver interface provides a receive handle, otherwise I have to spawn another thread that calls CanalBlockingReceive and my own manual reset event so I'm proposing to export it from usb2can.dll.
Also to avoid setting the event outside of the mutex section since a reading could occur just after m_receiveMutex was released, I moved SetEvent in the protected area for thread workThreadReceiveData as you can see in lines 1466 and 1474.
I attached the patch files for "v1.0.7" that you could use to see the differences between the version 1.0.6 I’ve got from 8devices and my proposed changes, there are some minor modifications and I provided project files to compile it with Visual C++ Express 2008 (should be easy to import in other Express editions) at following link:
https://dl.dropboxusercontent.com/u/105 ... v1.0.7.zipI also provided a fix to call CanalOpen from multiple processes to not allow opening the driver again which was breaking functionality of the first process that opened it, by using a shared mapped memory file and a global mutex.
It would be great if you could review the changes and let me know if you think they are acceptable, then to merge them in your release trunk, in the mean time I will revert our project to the original files (v1.0.6) that we received from 8devices.
Best regards,
David.