/*
 * @file obd2.h
 *
 * @date Jun 9, 2015
 * @author Andrey Belomutskiy, (c) 2012-2016
 */

#ifndef CONTROLLERS_OBD2_H_
#define CONTROLLERS_OBD2_H_

#include "global.h"

#define OBD_TEST_REQUEST 0x7DF

#define OBD_TEST_RESPONSE 0x7E8

#define OBD_CURRENT_DATA 1
#define OBD_STORED_DIAGNOSTIC_TROUBLE_CODES 3
#define OBD_PENDING_DIAGNOSTIC_TROUBLE_CODES 7

#define PID_SUPPORTED_PIDS_REQUEST 0
#define PID_ENGINE_LOAD 0x04
#define PID_COOLANT_TEMP 0x05
#define PID_FUEL_PRESSURE 0x0A
#define PID_INTAKE_MAP 0x0B
#define PID_RPM 0x0C
#define PID_SPEED 0x0D
#define PID_TIMING_ADVANCE 0x0E
#define PID_INTAKE_TEMP 0x0F
#define PID_THROTTLE 0x11


void obdOnCanPacketRx(CANRxFrame *rx);

#endif /* CONTROLLERS_OBD2_H_ */
