CAN-GW client library
ETH2CAN is a (device) Gateway between Ethernet and CAN networks. TCP/IP is used as a communication protocol between CAN-GW and user's application (via client library, described below). For details on Hardware see http://parabel.inc.ru/products/cangw/
Client's library consists of a few headers, libraries, and dll's. It's:
- Written on pure C (no C++) for usage with CVI, ...
- Written without threads (but for multithreaded applicatoins)
- Cross-platform (tested on Linux(x86), Linux(PPC), Windows(x86).
To initiate communication with ETH2CAN gateway you must esteblish a connection with CanGwConnect(). To obtain number of CAN ports and description, you must use CanGwConnect() and CanGwGetPortName().
Now you can set CAN port mode with CanGwSetMode(), and bind specified CAN port with this TCP connection with CanGwBindPort(). Note, that one CAN port can be used from multiple applications.
To send packets you must use CanGwSend(), to receive packets you must use CanGwRecv(). Both functions have timeout parameter, to protect application from blocking.
To run custom application you must have cangw.dll and pthreadvc.dll(for Windows) dynamic libraries. If you're develping your application with C/C++ compiler-you can use the following headers:
- cangw.h (defines basic cangw functions)
- cangw_msg.h (defined cangw_msg_t) and cangw.lib to link with MSVC (or any MSVC-object-compatible compiler/linker)
If you're using non-MSVC-object-compatible compiler/linker compiler (like C++ Builder, Labwindows) - you have to bind functions manually (like for any other DLL).
Generated on Thu Oct 28 12:08:01 2004 for CANGW client library by
1.3.5