Hi @rxcccc ,
you are right, the code is no that easy to understand.
When I wrote it, I faced at least 3 problems:
- Kawasaki has exact 1 value per request
- Suzuki has all values per request
- Honda has 1/3 values per request (which I wanted to implement at some point)
The Initialization process has additional steps.
On top of that, things like DTC is working differently as well.
So my Idea was to have a central "storage" of OBD2 compatible data.
The Kawa can just fill the requested PID with a value and the OBD2 value will be responded. But with the "storage" approach, it´s also possible to not allways answer to the requests live. Like battery only needs to be updates every few iterations.
And at the same time, Suzuki can fill all values at once with a single request.
From OBD2 perspective, they will be requested one after another. So I only update the data on a RPM request and submit anything else from this response.
Hopefully this will help you out a bit to understand how the code was intended. But I totally understand, that it is a lot of code! With lots of functionality on top, which is not directly needed for the ECU communication.
If you have specific questions, I´d try to answer and help you out as good as I can.
I still cannot fully understand what you want to archive and what is not working out for you.