From f34113a300f2866a9eae08678cdb87d8d29a8b88 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Mon, 30 Dec 2019 12:26:19 +0100 Subject: uart: Use human-readable names for binary classes. --- decoders/uart/pd.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'decoders/uart/pd.py') diff --git a/decoders/uart/pd.py b/decoders/uart/pd.py index 2bae0dc..0109425 100644 --- a/decoders/uart/pd.py +++ b/decoders/uart/pd.py @@ -88,6 +88,9 @@ class Ann: RX_DATA_BIT, TX_DATA_BIT, RX_BREAK, TX_BREAK, RX_PACKET, TX_PACKET = \ range(18) +class Bin: + RX, TX, RXTX = range(3) + class Decoder(srd.Decoder): api_version = 3 id = 'uart' @@ -329,8 +332,8 @@ class Decoder(srd.Decoder): self.putx(rxtx, [rxtx, [formatted]]) bdata = b.to_bytes(self.bw, byteorder='big') - self.putbin(rxtx, [rxtx, bdata]) - self.putbin(rxtx, [2, bdata]) + self.putbin(rxtx, [Bin.RX + rxtx, bdata]) + self.putbin(rxtx, [Bin.RXTX, bdata]) self.handle_packet(rxtx) -- cgit v1.2.3-70-g09d2