Closed rocketjosh closed 6 years ago
Probably the place to do this is the next layer down in the CAN_Acquisition.cpp layer, here you can implement a receive handler for a specific message and do you parsing and merging there. See the CAN_Example_Gateway.ino for an example implementation.
On Mon, Nov 20, 2017 at 2:38 PM, Josh notifications@github.com wrote:
Wondering how to get access to other modes? Specifically, looking for VIN, found at Mode 9: Request vehicle information.
According to Wikipedia https://en.wikipedia.org/wiki/OBD-II_PIDs#Mode_09, VIN is:
Mode 9 PID 02 Data bytes returned = 17-20 17-char VIN, ASCII-encoded and left-padded with null chars (0x00) if needed to.
Something like this in OBD2.h ?
enum OBD_PID {
ENGINE_LOAD = 0x04, COOLANT_TEMP = 0x05, ENGINE_RPM = 0x0C, SPEED = 0x0D, ENGINE_IAT = 0x0F, ENGINE_MAF = 0x10, THROTTLE_POS = 0x11, FUEL_FLOW = 0x5E, VIN = 0x02 }; /* This enum represents the size of the OBD2 signal in bits (8,16,32) per OBD2 protocol /enum OBD_PID_SIZE { _8BITS = 1, _16BITS = 2, _32BITS = 4, _160BITS = 20 }; /* This enum represents the desired mode of the signal requested from the OBD2 port /enum OBD_MODE_REQ { CURRENT = 1, FREEZE = 2, REQUEST = 9
};
and this line in the sketch:
cOBDParameter OBD_VIN( "VIN " , " #" , VIN , _160BITS, false , REQUEST, 1, 0, &CANport0, false);
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/togglebit/ArduinoDUE_OBD_FreeRunningCAN/issues/9, or mute the thread https://github.com/notifications/unsubscribe-auth/AD6Os-IEpy-aAGorjvaSODmrU5Zf9K5qks5s4dVHgaJpZM4QkyQJ .
Cool, thanks! Just found this. Might be useful here:
https://community.carloop.io/t/how-to-request-vin/153
and repo with working code:
Wondering how to get access to other modes? Specifically, looking for VIN, found at Mode 9: Request vehicle information.
According to Wikipedia, VIN is:
Mode 9 PID 02 Data bytes returned = 17-20 17-char VIN, ASCII-encoded and left-padded with null chars (0x00) if needed to.
Something like this in OBD2.h ?
and this line in the sketch: