[chirp_devel] [ic7000]Digital Code Squelch for IC-7000 channels. Fixes bug #3047

Joseph.P.Scanlan at n7xsd.us
Thu Dec 10 10:13:06 PST 2015


# HG changeset patch
# User <Joseph.P.Scanlan at n7xsd.us>
# Date 1449768806 28800
#      Thu Dec 10 09:33:26 2015 -0800
# Node ID 5041a82f811b692759ce75b4520ad34b553cc572
# Parent  95684405e6c32047c1d9e61a0e152cb198cbaf27
[ic7000]Digital Code Squelch for IC-7000 channels.  Fixes bug #3047
Corrected reading of DCS from memory.
Added writing of DCS to memory.
Added reading and writing DCS polarity to memory.

diff -r 95684405e6c3 -r 5041a82f811b chirp/drivers/icomciv.py
--- a/chirp/drivers/icomciv.py  Mon Nov 30 10:15:59 2015 -0800
+++ b/chirp/drivers/icomciv.py  Thu Dec 10 09:33:26 2015 -0800
@@ -30,8 +30,8 @@
 bbcd rtone[2];
 u8   unknown5;
 bbcd ctone[2];
-u8   unknown6[2];
-bbcd dtcs;
+u8   dtcs_polarity;
+bbcd dtcs[2];
 u8   unknown[17];
 char name[9];
 """
@@ -50,8 +50,8 @@
 bbcd rtone[2];
 u8   unknown5;
 bbcd ctone[2];
-u8   unknown6[2];
-bbcd dtcs;
+u8   dtcs_polarity;
+bbcd dtcs[2];
 u8   unknown[11];
 char name[9];
 """
@@ -265,9 +265,18 @@
         if self._rf.valid_tmodes:
             mem.tmode = self._rf.valid_tmodes[memobj.tmode]

+        if self._rf.has_dtcs_polarity:
+            if memobj.dtcs_polarity == 0x11:
+                mem.dtcs_polarity = "RR"
+            elif memobj.dtcs_polarity == 0x10:
+                mem.dtcs_polarity = "RN"
+            elif memobj.dtcs_polarity == 0x01:
+                mem.dtcs_polarity = "NR"
+            else:
+                mem.dtcs_polarity = "NN"
+
         if self._rf.has_dtcs:
-            # FIXME
-            mem.dtcs = bitwise.bcd_to_int([memobj.dtcs])
+            mem.dtcs = bitwise.bcd_to_int(memobj.dtcs)

         if "Tone" in self._rf.valid_tmodes:
             mem.rtone = int(memobj.rtone) / 10.0
@@ -308,6 +317,19 @@
             memobj.ctone = int(mem.ctone * 10)
             memobj.rtone = int(mem.rtone * 10)

+        if self._rf.has_dtcs_polarity:
+            if mem.dtcs_polarity == "RR":
+                memobj.dtcs_polarity = 0x11
+            elif mem.dtcs_polarity == "RN":
+                memobj.dtcs_polarity = 0x10
+            elif mem.dtcs_polarity == "NR":
+                memobj.dtcs_polarity = 0x01
+            else:
+                memobj.dtcs_polarity = 0x00
+
+        if self._rf.has_dtcs:
+            bitwise.int_to_bcd(memobj.dtcs, mem.dtcs)
+
         LOG.debug(repr(memobj))
         self._send_frame(f)



More information about the chirp_devel mailing list