summaryrefslogtreecommitdiff
path: root/decoders/common/plugtrx/mod.py
diff options
context:
space:
mode:
authorGerhard Sittig <gerhard.sittig@gmx.net>2020-07-25 17:53:27 +0200
committerGerhard Sittig <gerhard.sittig@gmx.net>2020-07-25 23:16:01 +0200
commitd478372a132d1872426f96f5f0d06119392805f7 (patch)
tree1aa96d5f40a37dcbd4a5f9fea283b34f2aa4491b /decoders/common/plugtrx/mod.py
parentb3f83fda31bfeef63b0ed5610c7b2986ad80dcc5 (diff)
downloadlibsigrokdecode-d478372a132d1872426f96f5f0d06119392805f7.tar.gz
libsigrokdecode-d478372a132d1872426f96f5f0d06119392805f7.zip
ir_nec: rephrase button lookup and addr/cmd validity checks
Eliminate redundancy in the check for database entries of button events. Tighten the check for valid address and command bit patterns. The former implementation did something unexpected, wanted the AND of the first and second 8bit patterns to become zero. But the second 8bit item has not yet become available when the test runs after the reception of the first 8bit item. So the test happened to "pass" unexpectedly in intermediate steps, and failed to catch invalid input data when all fields became available. Unfortunately the check for valid data and the emission of annotations was combined in the implementation. So it's essential to keep running the "check" routine to get the annotations, and update internal ss/es state. But only emit warnings when the check fails after all involved data became available. Check for strict XOR as per the protocol spec.
Diffstat (limited to 'decoders/common/plugtrx/mod.py')
0 files changed, 0 insertions, 0 deletions