obsolete.h Go to the documentation of this file. 1 /* 2 * Copyright 1998-2017 by KVASER AB, SWEDEN 3 * 4 * WWW: http://www.kvaser.com 5 * 6 * This software is furnished under a license and may be used and copied 7 * only in accordance with the terms of such license. 8 * 9 */ 10 21 #ifndef _OBSOLETE_H_ 22 #define _OBSOLETE_H_ 23 24 25 #define canCIRCUIT_ANY -1 26 #define canCARD_ANY -1 27 #define canCHANNEL_ANY -1 28 29 #define CANID_METAMSG (-1L) 30 #define CANID_WILDCARD (-2L) 31 32 39 typedef void* (*canMemoryAllocator) (size_t size); 40 44 typedef void (*canMemoryDeallocator)(void* p); 45 49 typedef struct tagCanHWDescr { 50 int circuitType; 51 int cardType; 52 int channel; 53 } canHWDescr; 54 58 typedef struct tagCanSWDescr { 59 unsigned int rxBufSize; 60 unsigned int txBufSize; 61 canMemoryAllocator alloc; 62 canMemoryDeallocator deAlloc; 63 } canSWDescr; 64 68 typedef struct { 69 unsigned int size; 70 unsigned int rxBufSize; 71 unsigned int txBufSize; 72 } canSWDescriptorEx; 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 124 #define canCHANNEL_CAP_DIAGNOSTICS 0x10000000L 125 #define canCHANNEL_CAP_CAN_DIAGNOSTICS canCHANNEL_CAP_RESERVED_2 126 #define canCHANNEL_CAP_REMOTE canCHANNEL_CAP_RESERVED_1 127 135 #define canSTICKY_ACK_ERROR 0x80000801 136 #define canSTICKY_FORM_ERROR 0x80000002 137 #define canSTICKY_STUFF_ERROR 0x80000004 138 #define canSTICKY_CRC_ERROR 0x80000008 139 #define canSTICKY_BIT0_ERROR 0x80000010 140 #define canSTICKY_BIT1_ERROR 0x80000020 141 #define canSTICKY_HW_OVERRUN 0x80000040 142 #define canSTICKY_SW_OVERRUN 0x80000080 143 145 #define canSTAT_INACTIVE canSTAT_RESERVED_1 146 147 /* 148 #define canCIRCSTAT_TXERR 0x0001 // TX error has occurred 149 #define canCIRCSTAT_RXERR 0x0002 // Receive error has occurred 150 #define canCIRCSTAT_OVERRUN 0x0004 // Receiver overrun 151 #define canCIRCSTAT_WAKEUP 0x0008 // Wakeup has occurred 152 #define canCIRCSTAT_INT 0x0010 // ?? 153 #define canCIRCSTAT_ACK 0x0020 // ACK error 154 #define canCIRCSTAT_BIT 0x0040 // Bit error 155 */ 156 /* 157 More apocryphs. 158 #define canCIRCSTAT_OVERRUN 0x0004 // Receiver overrun 159 #define canCIRCSTAT_WAKEUP 0x0008 // Wakeup has occurred 160 #define canCIRCSTAT_ACK 0x0010 // ACK error 161 #define canCIRCSTAT_BIT0 0x0020 // Bit error 162 #define canCIRCSTAT_BIT1 0x0040 // Bit error 163 #define canCIRCSTAT_BOFF 0x0080 // Chip went Bus Off 164 */ 165 /* 166 Even more. 167 #define canCIRCSTAT_BOFF_HW 0x10000L // Chip is Bus Off 168 #define canCIRCSTAT_BOFF_SW 0x20000L // We are Bus Off 169 */ 170 171 177 #define canWANT_ACTIONS 0x01 178 #define canWANT_OWN_BUFFERS 0x02 179 #define canWANT_ERROR_COUNTERS 0x04 180 #define canWANT_EXCLUSIVE 0x08 181 #define canWANT_EXTENDED 0x10 182 #define canWANT_VIRTUAL 0x20 183 184 191 // No circuit 0 192 #define PCCAN_PHILIPS 1 193 #define PCCAN_INTEL526 2 194 #define PCCAN_INTEL527 3 195 #define CANCARD_NEC72005 4 196 #define CIRC_VIRTUAL 5 197 #define CIRC_SJA1000 6 198 205 #define canCARD_PCCAN 1 206 #define canCARD_CANCARD 2 207 #define canCARD_AC2 3 208 #define canCARD_LAPCAN 4 209 #define canCARD_ISACAN 5 210 #define canCARD_PCCAN_OEM 6 211 218 #define canFlgACCEPT 1 219 #define canFlgREJECT 2 220 #define canFlgCODE 3 221 #define canFlgMASK 4 222 229 #define canDISCARD_MESSAGE 3 230 #define canRETAIN_MESSAGE 4 231 239 #define canSLOW_MODE 0x01 240 248 #define canOFF 0 249 #define canTRISTATE 1 250 #define canPULLUP 2 251 #define canPULLDOWN 3 252 #define canPUSHPULL 4 253 #define canINVPULLUP 5 254 #define canINVPULLDOWN 6 255 #define canINVPUSHPULL 7 256 264 #define canIOCTL_LOCAL_ECHO_ON 3 265 #define canIOCTL_LOCAL_ECHO_OFF 4 266 267 #define canMSG_STATUS 0x0008 268 270 #ifdef __cplusplus 271 extern "C" { 272 #endif /* __cplusplus */ 273 277 canStatus CANLIBAPI canInstallAction(int handle, long id, int (*fn)()); 278 282 canStatus CANLIBAPI canUninstallAction(int handle, long id); 283 287 canStatus CANLIBAPI canInstallOwnBuffer(int handle, long id, unsigned int len, 288 void * buf); 289 293 canStatus CANLIBAPI canUninstallOwnBuffer(int handle, long id); 294 #ifdef __cplusplus 295 } 296 #endif /* __cplusplus */ 297 298 #endif /* _OBSOLETE_H_ */ 299