summaryrefslogtreecommitdiff
path: root/decoders/usb_power_delivery
AgeCommit message (Collapse)Author
2017-12-22usb_power_delivery: enforce check order for start-of-packet sequencesGerhard Sittig
The list of a dictionary's keys need not reproduce in identical order everywhere. Make sure to run all start-of-packet sequence checks in the decoder implementation in a specific order on each machine, such that annotations get emitted with identical content and in the same order for each execution of the decoder. This fixes the remaining part of bug #1090.
2017-12-22usb_power_delivery: fixup a Python style nit (dict lookup fallback)Gerhard Sittig
Use the dictionary's .get() method in combination with a default result parameter, instead of an explicit "k in dictvar" test and a conditional assignment.
2017-12-22usb_power_delivery: enforce numerical order of RDO/PDO flag annotationsGerhard Sittig
Annotations of the USB power delivery decoder contain multiple text fragments that correspond to several flags in bit fields. The Python runtime did not guarantee an order of emission and made the test suite fail. Sort the order in which RDO and PDO flags related text fragments get constructed and concatenated. Print text for higher bit positions first as this might feel more intuitive to users. This fixes part of bug #1090.
2017-12-22all decoders: introduce a reset() methodGerhard Sittig
Move initialization code of protocol decoders from the constructor to a new reset() helper method. The libsigrokdecode backend could run this method several times to clear the decoder's internal state, before new data from another acquisition gets fed to decode() calls.
2017-01-07license: remove FSF postal address from boiler plate license textGerhard Sittig
Remove the FSF postal address as it might change (it did in the past). Reference the gnu.org website instead which is more stable.
2016-12-07usb_power_delivery: Convert to PD API version 3.Uwe Hermann
2016-08-26usb_power_delivery: Drop problematic exception in us2samples().Uwe Hermann
This causes an issue when running the sigrok-test test-cases, so drop it for now (the same check already exists in decode()). This fixes bug #758.
2016-05-15Use consistent __init__() format across all PDs.Uwe Hermann
The previous **kwargs some PDs had is not actually ever used, so drop it.
2016-05-09Consistently use ' instead of " for strings in all PDs.Uwe Hermann
2015-12-25usb_power_delivery: Raise SamplerateError instead of Exception.Uwe Hermann
(for consistency with the other PDs)
2015-12-24Use a Python list (not tuple) for OUT_BINARY.Uwe Hermann
This is more consistent with annotation syntax and looks slightly better in most cases.
2015-12-16usb_power_delivery: Use "if not self.samplerate" form.Uwe Hermann
Use the "if not self.samplerate" form, which catches both the case where self.samplerate is None, as well as the case where it is 0. This is also consistent with all the other PDs.
2015-12-16usb_power_delivery: convert double quotes to single quotesVincent Palatin
For consistency with other decoders, convert all the double quotes around strings to single quotes. Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
2015-11-21usb_power_delivery: Minor typo and whitespace fixes.Uwe Hermann
2015-11-21usb_power_delivery: Use the same license header format as other PDs.Uwe Hermann
2015-11-21USB Power Delivery protocol decoderVincent Palatin
Decode and packetize the Biphase Mark Coding (aka differential Manchester) as used in the Universal Serial Bus Power Delivery Specification Revision 2.0 v1.1, then decode the packet content. Signed-off-by: Vincent Palatin <vpalatin@chromium.org>