New example sketch for custom headers #239
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This example shows how to perform several opearations for using custom (non-OBD2 standard)
queries.
Custom Header
We perform a query that requires a custom header to be sent first. The custom header in this
case determines which ECU in the vehicle's system we want to query.
Custom PID
The query sent to the vehicle is also a custom (non OBD2 standard) PID using the 0x22
(enhanced data) mode.
Manually Processing Response
In this example, we manually extract the data value from the query response and perform
some post-processing to calculate the correct value.
Managing Query State
We also demonstrate managing the query state used by the loop() method. This is typically
managed internally by ELMduino for standard PID methods.
Customize all the things!
The header value, PID, data value bytes and adjustment formula are generally unique for
each different vehicle and PID. You will need to source the correct values for those for
your specific vehicle. This example almost certainly will not work for you "as-is".