Status Bitfields - neoVI API
C/C++ declare -
Remarks - C/C++ example
There are two status bitfields in the message structures that define specific attributes of the message. The two status bitfields are named StatusBitfield and StatusBitfield1.
const long SPY_STATUS_GLOBAL_ERR = 0x01;
const long SPY_STATUS_TX_MSG = 0x02;
const long SPY_STATUS_XTD_FRAME = 0x04;
const long SPY_STATUS_REMOTE_FRAME = 0x08;
const long SPY_STATUS_CRC_ERROR = 0x10;
const long SPY_STATUS_CAN_ERROR_PASSIVE = 0x20;
const long SPY_STATUS_INCOMPLETE_FRAME = 0x40;
const long SPY_STATUS_LOST_ARBITRATION = 0x80;
const long SPY_STATUS_UNDEFINED_ERROR = 0x100;
const long SPY_STATUS_CAN_BUS_OFF = 0x200;
const long SPY_STATUS_CAN_ERROR_WARNING = 0x400;
const long SPY_STATUS_BUS_SHORTED_PLUS = 0x800;
const long SPY_STATUS_BUS_SHORTED_GND = 0x1000;
const long SPY_STATUS_CHECKSUM_ERROR = 0x2000;
const long SPY_STATUS_BAD_MESSAGE_BIT_TIME_ERROR = 0x4000;
const long SPY_STATUS_IFR_DATA = 0x8000;
const long SPY_STATUS_HARDWARE_COMM_ERROR = 0x10000;
const long SPY_STATUS_EXPECTED_LEN_ERROR = 0x20000;
const long SPY_STATUS_INCOMING_NO_MATCH = 0x40000;
const long SPY_STATUS_BREAK = 0x80000;
const long SPY_STATUS_AVSI_REC_OVERFLOW = 0x100000;
const long SPY_STATUS_TEST_TRIGGER = 0x200000;
const long SPY_STATUS_AUDIO_COMMENT = 0x400000;
const long SPY_STATUS_GPS_DATA = 0x800000;
const long SPY_STATUS_ANALOG_DIGITAL_INPUT = 0x1000000;
const long SPY_STATUS_TEXT_COMMENT = 0x2000000;
const long SPY_STATUS_NETWORK_MESSAGE_TYPE = 0x4000000;
const long SPY_STATUS_VSI_TX_UNDERRUN = 0x8000000;
const long SPY_STATUS_VSI_IFR_CRC_Bit = 0x10000000;
const long SPY_STATUS_INIT_MESSAGE = 0x20000000;
const long SPY_STATUS_HIGH_SPEED_MESSAGE = 0x40000000;
// The second status bitfield
const long SPY_STATUS2_HAS_VALUE = 1;
const long SPY_STATUS2_VALUE_IS_BOOLEAN = 2;
const long SPY_STATUS2_HIGH_VOLTAGE = 4;
const long SPY_STATUS2_LONG_MESSAGE = 8;
The tables below describe the bitfields.
Table 1 - StatusBitfield Elements
C/C++ Name | Description |
SPY_STATUS_GLOBAL_ERR | This is set if the message has any other error bits set. |
SPY_STATUS_TX_MSG | This is set if the message was transmitted by this device. |
SPY_STATUS_XTD_FRAME | This is set if the CAN message received or transmitted has an extended (29 bit) identifier. |
SPY_STATUS_REMOTE_FRAME | This is set if the CAN message received or transmitted is a remote frame. |
SPY_STATUS_CRC_ERROR | This is set for J1850 VPW messages which do not have a proper CRC byte. |
SPY_STATUS_CAN_ERROR_PASSIVE | Not used in the neoVI API. |
SPY_STATUS_INCOMPLETE_FRAME | This is set for a J1850 VPW message which is received that ended on a non-byte boundary. |
SPY_STATUS_LOST_ARBITRATION | Not used in the neoVI API. |
SPY_STATUS_UNDEFINED_ERROR | This is an undefined error in the neoVI hardware |
SPY_STATUS_CAN_BUS_OFF | This is set when there is a change in error status of a MCP2510 CAN controller. The bitfield of the error status is stored in data byte 1 of the message structure. A description of this bitfield is included in this topic. |
SPY_STATUS_CAN_ERROR_WARNING | Not used in the neoVI API. |
SPY_STATUS_BUS_SHORTED_PLUS | Not used in the neoVI API. |
SPY_STATUS_BUS_SHORTED_GND | Not used in the neoVI API. |
SPY_STATUS_CHECKSUM_ERROR | Not used in the neoVI API. |
SPY_STATUS_BAD_MESSAGE_BIT_TIME_ERROR | This is set for J1850 VPW messages which do not meet the specified bit times for the SOF or bit signals. |
SPY_STATUS_IFR_DATA | Not used in the neoVI API. |
SPY_STATUS_HARDWARE_COMM_ERROR | Not used in the neoVI API. |
SPY_STATUS_EXPECTED_LEN_ERROR | Not used in the neoVI API. |
SPY_STATUS_INCOMING_NO_MATCH | Not used in the neoVI API. |
SPY_STATUS_BREAK | This is set if the J1850 VPW break symbol has been received or is to be transmitted. |
SPY_STATUS_AVSI_REC_OVERFLOW | Not used in the neoVI API. |
SPY_STATUS_TEST_TRIGGER | Not used in the neoVI API. |
SPY_STATUS_AUDIO_COMMENT | Not used in the neoVI API. |
SPY_STATUS_GPS_DATA | Not used in the neoVI API. |
SPY_STATUS_ANALOG_DIGITAL_INPUT | Not used in the neoVI API. |
SPY_STATUS_TEXT_COMMENT | Not used in the neoVI API. |
SPY_STATUS_NETWORK_MESSAGE_TYPE | This is set for all messages received from a vehicle network. |
SPY_STATUS_VSI_TX_UNDERRUN | Not used in the neoVI API. |
SPY_STATUS_VSI_IFR_CRC_Bit | Not used in the neoVI API. |
SPY_STATUS_INIT_MESSAGE | This is set if the transmitted message should generate the ISO/Keyword2000 initialization waveform. |
SPY_STATUS_HIGH_SPEED_MESSAGE | This is set if the transmitted message is transmitted in high speed mode. |
Table 2 - StatusBitfield2 Elements
C/C++ Name | Description |
SPY_STATUS2_HAS_VALUE | Not used in the neoVI API. |
SPY_STATUS2_VALUE_IS_BOOLEAN | Not used in the neoVI API. |
SPY_STATUS2_HIGH_VOLTAGE | This is set if the transmitted message is transmitted in high voltage wakeup mode. |
SPY_STATUS2_LONG_MESSAGE | Not used in the neoVI API. |
Example
Determining if we there's an error in the message (This is indicated by SPY_STATUS_GLOBAL_ERR bit set)
if (mMsg.StatusBitField & SPY_STATUS_GLOBAL_ERR)
{
// This message has an error in it
}
intrepidcs API Documentation - (C) Copyright 1997-2020 Intrepid Control Systems, Inc. (www.intrepidcs.com) |
Last Updated : Monday, July 13, 2009