[chirp_devel] [PATCH] [th9800] make radio driver work with chirp tests #2269

Jens Jensen
Fri Jan 30 15:54:52 PST 2015


# HG changeset patch
# User Jens Jensen <af5mi at yahoo.com>
# Date 1422589281 21600
#      Thu Jan 29 21:41:21 2015 -0600
# Node ID 635e4a4016451d1eaa3f3d943a0da86e6683a389
# Parent  cfa8a356cf3867cb3df35c7d73193285cc2b50d1
[th9800] make radio driver work with chirp tests #2269

diff -r cfa8a356cf38 -r 635e4a401645 chirp/th9800.py
--- a/chirp/th9800.py	Thu Jan 29 07:14:39 2015 -0800
+++ b/chirp/th9800.py	Thu Jan 29 21:41:21 2015 -0600
@@ -183,6 +183,7 @@
     rf.can_odd_split = True
     rf.valid_duplexes = ["", "-", "+", "split", "off"]
     rf.valid_tmodes = TMODES
+    rf.has_ctone = False
     rf.valid_power_levels = POWER_LEVELS
     rf.valid_characters = chirp_common.CHARSET_UPPER_NUMERIC + "#*-+"
     rf.valid_bands = [( 26000000,  33000000),
@@ -373,7 +374,10 @@
         _mem.am = False
         _mem.fmdev = MODES.index(mem.mode)
 
-    _mem.power = POWER_LEVELS.index(mem.power)
+    if mem.power:
+        _mem.power = POWER_LEVELS.index(mem.power)
+    else:
+        _mem.power = 0    # low
     _mem.step = STEPS.index(mem.tuning_step)
 
     for setting in mem.extra:
@@ -722,9 +726,17 @@
       return rp
   
   def sync_in(self):
-      self._mmap = _download(self)
-      self.process_mmap()
+        try:
+            self._mmap = _download(self)
+        except Exception, e:
+            raise errors.RadioError( \
+                "Failed to communicate with the radio: %s" % e)
+        self.process_mmap()
 
   def sync_out(self):
-      _upload(self)
+        try:
+            _upload(self)
+        except Exception, e:
+            raise errors.RadioError( \
+                "Failed to communicate with the radio: %s" % e)        
 



More information about the chirp_devel mailing list