| /****************************************************************************** |
| * Copyright (c) 2000-2019 Ericsson Telecom AB |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html |
| * |
| * Contributors: |
| * Michael Josenhans |
| ******************************************************************************/ |
| |
| //Revision R1A |
| |
| module CanError |
| { |
| const integer CAN_ERR_DLC := 8 // dlc for error message frames |
| |
| // error class (mask) in can_id |
| const octetstring CAN_ERR_TX_TIMEOUT := '00000001'O; //TX timeout (by netdevice driver) |
| const octetstring CAN_ERR_LOSTARB := '00000002'O; //lost arbitration / data[0] |
| const octetstring CAN_ERR_CRTL := '00000004'O; //controller problems / data[1] |
| const octetstring CAN_ERR_PROT := '00000008'O; //protocol violations / data[2..3] |
| const octetstring CAN_ERR_TRX := '00000010'O; //transceiver status / data[4] |
| const octetstring CAN_ERR_ACK := '00000020'O; //received no ACK on transmission |
| const octetstring CAN_ERR_BUSOFF := '00000040'O; //bus off |
| const octetstring CAN_ERR_BUSERROR := '00000080'O; //bus error (may flood!) |
| const octetstring CAN_ERR_RESTARTED := '00000100'O; //controller restarted |
| |
| // arbitration lost in bit ... / data[0] |
| const octetstring CAN_ERR_LOSTARB_UNSPEC := '00'O; //unspecified |
| //else bit number in bitstream |
| |
| // error status of CAN-controller / data[1] |
| const octetstring CAN_ERR_CRTL_UNSPEC := '00'O; //unspecified |
| const octetstring CAN_ERR_CRTL_RX_OVERFLOW := '01'O; //RX buffer overflow |
| const octetstring CAN_ERR_CRTL_TX_OVERFLOW := '02'O; //TX buffer overflow |
| const octetstring CAN_ERR_CRTL_RX_WARNING := '04'O; //reached warning level for RX errors |
| const octetstring CAN_ERR_CRTL_TX_WARNING := '08'O; //reached warning level for TX errors |
| const octetstring CAN_ERR_CRTL_RX_PASSIVE := '10'O; //reached error passive status RX |
| const octetstring CAN_ERR_CRTL_TX_PASSIVE := '20'O; //reached error passive status TX |
| //(at least one error counter exceeds |
| //the protocol-defined level of 127) |
| const octetstring CAN_ERR_CRTL_ACTIVE := '40'O; //recovered to error active state |
| |
| // error in CAN protocol (type) / data[2] |
| const octetstring CAN_ERR_PROT_UNSPEC := '00'O; //unspecified |
| const octetstring CAN_ERR_PROT_BIT := '01'O; //single bit error |
| const octetstring CAN_ERR_PROT_FORM := '02'O; //frame format error |
| const octetstring CAN_ERR_PROT_STUFF := '04'O; //bit stuffing error |
| const octetstring CAN_ERR_PROT_BIT0 := '08'O; //unable to send dominant bit |
| const octetstring CAN_ERR_PROT_BIT1 := '10'O; //unable to send recessive bit |
| const octetstring CAN_ERR_PROT_OVERLOAD := '20'O; //bus overload |
| const octetstring CAN_ERR_PROT_ACTIVE := '40'O; //active error announcement |
| const octetstring CAN_ERR_PROT_TX := '80'O; //error occurred on transmission |
| |
| // error in CAN protocol (location) / data[3] |
| const octetstring CAN_ERR_PROT_LOC_UNSPEC := '00'O; //unspecified |
| const octetstring CAN_ERR_PROT_LOC_SOF := '03'O; //start of frame |
| const octetstring CAN_ERR_PROT_LOC_ID28_21 := '02'O; //ID bits 28 - 21 (SFF: 10 - 3) |
| const octetstring CAN_ERR_PROT_LOC_ID20_18 := '06'O; //ID bits 20 - 18 (SFF: 2 - 0 ) |
| const octetstring CAN_ERR_PROT_LOC_SRTR := '04'O; //substitute RTR (SFF: RTR) |
| const octetstring CAN_ERR_PROT_LOC_IDE := '05'O; //identifier extension |
| const octetstring CAN_ERR_PROT_LOC_ID17_13 := '07'O; //ID bits 17-13 |
| const octetstring CAN_ERR_PROT_LOC_ID12_05 := '0F'O; //ID bits 12-5 |
| const octetstring CAN_ERR_PROT_LOC_ID04_00 := '0E'O; //ID bits 4-0 |
| const octetstring CAN_ERR_PROT_LOC_RTR := '0C'O; //RTR |
| const octetstring CAN_ERR_PROT_LOC_RES1 := '0D'O; //reserved bit 1 |
| const octetstring CAN_ERR_PROT_LOC_RES0 := '09'O; //reserved bit 0 |
| const octetstring CAN_ERR_PROT_LOC_DLC := '0B'O; //data length code |
| const octetstring CAN_ERR_PROT_LOC_DATA := '0A'O; //data section |
| const octetstring CAN_ERR_PROT_LOC_CRC_SEQ := '08'O; //CRC sequence |
| const octetstring CAN_ERR_PROT_LOC_CRC_DEL := '18'O; //CRC delimiter |
| const octetstring CAN_ERR_PROT_LOC_ACK := '19'O; //ACK slot |
| const octetstring CAN_ERR_PROT_LOC_ACK_DEL := '1B'O; //ACK delimiter |
| const octetstring CAN_ERR_PROT_LOC_EOF := '1A'O; //end of frame |
| const octetstring CAN_ERR_PROT_LOC_INTERM := '12'O; //intermission |
| |
| // error status of CAN-transceiver / data[4] |
| // CANH CANL |
| const octetstring CAN_ERR_TRX_UNSPEC := '00'O; //0000 0000 |
| const octetstring CAN_ERR_TRX_CANH_NO_WIRE := '04'O; //0000 0100 |
| const octetstring CAN_ERR_TRX_CANH_SHORT_TO_BAT := '05'O; //0000 0101 |
| const octetstring CAN_ERR_TRX_CANH_SHORT_TO_VCC := '06'O; //0000 0110 |
| const octetstring CAN_ERR_TRX_CANH_SHORT_TO_GND := '07'O; //0000 0111 |
| const octetstring CAN_ERR_TRX_CANL_NO_WIRE := '40'O; //0100 0000 |
| const octetstring CAN_ERR_TRX_CANL_SHORT_TO_BAT := '50'O; //0101 0000 |
| const octetstring CAN_ERR_TRX_CANL_SHORT_TO_VCC := '60'O; //0110 0000 |
| const octetstring CAN_ERR_TRX_CANL_SHORT_TO_GND := '70'O; //0111 0000 |
| const octetstring CAN_ERR_TRX_CANL_SHORT_TO_CANH := '80'O; //1000 0000 |
| } |