mercedes-benz / odxtools

odxtools is a collection of utilities to interact with the diagnostic functionality of automotive electronic control units using python
MIT License
171 stars 70 forks source link

Refactor encoding, part 1 (the overture) #291

Closed andlaus closed 4 months ago

andlaus commented 5 months ago

This is the first PR in a series concerned with refactoring the encoding code. The goal of the PR series is to "de-spaghettify" this part of the code making it much easier to recognize it as the inverse of the decoding code.

This PR first fixes two unrelated issues (improvements of NrcConstParameter and renaming keyword argument dictionaries to params to kwargs) and follows by refactoring the EncodeState class analogous to DecodeState (the next PRs in the series will make use of the new attributes).

Andreas Lauser <andreas.lauser@mercedes-benz.com>, on behalf of MBition GmbH. Provider Information

andlaus commented 4 months ago

@kayoub5: do you agree that this can be merged? I think that the present PR should not regress anything and while the situation with the NrcConstParameter is certainly not ideal, fixing it requires more extensive changes that are out of scope for this PR series...