Kvaser CANLIB: Welcome to Kvaser CANLIB!
obsolete.h
Go to the documentation of this file.
1 
15 #ifndef _OBSOLETE_H_
16 #define _OBSOLETE_H_
17 
23 #define canCIRCUIT_ANY -1
24 #define canCARD_ANY -1
25 #define canCHANNEL_ANY -1
26 
27 #define CANID_METAMSG (-1L)
28 #define CANID_WILDCARD (-2L)
29 
30 
37 typedef void* (*canMemoryAllocator) (size_t size);
38 
42 typedef void (*canMemoryDeallocator)(void* p);
43 
47 typedef struct tagCanHWDescr {
49  int cardType;
50  int channel;
51 } canHWDescr;
52 
56 typedef struct tagCanSWDescr {
57  unsigned int rxBufSize;
58  unsigned int txBufSize;
61 } canSWDescr;
62 
63 #ifdef __WIN32__
64 
67 typedef struct {
68  unsigned int size;
69  unsigned int rxBufSize;
70  unsigned int txBufSize;
71 } canSWDescriptorEx;
72 #endif
73 
77 canStatus CANLIBAPI canLocateHardware(void);
78 
82 int CANLIBAPI canOpen(const canHWDescr * const hwdescr,
83  const canSWDescr * const swdescr,
84  const unsigned int flags);
85 
89 canStatus CANLIBAPI canGetCircuits(int * context,
90  char * name,
91  char * vendor,
92  char * version,
93  unsigned int * cardtype,
94  unsigned int * circtype,
95  unsigned int * channel);
96 
102 #define canERR_BUFOFL canERR_RESERVED_3
103 #define canERR_REINIT canERR_RESERVED_4
104 #define canERR_MSGLOST canERR_RESERVED_5
105 #define canERR_OVERRUN canERR_RESERVED_6
106 #define canERR_CARDCOMMFAILED canERR_RESERVED_7
107 
114 #define canCIRCSTAT_ERROR_PASSIVE 0x0001
115 #define canCIRCSTAT_BUS_OFF 0x0002
116 #define canCIRCSTAT_ERROR_WARNING 0x0004
117 
125 #define canCHANNEL_CAP_REMOTE canCHANNEL_CAP_RESERVED_1
126 
127 
133 #define canSTICKY_ACK_ERROR 0x80000801
134 #define canSTICKY_FORM_ERROR 0x80000002
135 #define canSTICKY_STUFF_ERROR 0x80000004
136 #define canSTICKY_CRC_ERROR 0x80000008
137 #define canSTICKY_BIT0_ERROR 0x80000010
138 #define canSTICKY_BIT1_ERROR 0x80000020
139 #define canSTICKY_HW_OVERRUN 0x80000040
140 #define canSTICKY_SW_OVERRUN 0x80000080
141 
143 #define canSTAT_INACTIVE canSTAT_RESERVED_1
144 
145 
146 /*
147 #define canCIRCSTAT_TXERR 0x0001 // TX error has occurred
148 #define canCIRCSTAT_RXERR 0x0002 // Receive error has occurred
149 #define canCIRCSTAT_OVERRUN 0x0004 // Receiver overrun
150 #define canCIRCSTAT_WAKEUP 0x0008 // Wakeup has occurred
151 #define canCIRCSTAT_INT 0x0010 // ??
152 #define canCIRCSTAT_ACK 0x0020 // ACK error
153 #define canCIRCSTAT_BIT 0x0040 // Bit error
154 */
155 /*
156 More apocryphs.
157 #define canCIRCSTAT_OVERRUN 0x0004 // Receiver overrun
158 #define canCIRCSTAT_WAKEUP 0x0008 // Wakeup has occurred
159 #define canCIRCSTAT_ACK 0x0010 // ACK error
160 #define canCIRCSTAT_BIT0 0x0020 // Bit error
161 #define canCIRCSTAT_BIT1 0x0040 // Bit error
162 #define canCIRCSTAT_BOFF 0x0080 // Chip went Bus Off
163 */
164 /*
165 Even more.
166 #define canCIRCSTAT_BOFF_HW 0x10000L // Chip is Bus Off
167 #define canCIRCSTAT_BOFF_SW 0x20000L // We are Bus Off
168 */
169 
170 
176 #define canWANT_ACTIONS 0x01
177 #define canWANT_OWN_BUFFERS 0x02
178 #define canWANT_ERROR_COUNTERS 0x04
179 #define canWANT_EXCLUSIVE 0x08
180 #define canWANT_EXTENDED 0x10
181 #define canWANT_VIRTUAL 0x20
182 
183 
190 // No circuit 0
191 #define PCCAN_PHILIPS 1
192 #define PCCAN_INTEL526 2
193 #define PCCAN_INTEL527 3
194 #define CANCARD_NEC72005 4
195 #define CIRC_VIRTUAL 5
196 #define CIRC_SJA1000 6
197 
204 #define canCARD_PCCAN 1
205 #define canCARD_CANCARD 2
206 #define canCARD_AC2 3
207 #define canCARD_LAPCAN 4
208 #define canCARD_ISACAN 5
209 #define canCARD_PCCAN_OEM 6
210 
217 #define canFlgACCEPT 1
218 #define canFlgREJECT 2
219 #define canFlgCODE 3
220 #define canFlgMASK 4
221 
228 #define canDISCARD_MESSAGE 3
229 #define canRETAIN_MESSAGE 4
230 
238 #define canSLOW_MODE 0x01
239 
247 #define canOFF 0
248 #define canTRISTATE 1
249 #define canPULLUP 2
250 #define canPULLDOWN 3
251 #define canPUSHPULL 4
252 #define canINVPULLUP 5
253 #define canINVPULLDOWN 6
254 #define canINVPUSHPULL 7
255 
263 #define canIOCTL_LOCAL_ECHO_ON 3
264 #define canIOCTL_LOCAL_ECHO_OFF 4
265 
266 #define canMSG_STATUS 0x0008
267 
269 #ifdef __cplusplus
270 extern "C" {
271 #endif
272 
276 canStatus CANLIBAPI canInstallAction(int handle, long id, int (*fn)());
277 
281 canStatus CANLIBAPI canUninstallAction(int handle, long id);
282 
286 canStatus CANLIBAPI canInstallOwnBuffer(int handle, long id, unsigned int len,
287  void * buf);
288 
292 canStatus CANLIBAPI canUninstallOwnBuffer(int handle, long id);
293 #ifdef __cplusplus
294 }
295 #endif
296 
299 #endif
int canOpen(const canHWDescr *const hwdescr, const canSWDescr *const swdescr, const unsigned int flags)
canStatus canInstallAction(int handle, long id, int(*fn)())
canMemoryAllocator alloc
Definition: obsolete.h:59
Definition: obsolete.h:56
void *(* canMemoryAllocator)(size_t size)
Definition: obsolete.h:37
int cardType
Definition: obsolete.h:49
Definition: obsolete.h:47
canStatus canGetCircuits(int *context, char *name, char *vendor, char *version, unsigned int *cardtype, unsigned int *circtype, unsigned int *channel)
unsigned int rxBufSize
Definition: obsolete.h:57
canStatus canInstallOwnBuffer(int handle, long id, unsigned int len, void *buf)
canMemoryDeallocator deAlloc
Definition: obsolete.h:60
int channel
Definition: obsolete.h:50
struct tagCanSWDescr canSWDescr
canStatus
Definition: canstat.h:46
canStatus canUninstallAction(int handle, long id)
struct tagCanHWDescr canHWDescr
unsigned int txBufSize
Definition: obsolete.h:58
canStatus canUninstallOwnBuffer(int handle, long id)
canStatus canLocateHardware(void)
void(* canMemoryDeallocator)(void *p)
Definition: obsolete.h:42
int circuitType
Definition: obsolete.h:48