[chirp_devel] Request for TM-471A.

Brett Bump
Wed May 8 16:12:32 PDT 2013


Sorry, Dan suggested that I get this out last month, but work has been a
little hectic.  I've posted the new model request and assigned it to
myself.  Seems to work fine on my radio.

Brett

# HG changeset patch
# Parent f6c48f71ea6c96b969751f136e40e6c0128960a4
Code replicated from the TM-271 for the TM-471 series.



diff -r f6c48f71ea6c -r 35f12a487716 chirp/kenwood_live.py
--- a/chirp/kenwood_live.py     Sun May 05 10:30:26 2013 -0700
+++ b/chirp/kenwood_live.py     Wed May 08 17:03:31 2013 -0600
@@ -158,7 +158,7 @@
              return self.__memcache[number]

          result = command(self.pipe, *self._cmd_get_memory(number))
-        if result == "N":
+        if result == "N" or result == "E":
              mem = chirp_common.Memory()
              mem.number = number
              mem.empty = True
@@ -1103,3 +1103,71 @@

  if __name__ == "__main__":
      do_test()
+
+ at directory.register
+class TM471Radio(THK2Radio):
+    """Kenwood TM-471"""
+    MODEL = "TM-471"
+
+    def get_features(self):
+        rf = chirp_common.RadioFeatures()
+        rf.can_odd_split = False
+        rf.has_dtcs_polarity = False
+        rf.has_bank = False
+        rf.has_tuning_step = False
+        rf.valid_tmodes = ["", "Tone", "TSQL", "DTCS"]
+        rf.valid_modes = THK2_MODES
+        rf.valid_duplexes = THK2_DUPLEX
+        rf.valid_characters = THK2_CHARS
+        rf.valid_name_length = 6
+        rf.valid_bands = [(444000000, 479990000)]
+        rf.valid_skips = ["", "S"]
+        rf.valid_tuning_steps = [5.0]
+        rf.memory_bounds = (0, 99)
+        return rf
+
+    def _cmd_get_memory(self, number):
+        return "ME", "%03i" % number
+
+    def _cmd_get_memory_name(self, number):
+        return "MN", "%03i" % number
+
+    def _cmd_set_memory(self, number, spec):
+        return "ME", "%03i,%s" % (number, spec)
+
+    def _cmd_set_memory_name(self, number, name):
+        return "MN", "%03i,%s" % (number, name)
+
+def do_test():
+    """Dev test"""
+    mem = chirp_common.Memory()
+    mem.number = 1
+    mem.freq = 440000000
+    mem.duplex = "split"
+    mem.offset = 442000000
+
+    tc = THF6ARadio
+    class FakeSerial:
+        """Faked serial line"""
+        buf = ""
+        def write(self, buf):
+            """Write"""
+            self.buf = buf
+        def read(self, count):
+            """Read"""
+            if self.buf[:2] == "ID":
+                return "ID %s\r" % tc.MODEL
+            return self.buf
+        def setTimeout(self, foo):
+            """Set Timeout"""
+            pass
+        def setBaudrate(self, foo):
+            """Set Baudrate"""
+            pass
+
+    radio = tc(FakeSerial())
+    radio.set_memory(mem)
+
+if __name__ == "__main__":
+    do_test()
+




More information about the chirp_devel mailing list