libpandac  0.0.0
A library designed for a comm.ai Panda.
obd-pid-definitions.h
1 /*
2  Author: Matt Bunting
3  Copyright (c) 2020 Arizona Board of Regents
4  All rights reserved.
5 
6  Permission is hereby granted, without written agreement and without
7  license or royalty fees, to use, copy, modify, and distribute this
8  software and its documentation for any purpose, provided that the
9  above copyright notice and the following two paragraphs appear in
10  all copies of this software.
11 
12  IN NO EVENT SHALL THE ARIZONA BOARD OF REGENTS BE LIABLE TO ANY PARTY
13  FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14  ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15  IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
16  SUCH DAMAGE.
17 
18  THE ARIZONA BOARD OF REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES,
19  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20  AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER
21  IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION
22  TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
23 
24  */
25 
26 #ifndef OBD_PID_DEFINITIONSS_H
27 #define OBD_PID_DEFINITIONSS_H
28 
29 
30 
31 #define CAN_FRAME_TYPE_MASK (0xF0)
32 
33 namespace Panda {
34 
35 
36 // TODO: Finish codifying some PID codes from here as enums/defines
37 // https://en.wikipedia.org/wiki/OBD-II_PIDs
38 
39 
40 enum CanFrameTypes {
41  CAN_FRAME_SINGLE = 0x00,
42  CAN_FRAME_FIRST = 0x01,
43  CAN_FRAME_CONSECUTIVE = 0x02,
44  CAN_FRAME_FLOW_CONTROL = 0x03
45 };
46 
47 
48 enum ObdPidModes {
49  OBD_PID_SERVICE_CURRENT_DATA = 0x01,
50  OBD_PID_SERVICE_FREEZE_FRAME_DATA = 0x02,
51  OBD_PID_SERVICE_VEHICLE_INFO = 0x09
52 };
53 
54 enum ObdPidVehicleInfo {
55  OBD_PID_VEHICLE_INFO_VIN_COUNT = 0x01,
56  OBD_PID_VEHICLE_INFO_VIN = 0x02
57 };
58 
59 }
60 
61 #endif
Handles USB communication and parsing with a comma.ai Panda.
Definition: can.h:38