From 0a47c98d392c57cbbe674c9260ea0421201978a3 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sat, 22 Jul 2023 02:30:21 +0200 Subject: [PATCH] Catch exception when using virtual serial over BLE --- software/script/chameleon_com.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/software/script/chameleon_com.py b/software/script/chameleon_com.py index f4bad59..81119ad 100644 --- a/software/script/chameleon_com.py +++ b/software/script/chameleon_com.py @@ -78,7 +78,11 @@ class ChameleonCom: finally: if error is not None: raise OpenFailException(error) - self.serial_instance.dtr = 1 # must make dtr enable + try: + self.serial_instance.dtr = 1 # must make dtr enable + except Exception as e: + # not all serial support dtr, e.g. virtual serial over BLE + pass self.serial_instance.timeout = 0 # noblock # clear variable self.send_data_queue.queue.clear()