hi,
some one can help me! i need to progarm ARM9 processor with c++ language.
I'd like to start coding OBD_II that works like this: OBD-II will never send data on it's own, it listens for a command you send and based on that command it will send an answer. So basically you have to do two things if you have a running connection:
Send the correct commands to the OBD-II device.
Parse the answers into human-readable data.
The ELM327-bluetooth-connector you have translates ASCII commands to voltages. So all you have to do, is send some ASCII commands, and you get ASCII-values back.
The OBD protocol knows several modes and parameter's, but I will explain to get real-time data. That's mode 1.
Mode 1 Sending
Mode 1 is '01'. After that part, you have to send a parameter ID with it. 0C is for RPM, 0D is for speed. And after each command you have to send a Carriage Return. (CR = '\r') So the connector knows when a request is complete.
So basically, for speed, you have to send:
'010D\r'
Receiving Mode 1
The answer you will get back from a Mode 1 query, starts with '41'. After that the parameter ID is returned, and then the value. The value is most of the time in hex. You will have to do some conversion to read a human readable value. For more information, see the link, as formula's to convert are provided too.
Example:
'410D17'
So 17 is the value of your current speed in hex. 17 to decimal is 23, so you're driving with 23 km/h.