From f9dd6f5e4f527ad648607f091a6b3e78ef1fbf19 Mon Sep 17 00:00:00 2001 From: Gadgeteer Date: Sun, 1 Dec 2024 12:38:42 +0000 Subject: [PATCH 1/2] Add serial reader Add serial reader to the log and remove N/A --- cflib/crtp/radiodriver.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cflib/crtp/radiodriver.py b/cflib/crtp/radiodriver.py index 7d22b6c52..1bd4bb605 100644 --- a/cflib/crtp/radiodriver.py +++ b/cflib/crtp/radiodriver.py @@ -156,7 +156,7 @@ def __init__(self, devid: int): self._lock = Semaphore(1) - self.setDaemon(True) + self.daemon = True self.start() @@ -455,12 +455,15 @@ def scan_interface(self, address): except Exception as e: print(e) return [] - - # FIXME: implements serial number in the Crazyradio driver! - serial = 'N/A' + try: + serial = crazyradio.get_serials() + except Exception as e: + print(e) + serial = 'N/A' + logger.info('v%s dongle with serial %s found', self._radio.version, - serial) + serial[0]) found = [] if address is not None: From aed7950b18e764304a3cbeb4e365c4b197014404 Mon Sep 17 00:00:00 2001 From: Gageteering Date: Wed, 4 Dec 2024 10:24:10 +0000 Subject: [PATCH 2/2] pre-commit check --- cflib/crtp/radiodriver.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cflib/crtp/radiodriver.py b/cflib/crtp/radiodriver.py index 1bd4bb605..52095ad04 100644 --- a/cflib/crtp/radiodriver.py +++ b/cflib/crtp/radiodriver.py @@ -460,7 +460,6 @@ def scan_interface(self, address): except Exception as e: print(e) serial = 'N/A' - logger.info('v%s dongle with serial %s found', self._radio.version, serial[0])