-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor decoding, part 2 #265
Commits on Feb 9, 2024
-
diag coded types: refactor the decoding methods
these methods are now called `decode_from_pdu()` and are the template for all other objects which can be decoded (i.e., DOPs and parameters): they take a `DecodeState` object as their lone argument and return the decoded physical value. Note that these methods are supposed to change the passed `DecodeState` object so that it is set up to decode the next object after calling `decode_from_pdu()`. This reduces the mental load required because before this, parameters, diag coded types, and DOPs all used the same name for functions which do similar but slightly different things... Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Alexander Walz <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 60a11d5 - Browse repository at this point
Copy the full SHA 60a11d5View commit details -
diag coded types: move bit position handling for decoding into `Decod…
…eState` if no bit position is specified/applicable, decoding continues at first bit of the byte pointed to by `cursor_position` Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Alexander Walz <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2c55127 - Browse repository at this point
Copy the full SHA 2c55127View commit details
Commits on Feb 12, 2024
-
DecodeState: switch to
_byte_position
postfixesthis should make it clear what kind of position is meant. thanks to [at]kayoub5 for the suggestion. Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Alexander Walz <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0a56d91 - Browse repository at this point
Copy the full SHA 0a56d91View commit details
Commits on Feb 13, 2024
-
CLI: provide backtrace if tool is unavailable
if something went wrong while loading a CLI tool, the backtrace can be accessed via `odxtools $TOOL --help`. Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Alexander Walz <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9f2e23a - Browse repository at this point
Copy the full SHA 9f2e23aView commit details -
test_cli: make it work even if the test is called interactively
rather "work" (mind the quotes): If pyinquirer is working and this was called "bare metal" (i.e., not via `pytest`), the `browse` tool stopped to ask the user for input. Since this is undesireable for a unit test, we now mock `sys.stdout.isatty()` to always return `False`. Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Alexander Walz <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9c7f239 - Browse repository at this point
Copy the full SHA 9c7f239View commit details -
DecodeState: make
cursor_bit_position
an integeri.e., it is now always an integer, never `None`. This looses us the ability of distinguishing between "no bit position defined" and "bit position set to 0" in the decoding machinery, but this is not too relevant as the ODX spec says that, the bit position ought to be assumed 0 if it is not defined and policing if it is allowed to be defined or not ought not should not be part of the decoding logic. thanks to [at]kayoub5 for his persistence! Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Alexander Walz <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 08b4d95 - Browse repository at this point
Copy the full SHA 08b4d95View commit details -
browse tool: switch from PyInquirer to InquirerPy
It seems like PyInquirer does not work more often than not (e.g., importing the module fails). Since InquirerPy describes itself as `a re-implementation of the PyInquirer project, with bug fixes of known issues, new prompts, backward compatible APIs as well as more customisation options.`, let's use it instead. Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Alexander Walz <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f40cbe3 - Browse repository at this point
Copy the full SHA f40cbe3View commit details