From b009fe88ca5664197ce3ed5c1e79448ac9318018 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Mon, 24 Feb 2025 13:40:11 +0000 Subject: [PATCH] uart: publish packets as python data as well as annotations The packet handling is very handy, and it already produces annotations, just extend this to the python output so that higher levels can work with pre-framed data where applicable. Signed-off-by: Karl Palsson --- decoders/uart/pd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/decoders/uart/pd.py b/decoders/uart/pd.py index 038a2f8e8..d3e2b514c 100644 --- a/decoders/uart/pd.py +++ b/decoders/uart/pd.py @@ -44,6 +44,7 @@ value of the UART data, and a boolean which reflects the validity of the UART frame. - 'IDLE': The data is always 0. + - 'PACKET': data is entire packet, as array of integer values The field is 0 for RX packets, 1 for TX packets. ''' @@ -307,6 +308,7 @@ def handle_packet(self, rxtx): if self.options['format'] != 'ascii' and s[-1] == ' ': s = s[:-1] # Drop trailing space. self.putx_packet(rxtx, [Ann.RX_PACKET + rxtx, [s]]) + self.put(self.ss_packet[rxtx], self.es_packet[rxtx], self.out_python, ('PACKET', rxtx, self.packet_cache[rxtx])) self.packet_cache[rxtx] = [] def get_data_bits(self, rxtx, signal):