forked from xuos/xiuos
Add nuttx to the system framework, which is 10.1.0
This commit is contained in:
@@ -0,0 +1,190 @@
|
||||
/****************************************************************************
|
||||
* apps/include/canutils/canlib.h
|
||||
* Various non-standard APIs to support canutils. All non-standard and
|
||||
* intended only for internal use.
|
||||
*
|
||||
* Copyright (C) 2016 Sebastien Lorquet Nutt. All rights reserved.
|
||||
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials provided
|
||||
* with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote
|
||||
* products derived from this software without specific prior
|
||||
* written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
||||
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __APPS_INCLUDE_CANUTILS_CANLIB_H
|
||||
#define __APPS_INCLUDE_CANUTILS_CANLIB_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: canlib_setbaud
|
||||
*
|
||||
* Description:
|
||||
* Wrapper for CANIOC_SET_BITTIMING
|
||||
*
|
||||
* Input Parameter:
|
||||
* fd - file descriptor of an opened can device
|
||||
* baud - baud rate to use on the CAN bus
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success. Otherwise -1 (ERROR)
|
||||
* is returned with the errno variable set to indicate the
|
||||
* nature of the error.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int canlib_setbaud(int fd, int bauds);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: canlib_getbaud
|
||||
*
|
||||
* Description:
|
||||
* Wrapper for CANIOC_GET_BITTIMING
|
||||
*
|
||||
* Input Parameter:
|
||||
* fd - file descriptor of an opened can device
|
||||
* baud - pointer to a buffer to store the current baud rate
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success. Otherwise -1 (ERROR)
|
||||
* is returned with the errno variable set to indicate the
|
||||
* nature of the error.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int canlib_getbaud(int fd, FAR int *bauds);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: canlib_setloopback
|
||||
*
|
||||
* Description:
|
||||
* Wrapper for CANIOC_SET_CONNMODES. When loopback mode is enabled, the CAN
|
||||
* peripheral transmits on the bus, but only receives its own sent messages.
|
||||
*
|
||||
* Input Parameter:
|
||||
* fd - file descriptor of an opened can device
|
||||
* loopback - whether to use loopback mode.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success. Otherwise -1 (ERROR)
|
||||
* is returned with the errno variable set to indicate the
|
||||
* nature of the error.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: canlib_getloopback
|
||||
*
|
||||
* Description:
|
||||
* Wrapper for CANIOC_GET_CONNMODES.
|
||||
*
|
||||
* Input Parameter:
|
||||
* fd - file descriptor of an opened can device
|
||||
* loopback - pointer to a buffer to store the current loopback mode state.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success. Otherwise -1 (ERROR)
|
||||
* is returned with the errno variable set to indicate the
|
||||
* nature of the error.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int canlib_setloopback(int fd, bool loop);
|
||||
|
||||
int canlib_getloopback(int fd, FAR bool *loop);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: canlib_setsilent
|
||||
*
|
||||
* Description:
|
||||
* Wrapper for CANIOC_SET_CONNMODES. When silent mode is enabled, the CAN
|
||||
* peripheral never transmits on the bus, but receives all bus traffic.
|
||||
*
|
||||
* Input Parameter:
|
||||
* fd - file descriptor of an opened can device
|
||||
* loopback - whether to use loopback mode.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success. Otherwise -1 (ERROR)
|
||||
* is returned with the errno variable set to indicate the
|
||||
* nature of the error.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int canlib_setsilent(int fd, bool silent);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: canlib_getsilent
|
||||
*
|
||||
* Description:
|
||||
* Wrapper for CANIOC_GET_CONNMODES.
|
||||
*
|
||||
* Input Parameter:
|
||||
* fd - file descriptor of an opened can device
|
||||
* loopback - pointer to a buffer to store the current silent mode state.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success. Otherwise -1 (ERROR)
|
||||
* is returned with the errno variable set to indicate the
|
||||
* nature of the error.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int canlib_getsilent(int fd, FAR bool *silent);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __APPS_INCLUDE_CANUTILS_CANLIB_H */
|
||||
@@ -0,0 +1,132 @@
|
||||
/****************************************************************************
|
||||
* include/canutils/obd.h
|
||||
*
|
||||
* Copyright (C) 2017 Alan Carvalho de Assis. All rights reserved.
|
||||
* Author: Alan Carvalho de Assis <acassis@gmail.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __APPS_INCLUDE_CANUTILS_OBD_H
|
||||
#define __APPS_INCLUDE_CANUTILS_OBD_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/can/can.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/* CAN Modes */
|
||||
|
||||
enum
|
||||
{
|
||||
CAN_STD = 0,
|
||||
CAN_EXT,
|
||||
};
|
||||
|
||||
/* OBD-II structure */
|
||||
|
||||
struct obd_dev_s
|
||||
{
|
||||
struct can_msg_s can_txmsg; /* TX Message */
|
||||
struct can_msg_s can_rxmsg; /* RX Message */
|
||||
struct canioc_bittiming_s can_bt; /* Current bitrate */
|
||||
uint8_t can_mode; /* Current mode (Standard or Extended) */
|
||||
int can_fd; /* File Descriptor of CAN Device */
|
||||
#ifdef CONFIG_MULTIFRAME_SUPPORT
|
||||
uint8_t data[4096]; /* Up to 4096 bytes */
|
||||
#else
|
||||
uint8_t data[8]; /* Single Frame = 8 bytes */
|
||||
#endif
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Name: obd_init
|
||||
*
|
||||
* Description:
|
||||
* Initialize the OBD-II with initial baudrate
|
||||
*
|
||||
* Returns a obd_dev_s with initial values or NULL if error.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct obd_dev_s *obd_init(FAR char *devfile, int baudate, int mode);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: obd_sent_request
|
||||
*
|
||||
* Description:
|
||||
* Send a "Request Message" to ECUs with requested PID.
|
||||
*
|
||||
* It will return an error case the message fails to be sent.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int obd_send_request(FAR struct obd_dev_s *dev, uint8_t opmode, uint8_t pid);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: obd_wait_response
|
||||
*
|
||||
* Description:
|
||||
* Wait for a message from ECUs with requested PID that was sent using
|
||||
* obd_send_request().
|
||||
*
|
||||
* It will return an error case it doesn't receive the msg after the elapsed
|
||||
* "timeout" time.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int obd_wait_response(FAR struct obd_dev_s *dev, uint8_t opmode, uint8_t pid,
|
||||
int timeout);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: obd_decode_pid
|
||||
*
|
||||
* Description:
|
||||
* Decode the value returned for a determined PID.
|
||||
*
|
||||
* It will return the decode PID as string or NULL if error.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR char *obd_decode_pid(FAR struct obd_dev_s *dev, uint8_t pid);
|
||||
|
||||
#endif /*__APPS_INCLUDE_CANUTILS_OBD_H */
|
||||
@@ -0,0 +1,73 @@
|
||||
/****************************************************************************
|
||||
* include/canutils/obd_frame.h
|
||||
*
|
||||
* Copyright (C) 2017 Alan Carvalho de Assis. All rights reserved.
|
||||
* Author: Alan Carvalho de Assis <acassis@gmail.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __APPS_INCLUDE_CANUTILS_OBD_FRAME_H
|
||||
#define __APPS_INCLUDE_CANUTILS_OBD_FRAME_H
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Frame Type
|
||||
*
|
||||
* Bits 7-4 of CAN Data 0
|
||||
*
|
||||
*/
|
||||
|
||||
#define OBD_FRAME_TYPE(x) (x & 0xf0) /* Mask bits 4-7 */
|
||||
|
||||
#define OBD_SINGLE_FRAME (0 << 4) /* Single frame */
|
||||
#define OBD_FIRST_FRAME (1 << 4) /* First frame */
|
||||
#define OBD_CONSEC_FRAME (2 << 4) /* Consecutive frame */
|
||||
#define OBD_FLWCTRL_FRAME (3 << 4) /* Flow control frame */
|
||||
|
||||
/* Single Frame fields */
|
||||
|
||||
#define OBD_SF_DATA_LEN(x) (x & 0xf) /* Data Length of Single Frame */
|
||||
|
||||
/* First Frame fields */
|
||||
|
||||
#define OBD_FF_DATA_LEN_D0(x) ((x & 0xf) << 8) /* Data Length of First Frame D0 */
|
||||
#define OBD_FF_DATA_LEN_D1(x) (x & 0xff) /* Data Length of First Frame D1 */
|
||||
|
||||
/* Consecutive Frame fields */
|
||||
|
||||
#define OBD_CF_SEQ_NUM(x) (x & 0xf) /* Consecutive Sequence Number */
|
||||
|
||||
/* Flow Control Frame fields */
|
||||
|
||||
#define OBD_FC_FLOW_STATUS(x) (x & 0xf) /* Flow Control Status */
|
||||
|
||||
#endif /* __APPS_INCLUDE_CANUTILS_OBD_FRAME_H */
|
||||
@@ -0,0 +1,138 @@
|
||||
/****************************************************************************
|
||||
* include/canutils/obd_pid.h
|
||||
*
|
||||
* Copyright (C) 2017 Alan Carvalho de Assis. All rights reserved.
|
||||
* Author: Alan Carvalho de Assis <acassis@gmail.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __APPS_INCLUDE_CANUTILS_OBD_PID_H
|
||||
#define __APPS_INCLUDE_CANUTILS_OBD_PID_H
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* PID REQUEST */
|
||||
|
||||
#define OBD_PID_STD_REQUEST 0x7df /* Standard PID REQUEST Message ID = 0x7df or 0x7e0 */
|
||||
#define OBD_PID_EXT_REQUEST 0x18db33f1 /* Extended PID REQUEST Messaged ID = 0x18db33f1 */
|
||||
|
||||
/* PID RESPONSE */
|
||||
|
||||
#define OBD_PID_STD_RESPONSE 0x7e8 /* Standard PID RESPONSE Message ID = 0x7e8 */
|
||||
#define OBD_PID_EXT_RESPONSE 0x18daf110 /* Extended PID RESPONSE Message ID = 0x18daf111 or 0x18daf11d */
|
||||
|
||||
#define OBD_RESP_BASE 0x40 /* Response mode = (0x40 + OpMode) */
|
||||
|
||||
/* OBD Operation Modes */
|
||||
|
||||
#define OBD_SHOW_DATA 0x01 /* Used to read current data from vehicle */
|
||||
#define OBD_SHOW_FREEZED_DATA 0x02 /* Used to read freezed data from vehicle */
|
||||
#define OBD_SHOW_DTC 0x03 /* Show Diagnostic Trouble Codes */
|
||||
#define OBD_CLEAR_DTC 0x04 /* Clear Diagnostic Trouble Codes stored in the vehicle */
|
||||
#define OBD_TEST_RESULT1 0x05 /* Test Results */
|
||||
#define OBD_TEST_RESULT2 0x06 /* Test Results */
|
||||
#define OBD_SHOW_PEND_DTC 0x07 /* Show Pending Diagnostic Trouble Codes */
|
||||
#define OBD_CONTROL_OPERATION 0x08 /* Control Operation of on-board component/system */
|
||||
#define OBD_RQST_VEHICLE_INFO 0x09 /* Request vehicle information */
|
||||
#define OBD_PERMANENT_DTC 0x0a /* Permanent Diagnostic Trouble Codes */
|
||||
|
||||
/* Basic Standardized Sensor/Status */
|
||||
|
||||
#define OBD_PID_SUPPORTED 0x00 /* PIDs supported 00-20 */
|
||||
#define OBD_PID_STATUS 0x01 /* Monitor status since DTCs cleared */
|
||||
#define OBD_PID_STATUS_FREEZE_FRAME 0x02 /* DTC that caused required freeze frame data storage */
|
||||
#define OBD_PID_FUEL_SYSTEM 0x03 /* Fuel system 1 and 2 status */
|
||||
#define OBD_PID_ENGINE_LOAD 0x04 /* Calculated ENGINE LOAD Value */
|
||||
#define OBD_PID_ENGINE_TEMPERATURE 0x05 /* Engine Coolant Temperature */
|
||||
#define OBD_PID_SHORT_TERM_FUEL_TRIM13 0x06 /* Short Term Fuel Trim - Bank 1,3 */
|
||||
#define OBD_PID_LONG_TERM_FUEL_TRIM13 0x07 /* Long Term Fuel Trim - Bank 1,3 */
|
||||
#define OBD_PID_SHORT_TERM_FUEL_TRIM24 0x08 /* Short Term Fuel Trim - Bank 2,4 */
|
||||
#define OBD_PID_LONG_TERM_FUEL_TRIM24 0x09 /* Long Term Fuel Trim - Bank 2,4 */
|
||||
#define OBD_PID_FUEL_RAIL_PRESSURE 0x0a /* Fuel Rail Pressure (gauge) */
|
||||
#define OBD_PID_MANIFOLD_ABS_PRESSURE 0x0b /* Intake Manifold Absolute Pressure (kPa) */
|
||||
#define OBD_PID_RPM 0x0c /* Engine RPM */
|
||||
#define OBD_PID_SPEED 0x0d /* Vehicle Speed Sensor */
|
||||
#define OBD_PID_SPARK_ADVANCE 0x0e /* Ignition Timing Advance for #1 Cylinder */
|
||||
#define OBD_PID_INTAKE_AIR_TEMPERATURE 0x0f /* Intake Air Temperature */
|
||||
#define OBD_PID_MASS_AIR_FLOW 0x10 /* Air Flow Rate from Mass Air Flow Sensor */
|
||||
#define OBD_PID_THROTTLE_POSITION 0x11 /* Absolute Throttle Position (0-100%) */
|
||||
#define OBD_PID_AIR_STATUS 0x12 /* Commanded Secondary Air Status (Bit Encoded) */
|
||||
#define OBD_PID_LOC_OXYGEN_SENSOR 0x13 /* Location of Oxygen Sensors (Bit Encoded) */
|
||||
#define OBD_PID_OXYGEN_BANK1_SENSOR1 0x14 /* Bank 1 - Sensor 1 Oxygen Sensor Output Voltage / Short Term Fuel Trim (V) */
|
||||
#define OBD_PID_OXYGEN_BANK1_SENSOR2 0x15 /* Bank 1 - Sensor 2 Oxygen Sensor Output Voltage / Short Term Fuel Trim (V) */
|
||||
#define OBD_PID_OXYGEN_BANK1_SENSOR3 0x16 /* Bank 1 - Sensor 3 Oxygen Sensor Output Voltage / Short Term Fuel Trim (V) */
|
||||
#define OBD_PID_OXYGEN_BANK1_SENSOR4 0x17 /* Bank 1 - Sensor 4 Oxygen Sensor Output Voltage / Short Term Fuel Trim (V) */
|
||||
#define OBD_PID_OXYGEN_BANK2_SENSOR1 0x18 /* Bank 2 - Sensor 1 Oxygen Sensor Output Voltage / Short Term Fuel Trim (V) */
|
||||
#define OBD_PID_OXYGEN_BANK2_SENSOR2 0x19 /* Bank 2 - Sensor 2 Oxygen Sensor Output Voltage / Short Term Fuel Trim (V) */
|
||||
#define OBD_PID_OXYGEN_BANK2_SENSOR3 0x1a /* Bank 2 - Sensor 3 Oxygen Sensor Output Voltage / Short Term Fuel Trim (V) */
|
||||
#define OBD_PID_OXYGEN_BANK2_SENSOR4 0x1b /* Bank 2 - Sensor 4 Oxygen Sensor Output Voltage / Short Term Fuel Trim (V) */
|
||||
#define OBD_PID_STANDARD_COMPLIANCE 0x1c /* OBD standards this vehicle conforms to */
|
||||
#define OBD_PID_OXYGEN_SENSORS 0x1d /* Oxygen sensors present */
|
||||
#define OBD_PID_AUXILIARY_INPUT_STATUS 0x1e /* Auxiliary input status */
|
||||
#define OBD_PID_RUNTIME_ENGINE_START 0x1f /* Run time since engine start */
|
||||
|
||||
/* Extended Standardized Sensor_Status */
|
||||
|
||||
#define OBD_PID_SUPPORTED_EXT 0x20 /* PIDs supported 21-40 */
|
||||
#define OBD_PID_DIST_TRAVELED_MIL 0x21 /* Distance traveled with malfunction indicator lamp (MIL) on */
|
||||
#define OBD_PID_FUEL_RAIL_PRESS_VACUUM 0x22 /* Fuel Rail Pressure (relative to manifold vacuum) */
|
||||
#define OBD_PID_FUEL_RAIL_PRESS_DIR_INJ 0x23 /* Fuel Rail Pressure (diesel, or gasoline direct inject) */
|
||||
#define OBD_PID_O2S1_WR_LAMBDA_ERV 0x24 /* O2S1_WR_lambda(1): Equivalence Ratio Voltage */
|
||||
#define OBD_PID_O2S2_WR_LAMBDA_ERV 0x25 /* O2S2_WR_lambda(1): Equivalence Ratio Voltage */
|
||||
#define OBD_PID_O2S3_WR_LAMBDA_ERV 0x26 /* O2S3_WR_lambda(1): Equivalence Ratio Voltage */
|
||||
#define OBD_PID_O2S4_WR_LAMBDA_ERV 0x27 /* O2S4_WR_lambda(1): Equivalence Ratio Voltage */
|
||||
#define OBD_PID_O2S5_WR_LAMBDA_ERV 0x28 /* O2S5_WR_lambda(1): Equivalence Ratio Voltage */
|
||||
#define OBD_PID_O2S6_WR_LAMBDA_ERV 0x29 /* O2S6_WR_lambda(1): Equivalence Ratio Voltage */
|
||||
#define OBD_PID_O2S7_WR_LAMBDA_ERV 0x2a /* O2S7_WR_lambda(1): Equivalence Ratio Voltage */
|
||||
#define OBD_PID_O2S8_WR_LAMBDA_ERV 0x2b /* O2S8_WR_lambda(1): Equivalence Ratio Voltage */
|
||||
#define OBD_PID_COMMANDED_EGR 0x2c /* Commanded EGR */
|
||||
#define OBD_PID_EGR_ERROR 0x2d /* EGR Error */
|
||||
#define OBD_PID_CMD_EVAPORAT_PURGE 0x2e /* Commanded evaporative purge */
|
||||
#define OBD_PID_FUEL_LEVEL_INPUT 0x2f /* Fuel Level Input */
|
||||
#define OBD_PID_WARMUP_CODES_CLEARED 0x30 /* Number of warm-ups since codes cleared */
|
||||
#define OBD_PID_DIST_TRAV_CODES_CLEAR 0x31 /* Distance traveled since codes cleared */
|
||||
#define OBD_PID_EVAP_SYS_VAPOR_PRESS 0x32 /* Evap. System Vapor Pressure */
|
||||
#define OBD_PID_BAROMETRIC_PRESSURE 0x33 /* Barometric pressure */
|
||||
#define OBD_PID_O2S1_WR_LAMBDA_ERC 0x34 /* O2S1_WR_lambda(1): Equivalence Ratio Current */
|
||||
#define OBD_PID_O2S2_WR_LAMBDA_ERC 0x35 /* O2S1_WR_lambda(1): Equivalence Ratio Current */
|
||||
#define OBD_PID_O2S3_WR_LAMBDA_ERC 0x36 /* O2S1_WR_lambda(1): Equivalence Ratio Current */
|
||||
#define OBD_PID_O2S4_WR_LAMBDA_ERC 0x37 /* O2S1_WR_lambda(1): Equivalence Ratio Current */
|
||||
#define OBD_PID_O2S5_WR_LAMBDA_ERC 0x38 /* O2S1_WR_lambda(1): Equivalence Ratio Current */
|
||||
#define OBD_PID_O2S6_WR_LAMBDA_ERC 0x39 /* O2S1_WR_lambda(1): Equivalence Ratio Current */
|
||||
#define OBD_PID_O2S7_WR_LAMBDA_ERC 0x3a /* O2S1_WR_lambda(1): Equivalence Ratio Current */
|
||||
#define OBD_PID_O2S8_WR_LAMBDA_ERC 0x3b /* O2S1_WR_lambda(1): Equivalence Ratio Current */
|
||||
#define OBD_PID_CATAL_TEMP_BK1SS1 0x3c /* Catalyst Temperature Bank 1, Sensor 1 */
|
||||
#define OBD_PID_CATAL_TEMP_BK2SS1 0x3d /* Catalyst Temperature Bank 2, Sensor 1 */
|
||||
#define OBD_PID_CATAL_TEMP_BK1SS2 0x3e /* Catalyst Temperature Bank 1, Sensor 2 */
|
||||
#define OBD_PID_CATAL_TEMP_BK2SS2 0x3f /* Catalyst Temperature Bank 2, Sensor 2 */
|
||||
|
||||
#endif /* __APPS_INCLUDE_CANUTILS_OBD_PID_H */
|
||||
Reference in New Issue
Block a user