diag-kernel: thread base offset through structure DOP decoding#282
diag-kernel: thread base offset through structure DOP decoding#282lorinciubeica10 wants to merge 2 commits intoeclipse-opensovd:mainfrom
Conversation
0825d20 to
4ca501c
Compare
|
Thanks! :) |
|
Thanks @lorinciubeica10 ! I can confirm that this PR solves one of the issues I encountered while extending ODX for DTC Snapshot/Extended data where the response would be wrongly interpreted: |
| Ok(()) | ||
| } | ||
|
|
||
| #[allow(clippy::too_many_arguments)] |
There was a problem hiding this comment.
question: Do you think it would make sense to introduce a struct that wraps the &datatypes::Parameter together with the base_offset?
Something like this:
struct ParamContext<'a> {
parameter: &'a datatypes::Parameter,
base_offset: usize,
}My train of thought being that these two are related to each other, and combining them into a single parameter would avoid the clippy warning at the same time and maybe we have additional context we want to pass with the parameter in the future.
This is more of a discussion point, where I'd like your opinion on it as well. If you prefer it as is that is perfectly fine to me as well.
There was a problem hiding this comment.
I think it s a good idea since base_offset is always passed alongside param. I will fix it
|
Added several fixes for bugs caused by incorrect or missing data when decoding UDS responses:
|
561c13e to
31c7313
Compare
31c7313 to
cf4b74b
Compare



Summary
Replaced push_slice/pop_slice coordinate shifting in map_structure_dop_from_uds with a base offset parameter propagated through all decode functions.
This correctly handles both absolute and relative byte position conventions without corrupting the payload cursor for inner params
Checklist
Related
Fixes #270
Notes for Reviewers