From e7bb7d0ca9d78bc02b4681a0ad8c1479e1ad1499 Mon Sep 17 00:00:00 2001 From: vc4 <287920192@qq.com> Date: Tue, 24 Aug 2021 19:15:58 +0800 Subject: [PATCH] backup codes --- scomm.py | 7 +++---- usercfg.json | 6 +++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/scomm.py b/scomm.py index 1d971a9..7e14d03 100755 --- a/scomm.py +++ b/scomm.py @@ -157,15 +157,14 @@ class SerComm(): def receiveData(self): while not self.receiveProgressStop: - #try: - if True: + try: data = self.com.read(self.com.in_waiting) if data: self.ui.log('%s: recv %s bytes: %s...' % (self.com.port,len(data),str(data)[:16])) self.ui.dmesg('recv', data) time.sleep(0.01) - #except Exception as e: - # self.ui.log('%s: receive trace: %s' % (self.com.port,str(e))) + except Exception as e: + self.ui.log('%s: receive trace: %s' % (self.com.port,str(e))) def sendData(self): #try: diff --git a/usercfg.json b/usercfg.json index 136d5b8..aa83ce0 100644 --- a/usercfg.json +++ b/usercfg.json @@ -17,5 +17,9 @@ "btn-unpack01": { "title": "HEX print", "value": "' '.join(['%02X'%x for x in data])" + }, + "btn-unpack02": { + "title": "C style print", + "value": "'\\\\x'+'\\\\x'.join('%02x'%x for x in data)" } -} +} \ No newline at end of file