DarthAffe / OBD.NET

C#-Library to read data from car through an ELM327-/STN1170-Adapter
GNU General Public License v2.0
178 stars 82 forks source link

Extracting Vehicle Identification Number #19

Open robertllouw opened 3 years ago

robertllouw commented 3 years ago

Hi,

Does anybody know how to extract a vehicles identification number (VIN) using the ODB.NET library?

What I have managed to figure out is that it is under mode 9, PID 2. Command 0902. However not sure how to setup a reference class to extract the VIN details.

Thanks,

Rob

DarthAffe commented 3 years ago

Hi, currently only mode 1 (current data) is implemented. To request that data you'd need to change the mode in the device (https://github.com/DarthAffe/OBD.NET/blob/master/OBD.NET/OBD.NET.Common/Devices/ELM327.cs#L26) which could be done by inheriting it and setting it in your class or of course by changing it directly . The processing logic (https://github.com/DarthAffe/OBD.NET/blob/master/OBD.NET/OBD.NET.Common/Devices/ELM327.cs#L164) also had to be changed to be able to parse the results.