Multi-message OBD2 payload

Thought I’d post this here in case anyone wants to work on extending functionality of the OBD2 library used by M2. A good example of when you need to read and re-construct data over a few frames is when requesting the VIN of a car.

Some Issue comments are here describing possible strategy:

And here is some code that could probably be referenced or reused along with some good background information:

We’ve heard from a few people looking to get access to some of these multi-message data types, so this could be a useful addition to the OBD library!

I suppose this might be the time to mention that SavvyCAN supports multi-frame ISO-TP/UDS/OBDII messages. There isn’t great support for actually issuing the commands (though there are many ways of doing so from within the program) but it’s capable of reassembling multi-frame messages and showing you the resulting message. So, it’s kind of an option, at least for monitoring what is going on as you build your own sketches. Also, the code might be of use to anyone trying to support ISO-TP directly in a sketch.

Also, note that the multi-frame messaging format is called ISO-TP so searching for that might help to find relevant information.

@CollinK is this the piece of code you refer to above?

For M2 side of things, where would this fit best? “can_due” library or “CAN_Acquisition.cpp” from the OBD2 library?

Just found this code that might also be useful?

That altelch repo seems to be a very good source and it’s already meant for a similar library. So, I think that’s probably your best bet. It might take a little bit of work to adapt it to the correct CAN library but still it’s a very valuable resource.