OBDII library, based on SK Pang\\\'s ecu reader. more details to be added shortly.

Committer:
AliBros
Date:
Mon May 02 02:46:26 2011 +0000
Revision:
0:5b4bcf184488
Child:
1:4b7c280d433d

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AliBros 0:5b4bcf184488 1 #ifndef OBDII_H
AliBros 0:5b4bcf184488 2 #define OBDII_H
AliBros 0:5b4bcf184488 3
AliBros 0:5b4bcf184488 4 #define CANSPEED_125 125000 // CAN speed at 125 kbps
AliBros 0:5b4bcf184488 5 #define CANSPEED_250 250000 // CAN speed at 250 kbps
AliBros 0:5b4bcf184488 6 #define CANSPEED_500 500000 // CAN speed at 500 kbps
AliBros 0:5b4bcf184488 7
AliBros 0:5b4bcf184488 8 /* Details from http://en.wikipedia.org/wiki/OBD-II_PIDs */
AliBros 0:5b4bcf184488 9 #define ENGINE_COOLANT_TEMP 0x05
AliBros 0:5b4bcf184488 10 #define ENGINE_RPM 0x0C
AliBros 0:5b4bcf184488 11 #define VEHICLE_SPEED 0x0D
AliBros 0:5b4bcf184488 12 #define MAF_SENSOR 0x10
AliBros 0:5b4bcf184488 13 #define THROTTLE 0x11
AliBros 0:5b4bcf184488 14 #define O2_VOLTAGE 0x14
AliBros 0:5b4bcf184488 15
AliBros 0:5b4bcf184488 16 #define PID_REQUEST 0x7DF
AliBros 0:5b4bcf184488 17 #define PID_REPLY 0x7E8
AliBros 0:5b4bcf184488 18
AliBros 0:5b4bcf184488 19 namespace mbed {
AliBros 0:5b4bcf184488 20
AliBros 0:5b4bcf184488 21 class OBDII{
AliBros 0:5b4bcf184488 22
AliBros 0:5b4bcf184488 23 public:
AliBros 0:5b4bcf184488 24
AliBros 0:5b4bcf184488 25 OBDII(int can_speed);
AliBros 0:5b4bcf184488 26
AliBros 0:5b4bcf184488 27 unsigned char request(unsigned char pid, char *buffer);
AliBros 0:5b4bcf184488 28
AliBros 0:5b4bcf184488 29 private:
AliBros 0:5b4bcf184488 30
AliBros 0:5b4bcf184488 31 int i;
AliBros 0:5b4bcf184488 32
AliBros 0:5b4bcf184488 33 };
AliBros 0:5b4bcf184488 34
AliBros 0:5b4bcf184488 35
AliBros 0:5b4bcf184488 36
AliBros 0:5b4bcf184488 37
AliBros 0:5b4bcf184488 38
AliBros 0:5b4bcf184488 39 }
AliBros 0:5b4bcf184488 40
AliBros 0:5b4bcf184488 41
AliBros 0:5b4bcf184488 42
AliBros 0:5b4bcf184488 43 #endif