|
| #define | CAN_ERR_FLAG 0x20000000U /* error message frame, */ |
| | Error infromation, alined with /usr/include/linux/can/error.h. More...
|
| |
| #define | ERRORFRAME_TYPE_INDEX 2; |
| |
| #define | ERRORFRAME_LOCATION_INDEX 3; |
| |
| #define | CAN_ERR_DLC 8 /* dlc for error message frames */ |
| |
| #define | CAN_ERR_TX_TIMEOUT 0x00000001U /* TX timeout (by netdevice driver) */ |
| |
| #define | CAN_ERR_LOSTARB 0x00000002U /* lost arbitration / data[0] */ |
| |
| #define | CAN_ERR_CRTL 0x00000004U /* controller problems / data[1] */ |
| |
| #define | CAN_ERR_PROT 0x00000008U /* protocol violations / data[2..3] */ |
| |
| #define | CAN_ERR_TRX 0x00000010U /* transceiver status / data[4] */ |
| |
| #define | CAN_ERR_ACK 0x00000020U /* received no ACK on transmission */ |
| |
| #define | CAN_ERR_BUSOFF 0x00000040U /* bus off */ |
| |
| #define | CAN_ERR_BUSERROR 0x00000080U /* bus error (may flood!) */ |
| |
| #define | CAN_ERR_RESTARTED 0x00000100U /* controller restarted */ |
| |
| #define | CAN_ERR_CNT 0x00000200U /* TX error counter / data[6] */ |
| |
| #define | CAN_ERR_LOSTARB_UNSPEC 0x00 /* unspecified */ |
| |
| #define | CAN_ERR_CRTL_UNSPEC 0x00 /* unspecified */ |
| |
| #define | CAN_ERR_CRTL_RX_OVERFLOW 0x01 /* RX buffer overflow */ |
| |
| #define | CAN_ERR_CRTL_TX_OVERFLOW 0x02 /* TX buffer overflow */ |
| |
| #define | CAN_ERR_CRTL_RX_WARNING 0x04 /* reached warning level for RX errors */ |
| |
| #define | CAN_ERR_CRTL_TX_WARNING 0x08 /* reached warning level for TX errors */ |
| |
| #define | CAN_ERR_CRTL_RX_PASSIVE 0x10 /* reached error passive status RX */ |
| |
| #define | CAN_ERR_CRTL_TX_PASSIVE 0x20 /* reached error passive status TX */ |
| |
| #define | CAN_ERR_CRTL_ACTIVE 0x40 /* recovered to error active state */ |
| |
| #define | CAN_ERR_PROT_UNSPEC 0x00 /* unspecified */ |
| |
| #define | CAN_ERR_PROT_BIT 0x01 /* single bit error */ |
| |
| #define | CAN_ERR_PROT_FORM 0x02 /* frame format error */ |
| |
| #define | CAN_ERR_PROT_STUFF 0x04 /* bit stuffing error */ |
| |
| #define | CAN_ERR_PROT_BIT0 0x08 /* unable to send dominant bit */ |
| |
| #define | CAN_ERR_PROT_BIT1 0x10 /* unable to send recessive bit */ |
| |
| #define | CAN_ERR_PROT_OVERLOAD 0x20 /* bus overload */ |
| |
| #define | CAN_ERR_PROT_ACTIVE 0x40 /* active error announcement */ |
| |
| #define | CAN_ERR_PROT_TX 0x80 /* error occurred on transmission */ |
| |
| #define | CAN_ERR_PROT_LOC_UNSPEC 0x00 /* unspecified */ |
| |
| #define | CAN_ERR_PROT_LOC_SOF 0x03 /* start of frame */ |
| |
| #define | CAN_ERR_PROT_LOC_ID28_21 0x02 /* ID bits 28 - 21 (SFF: 10 - 3) */ |
| |
| #define | CAN_ERR_PROT_LOC_ID20_18 0x06 /* ID bits 20 - 18 (SFF: 2 - 0 )*/ |
| |
| #define | CAN_ERR_PROT_LOC_SRTR 0x04 /* substitute RTR (SFF: RTR) */ |
| |
| #define | CAN_ERR_PROT_LOC_IDE 0x05 /* identifier extension */ |
| |
| #define | CAN_ERR_PROT_LOC_ID17_13 0x07 /* ID bits 17-13 */ |
| |
| #define | CAN_ERR_PROT_LOC_ID12_05 0x0F /* ID bits 12-5 */ |
| |
| #define | CAN_ERR_PROT_LOC_ID04_00 0x0E /* ID bits 4-0 */ |
| |
| #define | CAN_ERR_PROT_LOC_RTR 0x0C /* RTR */ |
| |
| #define | CAN_ERR_PROT_LOC_RES1 0x0D /* reserved bit 1 */ |
| |
| #define | CAN_ERR_PROT_LOC_RES0 0x09 /* reserved bit 0 */ |
| |
| #define | CAN_ERR_PROT_LOC_DLC 0x0B /* data length code */ |
| |
| #define | CAN_ERR_PROT_LOC_DATA 0x0A /* data section */ |
| |
| #define | CAN_ERR_PROT_LOC_CRC_SEQ 0x08 /* CRC sequence */ |
| |
| #define | CAN_ERR_PROT_LOC_CRC_DEL 0x18 /* CRC delimiter */ |
| |
| #define | CAN_ERR_PROT_LOC_ACK 0x19 /* ACK slot */ |
| |
| #define | CAN_ERR_PROT_LOC_ACK_DEL 0x1B /* ACK delimiter */ |
| |
| #define | CAN_ERR_PROT_LOC_EOF 0x1A /* end of frame */ |
| |
| #define | CAN_ERR_PROT_LOC_INTERM 0x12 /* intermission */ |
| |
| #define | CAN_ERR_TRX_UNSPEC 0x00 /* 0000 0000 */ |
| |
| #define | CAN_ERR_TRX_CANH_NO_WIRE 0x04 /* 0000 0100 */ |
| |
| #define | CAN_ERR_TRX_CANH_SHORT_TO_BAT 0x05 /* 0000 0101 */ |
| |
| #define | CAN_ERR_TRX_CANH_SHORT_TO_VCC 0x06 /* 0000 0110 */ |
| |
| #define | CAN_ERR_TRX_CANH_SHORT_TO_GND 0x07 /* 0000 0111 */ |
| |
| #define | CAN_ERR_TRX_CANL_NO_WIRE 0x40 /* 0100 0000 */ |
| |
| #define | CAN_ERR_TRX_CANL_SHORT_TO_BAT 0x50 /* 0101 0000 */ |
| |
| #define | CAN_ERR_TRX_CANL_SHORT_TO_VCC 0x60 /* 0110 0000 */ |
| |
| #define | CAN_ERR_TRX_CANL_SHORT_TO_GND 0x70 /* 0111 0000 */ |
| |
| #define | CAN_ERR_TRX_CANL_SHORT_TO_CANH 0x80 /* 1000 0000 */ |
| |
| #define | canMSG_RESERVED_FOR_EXTENDING 0x80000000 |
| | Reserved future use, tell user that there are more flags. More...
|
| |
| #define | canTRANSCEIVER_RESNET_NA 0 |
| |
| #define | canTRANSCEIVER_RESNET_MASTER 1 |
| |
| #define | canTRANSCEIVER_RESNET_MASTER_STBY 2 |
| |
| #define | canTRANSCEIVER_RESNET_SLAVE 3 |
| |
|
| #define | CANSTATUS_SUCCESS(X) ((X) == canOK) |
| |
| #define | CANSTATUS_FAILURE(X) ((X) != canOK) |
| |
|
Appears in the notification WM__CANLIB message.
|
| #define | canEVENT_RX 32000 |
| | when the queue of received CAN messages goes from empty to non-empty More...
|
| |
| #define | canEVENT_TX 32001 |
| | when a CAN message has been transmitted More...
|
| |
| #define | canEVENT_ERROR 32002 |
| | when a CAN bus error is reported by the CAN controller More...
|
| |
| #define | canEVENT_STATUS 32003 |
| | when the CAN controller changes state More...
|
| |
| #define | canEVENT_ENVVAR 32004 |
| |
| #define | canEVENT_BUSONOFF 32005 |
| | Bus on/off status changed. More...
|
| |
| #define | canEVENT_REMOVED 32006 |
| | Device removed. More...
|
| |
|
These are notification codes used in calls to canSetNotify() and kvSetNotifyCallback().
This can be canNOTIFY_NONE (zero), meaning that no event notification is to occur, or a combination of any of the following constants
|
| #define | canNOTIFY_NONE 0 |
| | Turn notifications off. More...
|
| |
| #define | canNOTIFY_RX 0x0001 |
| | CAN message reception notification. More...
|
| |
| #define | canNOTIFY_TX 0x0002 |
| | CAN message transmission notification. More...
|
| |
| #define | canNOTIFY_ERROR 0x0004 |
| | CAN bus error notification. More...
|
| |
| #define | canNOTIFY_STATUS 0x0008 |
| | CAN chip status change. More...
|
| |
| #define | canNOTIFY_ENVVAR 0x0010 |
| | An environment variable was changed by a script. Note that you will not be notified when an environment variable is updated from the Canlib API. More...
|
| |
| #define | canNOTIFY_BUSONOFF 0x0020 |
| | Notify on bus on/off status changed. More...
|
| |
| #define | canNOTIFY_REMOVED 0x0040 |
| | Notify on device removed. More...
|
| |
|
The following circuit status flags are returned by canReadStatus(). Note that more than one flag might be set at any one time.
- Note
- Usually both canSTAT_HW_OVERRUN and canSTAT_SW_OVERRUN are set when overrun has occurred. This is because the kernel driver can't see the difference between a software overrun and a hardware overrun. So the code should always test for both types of overrun using the flag.
|
| #define | canSTAT_ERROR_PASSIVE 0x00000001 |
| | The circuit is error passive. More...
|
| |
| #define | canSTAT_BUS_OFF 0x00000002 |
| | The circuit is Off Bus. More...
|
| |
| #define | canSTAT_ERROR_WARNING 0x00000004 |
| | At least one error counter > 96. More...
|
| |
| #define | canSTAT_ERROR_ACTIVE 0x00000008 |
| | The circuit is error active. More...
|
| |
| #define | canSTAT_TX_PENDING 0x00000010 |
| | There are messages pending transmission. More...
|
| |
| #define | canSTAT_RX_PENDING 0x00000020 |
| | There are messages in the receive buffer. More...
|
| |
| #define | canSTAT_RESERVED_1 0x00000040 |
| | The circuit is error passive. More...
|
| |
| #define | canSTAT_TXERR 0x00000080 |
| | There has been at least one TX error. More...
|
| |
| #define | canSTAT_RXERR 0x00000100 |
| | There has been at least one RX error of some sort. More...
|
| |
| #define | canSTAT_HW_OVERRUN 0x00000200 |
| | There has been at least one HW buffer overflow. More...
|
| |
| #define | canSTAT_SW_OVERRUN 0x00000400 |
| | There has been at least one SW buffer overflow. More...
|
| |
| #define | canSTAT_OVERRUN (canSTAT_HW_OVERRUN | canSTAT_SW_OVERRUN) |
| | For convenience. More...
|
| |
|
The following flags can be returned from canRead() et al, or passed to canWrite().
All flags and/or combinations of them are meaningful for received messages.
canMSG_RTR, canMSG_STD, canMSG_EXT, canMSG_WAKEUP and canMSG_ERROR_FRAME are meaningful also for transmitted messages. canMSG_SINGLE_SHOT is only for transmission.
Note that canMSG_RTR cannot be set for CAN FD messages.
|
| #define | canMSG_MASK 0x00ff |
| | Used to mask the non-info bits. More...
|
| |
| #define | canMSG_RTR 0x0001 |
| | Message is a remote request. More...
|
| |
| #define | canMSG_STD 0x0002 |
| | Message has a standard (11-bit) identifier. More...
|
| |
| #define | canMSG_EXT 0x0004 |
| | Message has an extended (29-bit) identifier. More...
|
| |
| #define | canMSG_WAKEUP 0x0008 |
| | Message is a WAKEUP message (SWC hardware.) More...
|
| |
| #define | canMSG_NERR 0x0010 |
| | NERR was active during the message (TJA1054 hardware) More...
|
| |
| #define | canMSG_ERROR_FRAME 0x0020 |
| | Message represents an error frame. More...
|
| |
| #define | canMSG_TXACK 0x0040 |
| | Message is a TX ACK (msg has really been sent) More...
|
| |
| #define | canMSG_TXRQ 0x0080 |
| | Message is a TX REQUEST (msg was transfered to the chip) More...
|
| |
| #define | canMSG_DELAY_MSG 0x0100 |
| | Message is NOT sent on the bus. The transmission of messages are delayed. The dlc specifies the delay in milliseconds (1..1000). More...
|
| |
| #define | canMSG_LOCAL_TXACK 0x10000000 |
| | Message was sent from another handle on the same can channel. More...
|
| |
| #define | canMSG_SINGLE_SHOT 0x1000000 |
| | Message is Single Shot, try to send once, no retransmission. This flag can only be used with transmitted messages. More...
|
| |
| #define | canMSG_TXNACK 0x2000000 |
| | Message is a failed Single Shot, message was not sent. This flag is only used with received messages. More...
|
| |
| #define | canMSG_ABL 0x4000000 |
| | Only together with canMSG_TXNACK, Single shot message was not sent because arbitration was lost. This flag is only used with received messages. More...
|
| |
|
Flags used in the CAN FD protocol. Set canOPEN_CAN_FD in canOpenChannel() to enable the CAN FD protocol.
|
| #define | canFDMSG_MASK 0xff0000 |
| | Obsolete, use canFDMSG_FDF instead. More...
|
| |
| #define | canFDMSG_EDL 0x010000 |
| | Obsolete, use canFDMSG_FDF instead. More...
|
| |
| #define | canFDMSG_FDF 0x010000 |
| | Message is an FD message (CAN FD) More...
|
| |
| #define | canFDMSG_BRS 0x020000 |
| | Message is sent/received with bit rate switch (CAN FD) More...
|
| |
| #define | canFDMSG_ESI 0x040000 |
| | Sender of the message is in error passive mode (CAN FD) More...
|
| |
|
- Note
- Not all hardware platforms can detect the difference between hardware overruns and software overruns, so your application should test for both conditions. You can use the symbol canMSGERR_OVERRUN for this purpose.
|
| #define | canMSGERR_MASK 0xff00 |
| | Used to mask the non-error bits. More...
|
| |
| #define | canMSGERR_HW_OVERRUN 0x0200 |
| | HW buffer overrun. More...
|
| |
| #define | canMSGERR_SW_OVERRUN 0x0400 |
| | SW buffer overrun. More...
|
| |
| #define | canMSGERR_STUFF 0x0800 |
| | Stuff error. More...
|
| |
| #define | canMSGERR_FORM 0x1000 |
| | Form error. More...
|
| |
| #define | canMSGERR_CRC 0x2000 |
| | CRC error. More...
|
| |
| #define | canMSGERR_BIT0 0x4000 |
| | Sent dom, read rec. More...
|
| |
| #define | canMSGERR_BIT1 0x8000 |
| | Sent rec, read dom. More...
|
| |
| #define | canMSGERR_OVERRUN 0x0600 |
| | Any overrun condition. More...
|
| |
| #define | canMSGERR_BIT 0xC000 |
| | Any bit error. More...
|
| |
| #define | canMSGERR_BUSERR 0xF800 |
| | Any RX error. More...
|
| |
|
The following values can be used with canSetDriverMode() to set different driver (i.e. transceiver) modes. Use canGetDriverMode() to obtain the current driver mode for a particular CAN channel.
- Note
- Not implemented in Linux.
|
| #define | canTRANSCEIVER_LINEMODE_NA 0 |
| | Not Affected/Not available. More...
|
| |
| #define | canTRANSCEIVER_LINEMODE_SWC_SLEEP 4 |
| | SWC Sleep Mode. More...
|
| |
| #define | canTRANSCEIVER_LINEMODE_SWC_NORMAL 5 |
| | SWC Normal Mode. More...
|
| |
| #define | canTRANSCEIVER_LINEMODE_SWC_FAST 6 |
| | SWC High-Speed Mode. More...
|
| |
| #define | canTRANSCEIVER_LINEMODE_SWC_WAKEUP 7 |
| | SWC Wakeup Mode. More...
|
| |
| #define | canTRANSCEIVER_LINEMODE_SLEEP 8 |
| | Sleep mode for those supporting it. More...
|
| |
| #define | canTRANSCEIVER_LINEMODE_NORMAL 9 |
| | Normal mode (the inverse of sleep mode) for those supporting it. More...
|
| |
| #define | canTRANSCEIVER_LINEMODE_STDBY 10 |
| | Standby for those who support it. More...
|
| |
| #define | canTRANSCEIVER_LINEMODE_TT_CAN_H 11 |
| | Truck & Trailer: operating mode single wire using CAN high. More...
|
| |
| #define | canTRANSCEIVER_LINEMODE_TT_CAN_L 12 |
| | Truck & Trailer: operating mode single wire using CAN low. More...
|
| |
| #define | canTRANSCEIVER_LINEMODE_OEM1 13 |
| | Reserved for OEM apps. More...
|
| |
| #define | canTRANSCEIVER_LINEMODE_OEM2 14 |
| | Reserved for OEM apps. More...
|
| |
| #define | canTRANSCEIVER_LINEMODE_OEM3 15 |
| | Reserved for OEM apps. More...
|
| |
| #define | canTRANSCEIVER_LINEMODE_OEM4 16 |
| | Reserved for OEM apps. More...
|
| |
|
The following constants can be returned from canGetChannelData(), using the canCHANNELDATA_TRANS_TYPE item code. They identify the bus transceiver type for the channel specified in the call to canGetChannelData.
- Note
- They indicate a hardware type, but not necessarily a specific circuit or product.
|
| #define | canTRANSCEIVER_TYPE_UNKNOWN 0 |
| | Unknown or undefined. More...
|
| |
| #define | canTRANSCEIVER_TYPE_251 1 |
| | 82c251 More...
|
| |
| #define | canTRANSCEIVER_TYPE_252 2 |
| | 82c252, TJA1053, TJA1054 More...
|
| |
| #define | canTRANSCEIVER_TYPE_DNOPTO 3 |
| | Optoisolated 82C251. More...
|
| |
| #define | canTRANSCEIVER_TYPE_W210 4 |
| | Unknown or undefined. More...
|
| |
| #define | canTRANSCEIVER_TYPE_SWC_PROTO 5 |
| | AU5790 prototype. More...
|
| |
| #define | canTRANSCEIVER_TYPE_SWC 6 |
| | AU5790. More...
|
| |
| #define | canTRANSCEIVER_TYPE_EVA 7 |
| | Unknown or undefined. More...
|
| |
| #define | canTRANSCEIVER_TYPE_FIBER 8 |
| | 82c251 with fibre extension More...
|
| |
| #define | canTRANSCEIVER_TYPE_K251 9 |
| | K-line + 82c251. More...
|
| |
| #define | canTRANSCEIVER_TYPE_K 10 |
| | K-line, without CAN. More...
|
| |
| #define | canTRANSCEIVER_TYPE_1054_OPTO 11 |
| | TJA1054 with optical isolation. More...
|
| |
| #define | canTRANSCEIVER_TYPE_SWC_OPTO 12 |
| | AU5790 with optical isolation. More...
|
| |
| #define | canTRANSCEIVER_TYPE_TT 13 |
| | B10011S Truck-And-Trailer. More...
|
| |
| #define | canTRANSCEIVER_TYPE_1050 14 |
| | TJA1050. More...
|
| |
| #define | canTRANSCEIVER_TYPE_1050_OPTO 15 |
| | TJA1050 with optical isolation. More...
|
| |
| #define | canTRANSCEIVER_TYPE_1041 16 |
| | TJA1041. More...
|
| |
| #define | canTRANSCEIVER_TYPE_1041_OPTO 17 |
| | TJA1041 with optical isolation. More...
|
| |
| #define | canTRANSCEIVER_TYPE_RS485 18 |
| | RS485 (i.e. J1708) More...
|
| |
| #define | canTRANSCEIVER_TYPE_LIN 19 |
| | LIN. More...
|
| |
| #define | canTRANSCEIVER_TYPE_KONE 20 |
| | KONE. More...
|
| |
| #define | canTRANSCEIVER_TYPE_CANFD 22 |
| | CAN-FD. More...
|
| |
| #define | canTRANSCEIVER_TYPE_CANFD_LIN 24 |
| | HYBRID CAN-FD/LIN. More...
|
| |
| #define | canTRANSCEIVER_TYPE_CANFD_SIC 26 |
| | CAN-FD SIC transceiver. More...
|
| |
| #define | canTRANSCEIVER_TYPE_LINX_LIN 64 |
| | Unknown or undefined. More...
|
| |
| #define | canTRANSCEIVER_TYPE_LINX_J1708 66 |
| | Unknown or undefined. More...
|
| |
| #define | canTRANSCEIVER_TYPE_LINX_K 68 |
| | Unknown or undefined. More...
|
| |
| #define | canTRANSCEIVER_TYPE_LINX_SWC 70 |
| | Unknown or undefined. More...
|
| |
| #define | canTRANSCEIVER_TYPE_LINX_LS 72 |
| | Unknown or undefined. More...
|
| |