From e43bd0293622159d872b6174a18d0b8dde1dfc84 Mon Sep 17 00:00:00 2001 From: Christoph Eck Date: Tue, 29 Aug 2023 13:30:32 +0200 Subject: [PATCH] feat(lldata): print bytes as string representation Use verbose argument to see the string represenation of the packets data. --- btlejack/ui.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/btlejack/ui.py b/btlejack/ui.py index 1f8820f..16eaf52 100755 --- a/btlejack/ui.py +++ b/btlejack/ui.py @@ -417,6 +417,9 @@ def on_ll_packet(self, packet): pkt_hex = ' '.join(['%02x' % c for c in packet.data[10:]]) print('LL Data: ' + pkt_hex) + if self.verbose: + pkt_str = ''.join([repr(chr(c)) for c in packet.data[10:]]) + print(' str: ' + pkt_str) def on_hijacking_success(self): @@ -634,6 +637,9 @@ def on_ll_packet(self, packet): self.output.write_packet(ts_sec, ts_usec, self.access_address, packet.data) pkt_hex = ' '.join(['%02x' % c for c in packet.data[10:]]) print('LL Data: ' + pkt_hex) + if self.verbose: + pkt_str = ''.join([repr(chr(c)) for c in packet.data[10:]]) + print(' str: ' + pkt_str) def on_hijacking_success(self): """