Main Page | Data Structures | File List | Data Fields | Globals

cangw.h

Go to the documentation of this file.
00001 
00038 #ifdef CANGW_EXPORTS
00039 #define CANGW_API __declspec(dllexport)
00040 #else
00041 #define CANGW_API __declspec(dllimport)
00042 #endif
00043 
00044 #ifndef __CANGW_H__
00045 #define __CANGW_H__
00046 
00047 #ifdef __cplusplus
00048 extern "C" {
00049 #endif
00050 
00051 #include "cangw_msg.h"
00052 #include "cangw_defs.h"
00053 
00054 #define CANGW_ERRBUF    128
00055 
00056 #define CANGW_NOERR             (0)
00057 #define CANGW_ERR                       (-1)
00058 #define CANGW_TIMEOUT           (-2)
00059 
00060 typedef int CANGW_CONN_T;
00061 
00073 CANGW_API CANGW_CONN_T CanGwConnect (const char *host, unsigned short port, 
00074                                            const char *user, const char *pwd, char *errbuf);
00075 
00083 CANGW_API const char *CanGwGetServerName (CANGW_CONN_T conn_id, char *errbuf);
00084 
00092 CANGW_API unsigned long CanGwGetPortsNum (CANGW_CONN_T conn_id, char *errbuf);
00093 
00102 //TODO: new prototype (char *s, int len) parameters... To be reenerable.
00103 CANGW_API const char *CanGwGetPortName (CANGW_CONN_T conn_id, unsigned long port, char *errbuf);
00104 
00117 CANGW_API int CanGwSetMode (CANGW_CONN_T conn_id, unsigned short port, unsigned char id_len, unsigned short baud, char *errbuf);
00118 
00129 CANGW_API int CanGwGetMode (CANGW_CONN_T conn_id, unsigned short port, unsigned char *id_len, unsigned short *baud, char *errbuf);
00130 
00131 
00141 CANGW_API int CanGwBindPort (CANGW_CONN_T conn_id, unsigned long port, 
00142                                  unsigned long addr, unsigned long mask, char *errbuf);
00143 
00144 CANGW_API int CanGwSend (CANGW_CONN_T conn_id, const cangw_msg_t *msg, unsigned short number, unsigned long to_usec, char *errbuf);
00145 
00146 CANGW_API int CanGwRecv (CANGW_CONN_T conn_id, cangw_msg_t *msg_buf, unsigned short number, long to_usec, char *errbuf);
00147 
00148 CANGW_API int CanGwFreePort (CANGW_CONN_T conn_id, char *errbuf);
00149 
00150 CANGW_API int CanGwDisconnect (CANGW_CONN_T conn_id, char *errbuf);
00151 
00152 #ifdef __cplusplus
00153 }
00154 #endif
00155 
00156 #endif //__CANGW_H__
00157 
00158 
00159 /*
00160 redundant functions, I think.
00161 int CanGwStart (CANGW_CONN_T conn_id, char *errbuf); 
00162 int CanGwStop (CANGW_CONN_T conn_id, char *errbuf);
00163 */
00164 

Generated on Thu Oct 28 12:08:02 2004 for CANGW client library by doxygen 1.3.5