Age | Commit message (Collapse) | Author |
|
The previous implementation of the SAE J1850 (VPW) decoder dumped bytes
on one row and added another row with textual labels what those upper
row bytes would mean. That allowed manual inspection at a rather low
level of abstraction, but is not idiomatic and reduces usability of the
decoder.
Rewrite the decoder to become more idiomatic, and to prepare future
inspection of more upper layers. Concentrate all timestamp gathering in
.decode(), use PD API v3 for the IFS timeout as well, run handlers for
the lowest level symbols. Pass accumulated protocol bytes to a fields
handler, flush accumulated details when EOF is seen. Prepare validity
checks (checksum verification), and prepare to handle data bytes when
all header fields were seen and validity was checked. Emit annotations
in proper classes to improve usability, start emitting warnings. Force
re-synchronization when input stream conditions are not handled.
|
|
The SAE J1850 Variable Pulse Width decoder used to track and annotate
the width of pulses between edges, which duplicates existing features
of the 'timing' decoder. Remove this part from J1850, users can always
connect the input signal to multiple decoders as needed..
Also sort annotation rows while we are here. Top to bottom represents
raw wire bits to highest interpretation layer, as in other decoders.
|
|
Use symbolic identifiers for annotation classes, to improve readability
and maintainability.
|
|
IRC user pman92 reported that this decoder exists, and started migration
to the v3 API. This commit completes the migration, and adds missing
decoder infrastructure which has become mandatory recently.
Adjust the boilerplate: Drop FSF postal address. No Python output, add
category tag, unambiguous annotation class and row names. Add reset()
method. Use common code for edge detection.
This commit also addresses minor style nits. Pass the most recent
pulse's edges as ss and es to the data bit handling routine. Adjust
whitespace to unbreak editor navigation and to improve readability.
Use a more verbose name for the decoder, "vpw" appears a little short
and collision happy, and is not found when users search for "j1850".
[ Indentation changed, see whitespace ignoring diff for the essence. ]
Reported-By: pman92 <dpriestley92@hotmail.com>
|