<div dir="ltr">Second try...<br><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <b class="gmail_sendername" dir="auto">Jim Unroe</b> <span dir="auto">&lt;<a href="mailto:kc9hi@comcast.net">kc9hi@comcast.net</a>&gt;</span><br>Date: Sat, Jul 3, 2021 at 2:25 PM<br>Subject: [PATCH] [RT98] Add support for Retevis RT98 Single Band Mini Mobile Radios<br>To:  &lt;<a href="mailto:Rock.Unroe@gmail.com">Rock.Unroe@gmail.com</a>&gt;<br></div><br><br># HG changeset patch<br>
# User Jim Unroe &lt;<a href="mailto:rock.unroe@gmail.com" target="_blank">rock.unroe@gmail.com</a>&gt;<br>
# Date 1625336015 14400<br>
#      Sat Jul 03 14:13:35 2021 -0400<br>
# Node ID 0eab8146b294ef686ca4a49c17ea38abde54c7ab<br>
# Parent  f586574bc8786fd6bef1e5d54d08d381c81edd47<br>
[RT98] Add support for Retevis RT98 Single Band Mini Mobile Radios<br>
<br>
This patch adds support for the various Retevis RT98 mobile radio models/modes.<br>
VHF FreeNet<br>
VHF COM<br>
VHF COMII<br>
UHF PMR<br>
UHF COM<br>
UHF COMII<br>
<br>
#9181<br>
<br>
diff -r f586574bc878 -r 0eab8146b294 chirp/drivers/retevis_rt98.py<br>
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000<br>
+++ b/chirp/drivers/retevis_rt98.py     Sat Jul 03 14:13:35 2021 -0400<br>
@@ -0,0 +1,1364 @@<br>
+# Copyright 2021 Jim Unroe &lt;<a href="mailto:rock.unroe@gmail.com" target="_blank">rock.unroe@gmail.com</a>&gt;<br>
+#<br>
+# This program is free software: you can redistribute it and/or modify<br>
+# it under the terms of the GNU General Public License as published by<br>
+# the Free Software Foundation, either version 2 of the License, or<br>
+# (at your option) any later version.<br>
+#<br>
+# This program is distributed in the hope that it will be useful,<br>
+# but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>
+# GNU General Public License for more details.<br>
+#<br>
+# You should have received a copy of the GNU General Public License<br>
+# along with this program.  If not, see &lt;<a href="http://www.gnu.org/licenses/" rel="noreferrer" target="_blank">http://www.gnu.org/licenses/</a>&gt;.<br>
+<br>
+import os<br>
+import struct<br>
+import time<br>
+import logging<br>
+<br>
+from chirp import bitwise<br>
+from chirp import chirp_common<br>
+from chirp import directory<br>
+from chirp import errors<br>
+from chirp import memmap<br>
+from chirp import util<br>
+from chirp.settings import RadioSettingGroup, RadioSetting, RadioSettings, \<br>
+    RadioSettingValueList, RadioSettingValueString, RadioSettingValueBoolean, \<br>
+    RadioSettingValueInteger, RadioSettingValueString, \<br>
+    RadioSettingValueFloat, InvalidValueError<br>
+<br>
+LOG = logging.getLogger(__name__)<br>
+<br>
+#<br>
+#  Chirp Driver for Retevis RT98 models: RT98V (136-174 Mhz)<br>
+#                                        RT98U (400-490 Mhz)<br>
+#<br>
+#<br>
+#<br>
+# Global Parameters<br>
+#<br>
+TONES = [62.5] + list(chirp_common.TONES)<br>
+TMODES = [&#39;&#39;, &#39;Tone&#39;, &#39;DTCS&#39;]<br>
+DUPLEXES = [&#39;&#39;, &#39;+&#39;, &#39;-&#39;]<br>
+<br>
+TXPOWER_LOW = 0x00<br>
+TXPOWER_MED = 0x01<br>
+TXPOWER_HIGH = 0x02<br>
+<br>
+DUPLEX_NOSPLIT = 0x00<br>
+DUPLEX_POSSPLIT = 0x01<br>
+DUPLEX_NEGSPLIT = 0x02<br>
+<br>
+CHANNEL_WIDTH_12d5kHz = 0x00<br>
+CHANNEL_WIDTH_20kHz = 0x01<br>
+CHANNEL_WIDTH_25kHz = 0x02<br>
+<br>
+TUNING_STEPS = [2.5, 5.0, 6.25, 10.0, 12.5, 20.0, 25.0, 30.0, 50.0]<br>
+<br>
+POWER_LEVELS = [chirp_common.PowerLevel(&quot;Low&quot;, watts=5),<br>
+                chirp_common.PowerLevel(&quot;Mid&quot;, watts=10),<br>
+                chirp_common.PowerLevel(&quot;High&quot;, watts=15)]<br>
+<br>
+PMR_POWER_LEVELS = [chirp_common.PowerLevel(&quot;Low&quot;, watts=0.5), ]<br>
+<br>
+FREENET_POWER_LEVELS = [chirp_common.PowerLevel(&quot;Low&quot;, watts=1), ]<br>
+<br>
+PMR_FREQS = [446.00625, 446.01875, 446.03125, 446.04375,<br>
+             446.05625, 446.06875, 446.08125, 446.09375,<br>
+             446.10625, 446.11875, 446.13125, 446.14375,<br>
+             446.15625, 446.16875, 446.18125, 446.19375]<br>
+<br>
+FREENET_FREQS = [149.02500, 149.03750, 149.05000,<br>
+                 149.08750, 149.10000, 149.11250]<br>
+<br>
+CROSS_MODES = [&quot;Tone-&gt;Tone&quot;, &quot;DTCS-&gt;&quot;, &quot;-&gt;DTCS&quot;, &quot;Tone-&gt;DTCS&quot;, &quot;DTCS-&gt;Tone&quot;,<br>
+               &quot;-&gt;Tone&quot;, &quot;DTCS-&gt;DTCS&quot;]<br>
+<br>
+LIST_STEP = [str(x) for x in TUNING_STEPS]<br>
+LIST_TIMEOUT = [&quot;Off&quot;] + [&quot;%s min&quot; % x for x in range(1, 31)]<br>
+LIST_APO = [&quot;Off&quot;, &quot;30 min&quot;, &quot;1 hr&quot;, &quot;2 hrs&quot;]<br>
+LIST_SQUELCH = [&quot;Off&quot;] + [&quot;Level %s&quot; % x for x in range(1, 10)]<br>
+LIST_DISPLAY_MODE = [&quot;Channel&quot;, &quot;Frequency&quot;, &quot;Name&quot;]<br>
+LIST_AOP = [&quot;Manual&quot;, &quot;Auto&quot;]<br>
+LIST_STE_TYPE = [&quot;Off&quot;, &quot;Silent&quot;, &quot;120 Degree&quot;, &quot;180 Degree&quot;, &quot;240 Degree&quot;]<br>
+LIST_STE_FREQ = [&quot;Off&quot;, &quot;55.2 Hz&quot;, &quot;259.2 Hz&quot;]<br>
+<br>
+LIST_PRIORITY_CH = [&quot;Off&quot;, &quot;Priority Channel 1&quot;, &quot;Priority Channel 2&quot;,<br>
+                    &quot;Priority Channel 1 + Priority Channel 2&quot;]<br>
+<br>
+LIST_REVERT_CH = [&quot;Selected&quot;, &quot;Selected + TalkBack&quot;, &quot;Priority Channel 1&quot;,<br>
+                  &quot;Priority Channel 2&quot;, &quot;Last Called&quot;, &quot;Last Used&quot;,<br>
+                  &quot;Priority Channel 1 + TalkBack&quot;,<br>
+                  &quot;Priority Channel 2 + TalkBack&quot;]<br>
+<br>
+LIST_TIME50 = [&quot;0.1&quot;, &quot;0.2&quot;, &quot;0.3&quot;, &quot;0.4&quot;, &quot;0.5&quot;,<br>
+               &quot;0.6&quot;, &quot;0.7&quot;, &quot;0.8&quot;, &quot;0.9&quot;, &quot;1.0&quot;,<br>
+               &quot;1.1&quot;, &quot;1.2&quot;, &quot;1.3&quot;, &quot;1.4&quot;, &quot;1.5&quot;,<br>
+               &quot;1.6&quot;, &quot;1.7&quot;, &quot;1.8&quot;, &quot;1.9&quot;, &quot;2.0&quot;,<br>
+               &quot;2.1&quot;, &quot;3.2&quot;, &quot;2.3&quot;, &quot;2.4&quot;, &quot;2.5&quot;,<br>
+               &quot;2.6&quot;, &quot;2.7&quot;, &quot;2.8&quot;, &quot;2.9&quot;, &quot;3.0&quot;,<br>
+               &quot;3.1&quot;, &quot;3.2&quot;, &quot;3.3&quot;, &quot;3.4&quot;, &quot;3.5&quot;,<br>
+               &quot;3.6&quot;, &quot;3.7&quot;, &quot;3.8&quot;, &quot;3.9&quot;, &quot;4.0&quot;,<br>
+               &quot;4.1&quot;, &quot;4.2&quot;, &quot;4.3&quot;, &quot;4.4&quot;, &quot;4.5&quot;,<br>
+               &quot;4.6&quot;, &quot;4.7&quot;, &quot;4.8&quot;, &quot;4.9&quot;, &quot;5.0&quot;]<br>
+LIST_TIME46 = LIST_TIME50[4:]<br>
+<br>
+LIST_RT98V_MODES = [&quot;FreeNet&quot;, &quot;COM&quot;, &quot;COMII&quot;]<br>
+LIST_RT98U_MODES = [&quot;PMR&quot;, &quot;COM&quot;, &quot;COMII&quot;]<br>
+<br>
+LIST_RT98V_FREQS = [&quot;Rx(149 - 149.2 MHz) Tx(149 - 149.2 MHz)&quot;,<br>
+                    &quot;Rx(136 - 174 MHz) Tx(136 - 174 MHz)&quot;,<br>
+                    &quot;Rx(147 - 174 MHz) Tx(147 - 174 MHz)&quot;]<br>
+<br>
+LIST_RT98U_FREQS = [&quot;Rx(446 - 446.2 MHz) Tx(446 - 446.2 MHz)&quot;,<br>
+                    &quot;Rx(400 - 470 MHz) Tx(400 - 470 MHz)&quot;,<br>
+                    &quot;Rx(450 - 470 MHz) Tx(450 - 470 MHz)&quot;]<br>
+<br>
+SETTING_LISTS = {<br>
+        &quot;tuning_step&quot;: LIST_STEP,<br>
+        &quot;timeout_timer&quot;: LIST_TIMEOUT,<br>
+        &quot;auto_power_off&quot;: LIST_APO,<br>
+        &quot;squelch&quot;: LIST_SQUELCH,<br>
+        &quot;display_mode&quot;: LIST_DISPLAY_MODE,<br>
+        &quot;auto_power_on&quot;: LIST_AOP,<br>
+        &quot;ste_type&quot;: LIST_STE_TYPE,<br>
+        &quot;ste_frequency&quot;: LIST_STE_FREQ,<br>
+        &quot;priority_ch&quot;: LIST_PRIORITY_CH,<br>
+        &quot;revert_ch&quot;: LIST_REVERT_CH,<br>
+        &quot;settings2.dropout_delay_time&quot;: LIST_TIME50,<br>
+        &quot;settings2.dwell_time&quot;: LIST_TIME50,<br>
+        &quot;settings2.look_back_time_a&quot;: LIST_TIME46,<br>
+        &quot;settings2.look_back_time_b&quot;: LIST_TIME46<br>
+}<br>
+<br>
+#  RT98  memory map<br>
+#  section: 1  Channel Bank<br>
+#         description of channel bank (199 channels , range 1-199)<br>
+#         Each 32 Byte (0x20 hex)  record:<br>
+#  bytes:bit  type                 description<br>
+#  ---------------------------------------------------------------------------<br>
+#  4          bbcd freq[4]         receive frequency in packed binary coded<br>
+#                                  decimal<br>
+#  4          bbcd offset[4]       transceive offset in packed binary coded<br>
+#                                  decimal (note: +/- direction set by<br>
+#                                  &#39;duplex&#39; field)<br>
+#  1          u8 unknown0<br>
+#  1          u8<br>
+#   :1        reverse:1            reverse flag, 0=off, 1=on (reverses<br>
+#                                  transmit and receive freqencies)<br>
+#   :1        txoff:1              transmitt off flag, 0=transmit, 1=do not<br>
+#                                  transmit<br>
+#   :2        power:2              transmit power setting, value range 0-2,<br>
+#                                  0=low, 1=middle, 2=high<br>
+#   :2        duplex:2             duplex settings, 0=simplex, 1=plus (+)<br>
+#                                  offset, 2=minus(-) offset (see offset field)<br>
+#   :2        channel_width:2      channel spacing, 0=12.5kHz, 1=20kHz, 2=25kHz<br>
+#  1          u8<br>
+#   :2        unknown1:2<br>
+#   :1        talkaround:1         talkaround flag, 0=off, 1=on<br>
+#                                  (bypasses repeater)<br>
+#   :1        squelch_mode:1       squelch mode flag, 0=carrier, 1=ctcss/dcs<br>
+#   :1        rxdcsextra:1         use with rxcode for index of rx DCS to use<br>
+#   :1        rxinv:1              inverse DCS rx polarity flag, 0=N, 1=I<br>
+#   :1        txdcsextra:1         use with txcode for index of tx DCS to use<br>
+#   :1        txinv:1              inverse DCS tx polarity flag, 0=N, 1=I<br>
+#  1          u8<br>
+#   :4        unknown2:4<br>
+#   :2        rxtmode:2            rx tone mode, value range 0-2, 0=none,<br>
+#                                  1=CTCSS, 2=DCS  (ctcss tone in field rxtone)<br>
+#   :2        txtmode:2            tx tone mode, value range 0-2, 0=none,<br>
+#                                  1=CTCSS, 3=DCS  (ctcss tone in field txtone)<br>
+#  1          u8<br>
+#   :2        unknown3:2<br>
+#   :6        txtone:6             tx ctcss tone, menu index<br>
+#  1          u8<br>
+#   :2        unknown4:2<br>
+#   :6        rxtone:6             rx ctcss tone, menu index<br>
+#  1          u8 txcode            ?, not used for ctcss<br>
+#  1          u8 rxcode            ?, not used for ctcss<br>
+#  1          u8<br>
+#   :6        unknown5:6<br>
+#   :1        busychannellockout:1 busy channel lockout flag, 0=off, 1=enabled<br>
+#   :1        unknown6:1<br>
+#  6          char name[6]         6 byte char string for channel name<br>
+#  9          u8 unknown7[9]<br>
+#<br>
+MEM_FORMAT = &quot;&quot;&quot;<br>
+#seekto 0x0000;<br>
+struct {<br>
+  bbcd freq[4];<br>
+  bbcd offset[4];<br>
+  u8 unknown0;<br>
+  u8 reverse:1,<br>
+     tx_off:1,<br>
+     txpower:2,<br>
+     duplex:2,<br>
+     channel_width:2;<br>
+  u8 unknown1:2,<br>
+     talkaround:1,<br>
+     squelch_mode:1,<br>
+     rxdcsextra:1,<br>
+     rxinv:1,<br>
+     txdcsextra:1,<br>
+     txinv:1;<br>
+  u8 unknown2:4,<br>
+     rxtmode:2,<br>
+     txtmode:2;<br>
+  u8 unknown3:2,<br>
+     txtone:6;<br>
+  u8 unknown4:2,<br>
+     rxtone:6;<br>
+  u8 txcode;<br>
+  u8 rxcode;<br>
+  u8 unknown5:6,<br>
+     busychannellockout:1,<br>
+     unknown6:1;<br>
+  char name[6];<br>
+  u8 unknown7[9];<br>
+} memory[199];<br>
+&quot;&quot;&quot;<br>
+<br>
+#  RT98  memory map<br>
+#  section: 2 and 3  Channel Set/Skip Flags<br>
+#<br>
+#    Channel Set (starts 0x3240) : Channel Set  bit is value 0 if a memory<br>
+#                                  location in the channel bank is active.<br>
+#    Channel Skip (starts 0x3260): Channel Skip bit is value 0 if a memory<br>
+#                                  location in the channel bank is active.<br>
+#<br>
+#    Both flag maps are a total 24 bytes in length, aligned on 32 byte records.<br>
+#    bit = 0 channel not set/skip,  1 is channel set/no skip<br>
+#<br>
+#    to index a channel:<br>
+#        cbyte = channel / 8 ;<br>
+#        cbit  = channel % 8 ;<br>
+#        setflag  = csetflag[cbyte].c[cbit] ;<br>
+#        skipflag = cskipflag[cbyte].c[cbit] ;<br>
+#<br>
+#    channel range is 1-199, range is 32 bytes (last 7 unknown)<br>
+#<br>
+MEM_FORMAT = MEM_FORMAT + &quot;&quot;&quot;<br>
+#seekto 0x3240;<br>
+struct {<br>
+   bit c[8];<br>
+} csetflag[32];<br>
+<br>
+#seekto 0x3260;<br>
+struct {<br>
+   bit c[8];<br>
+} cskipflag[32];<br>
+<br>
+&quot;&quot;&quot;<br>
+<br>
+#  RT98  memory map<br>
+#  section: 4  Startup Label<br>
+#<br>
+#  bytes:bit  type                 description<br>
+#  ---------------------------------------------------------------------------<br>
+#  6          char start_label[6]  label displayed at startup (usually<br>
+#                                  your call sign)<br>
+#<br>
+MEM_FORMAT = MEM_FORMAT + &quot;&quot;&quot;<br>
+#seekto 0x3300;<br>
+struct {<br>
+    char startname[6];<br>
+} slabel;<br>
+&quot;&quot;&quot;<br>
+<br>
+#  RT98  memory map<br>
+#  section: 5, 6 and 7  Radio Options<br>
+#        used to set a number of radio options<br>
+#<br>
+# description of function setup options, starting at 0x3310 (settings3)<br>
+#<br>
+#  bytes:bit  type                 description<br>
+#  ---------------------------------------------------------------------------<br>
+#  1          u8<br>
+#   :6        unknown:6<br>
+#   :2        bandlimit_3310:2     frequency ranges, range 0-2,<br>
+#                                  0=freenet(vhf) or pmr(uhf), 1=com, 2=comii<br>
+#                   rt98v - 00 FreeNet Rx(149 - 149.2 MHz) Tx(149 - 149.2 MHz)<br>
+#                           01 COM     Rx(136 - 174 MHz) Tx(136 - 174 MHz)<br>
+#                           02 COMII   Rx(147 - 174 MHz) Tx(147 - 174 MHz)<br>
+#                   rt98u - 00 PMR     Rx(446 - 446.2 MHz) Tx(446 - 446.2 MHz)<br>
+#                           01 COM     Rx(400 - 470 MHz) Tx(400 - 470 MHz)<br>
+#                           02 COMII   Rx(450 - 470 MHz) Tx(450 - 470 MHz)<br>
+#  1          u8 ch_number;        channel number, range 1-199<br>
+#<br>
+# description of function setup options, starting at 0x3340 (settings)<br>
+#<br>
+#  bytes:bit  type                   description<br>
+#  ---------------------------------------------------------------------------<br>
+#  1          u8<br>
+#   :4        unknown_3340:4<br>
+#   :4        tuning_step:4          tuning step, menu index value from 0-8<br>
+#                                    2.5, 5, 6.25, 10, 12.5, 20, 25, 30, 50<br>
+#  1          u8<br>
+#   :7        unknown_3341:7<br>
+#   :1        beep:1                 beep mode, range 0-1, 0=off, 1=on<br>
+#  1           u8<br>
+#   :3        unknown_3342:3<br>
+#   :5        timeout_timer:5        timeout timer, range off (no timeout),<br>
+#                                    1-30 minutes<br>
+#  1          u8<br>
+#   :6        unknown_3343:6<br>
+#   :2        auto_power_off:2       auto power off, range 0-3, off, 30min,<br>
+#                                    1hr, 2hr<br>
+#  1          u8<br>
+#   :4        unknown_3344:4<br>
+#   :4        squelch:4              squelch level, range off, 1-9<br>
+#  1          u8<br>
+#   :3        unknown_3345:3<br>
+#   :5        volume:5               volume level, range 1-30 (no zero)<br>
+#  1          u8 unknown_3346<br>
+#  1          u8 unknown_3347<br>
+#  1          u8   0x3348 [12]<br>
+#   :6        unknown_3348:6<br>
+#   :2        display_mode           display mode, range 0-2, 0=channel,<br>
+#                                    1=frequency, 2=name<br>
+#  1           u8<br>
+#   :7        unknown_3349:7<br>
+#   :1        auto_power_on:1        auto power on, range 0-1, 0=manual,<br>
+#                                    1=auto<br>
+#  1          u8<br>
+#   :3        unknown_334A:3<br>
+#   :5        mic_gain:5             mic gain, range 1-30 (no zero)<br>
+#  1          u8<br>
+#   :5        unknown_334C:5<br>
+#   :3        ste_type:3             ste type, range 0-4, 0=off, 1=silent,<br>
+#                                    2=120degree, 3=180degree, 4=240degree<br>
+#  1          u8<br>
+#   :7        unknown_334D:7<br>
+#   :1        ste_frequency:1        ste frequency, range 0-2, 0=off,<br>
+#                                    1=55.2Hz, 2=259.2Hz<br>
+#  1          u8<br>
+#   :2        unknown_0x334E:2<br>
+#   :1        forbid_setting:1       forbid setting(optional function),<br>
+#                                    range 0-1, 0=disabled, 1=enabled<br>
+#   :1        forbid_initialize:1    forbid initialize operate, range 0-1,<br>
+#                                    0=enabled, 1=disabled (inverted)<br>
+#   :1        save_chan_param:1      save channel parameters, range 0-1,<br>
+#                                    0=disabled, 1=enabled<br>
+#   :1        forbid_chan_menu:1     forbid channel menu, range 0-1,<br>
+#                                    0=disabled, 1=enabled<br>
+#   :1        sql_key_function:1     sql key function, range 0-1,<br>
+#                                    0=squelch off momentary, 1=squelch off<br>
+#   :1        unknown:1<br>
+#<br>
+# description of function setup options, starting at 0x3380 (settings2)<br>
+#<br>
+#  bytes:bit  type                   description<br>
+#  ---------------------------------------------------------------------------<br>
+#  1          u8<br>
+#   :7        unknown_3380:7<br>
+#   :1        scan_mode:1            scan mode, range 0-1, 0=off, 1=on<br>
+#  1          u8<br>
+#   :6        unknown_3381:6<br>
+#   :2        priority_ch:2          priority channel, range 0-3, 0=off,<br>
+#                                    1=priority channel 1,<br>
+#                                    2=priority channel 2,<br>
+#                                    3=priority channel 1 + priority channel 2<br>
+#  1          u8 priority_ch1        priority channel 1 number, range 1-199<br>
+#  1          u8 priority_ch2        priority channel 2 number, range 1-199<br>
+#  1          u8<br>
+#   :4        unknown_3384:4<br>
+#   :4        revert_ch:4            revert channel, range 0-3, 0=selected,<br>
+#                                    1=selected + talkback, 2=last called,<br>
+#                                    3=last used<br>
+#  1          u8 look_back_time_a    look back time a, range 0-45<br>
+#  1          u8 look_back_time_b    look back time b, range 0-45<br>
+#  1          u8 dropout_delay_time  dropout delay time, range 0-49<br>
+#  1          u8 dwell_time          dwell time, range 0-49<br>
+#<br>
+MEM_FORMAT = MEM_FORMAT + &quot;&quot;&quot;<br>
+#seekto 0x3310;<br>
+struct {<br>
+    u8 bandlimit;<br>
+    u8 ch_number;<br>
+} settings3;<br>
+&quot;&quot;&quot;<br>
+<br>
+MEM_FORMAT = MEM_FORMAT + &quot;&quot;&quot;<br>
+#seekto 0x3340;<br>
+struct {<br>
+  u8 unknown_3340:4,<br>
+     tuning_step:4;<br>
+  u8 unknown_3341:7,<br>
+     beep:1;<br>
+  u8 unknown_3342:3,<br>
+     timeout_timer:5;<br>
+  u8 unknown_3343:6,<br>
+     auto_power_off:2;<br>
+  u8 unknown_3344:4,<br>
+     squelch:4;<br>
+  u8 unknown_3345:3,<br>
+     volume:5;<br>
+  u8 unknown_3346;<br>
+  u8 unknown_3347;<br>
+  u8 unknown_3348:6,<br>
+     display_mode:2;<br>
+  u8 unknown_3349:7,<br>
+     auto_power_on:1;<br>
+  u8 unknown_334A:3,<br>
+     mic_gain:5;<br>
+  u8 unknown_334B;<br>
+  u8 unknown_334C:5,<br>
+     ste_type:3;<br>
+  u8 unknown_334D:6,<br>
+     ste_frequency:2;<br>
+  u8 unknown_334E:1,<br>
+     forbid_setting:1,<br>
+     unknown1:1,<br>
+     forbid_initialize:1,<br>
+     save_chan_param:1,<br>
+     forbid_chan_menu:1,<br>
+     sql_key_function:1,<br>
+     unknown2:1;<br>
+} settings;<br>
+&quot;&quot;&quot;<br>
+<br>
+MEM_FORMAT = MEM_FORMAT + &quot;&quot;&quot;<br>
+#seekto 0x3380;<br>
+struct {<br>
+  u8 unknown_3380:7,<br>
+     scan_mode:1;<br>
+  u8 unknown_3381:6,<br>
+     priority_ch:2;<br>
+  u8 priority_ch1;<br>
+  u8 priority_ch2;<br>
+  u8 unknown_3384:4,<br>
+     revert_ch:4;<br>
+  u8 look_back_time_a;<br>
+  u8 look_back_time_b;<br>
+  u8 dropout_delay_time;<br>
+  u8 dwell_time;<br>
+} settings2;<br>
+&quot;&quot;&quot;<br>
+<br>
+#  RT98  memory map<br>
+#  section: 8  Embedded Messages<br>
+#<br>
+#  bytes:bit  type                 description<br>
+#  ---------------------------------------------------------------------------<br>
+#  6          char radio_type[5]   radio type, vhf=rt98v, uhf=rt98u<br>
+#  2          u8 unknown1[2]<br>
+#  4          char mcu_version[4]  mcu version, [x.xx]<br>
+#  2          u8 unknown2[2]<br>
+#  1          u8 mode              rt98u mode: 0=pmr, 1=com, 2=comii<br>
+#                                  rt98v mode: 0=freenet, 1=com, 2=comii<br>
+#  1          u8 unknown3<br>
+#  10         u8 unused1[10]<br>
+#  4          u8 unknown4[4]<br>
+#  3          u8 unused2[3]<br>
+#  16         u8 unknown5[16]<br>
+#  10         char date_mfg[16]    date manufactured, [yyyy-mm-dd]<br>
+#<br>
+MEM_FORMAT = MEM_FORMAT + &quot;&quot;&quot;<br>
+#seekto 0x3D00;<br>
+struct {<br>
+char radio_type[5];<br>
+u8 unknown1[2];<br>
+char mcu_version[4];<br>
+u8 unknown2[2];<br>
+u8 mode;<br>
+u8 unknown3;<br>
+u8 unused1[10];<br>
+u8 unknown4[4];<br>
+u8 unused2[3];<br>
+u8 unknown5[16];<br>
+char date_mfg[10];<br>
+} embedded_msg;<br>
+&quot;&quot;&quot;<br>
+<br>
+<br>
+# Format for the version messages returned by the radio<br>
+VER_FORMAT = &#39;&#39;&#39;<br>
+u8 hdr;<br>
+char model[5];<br>
+u8 unknown[2];<br>
+u8 bandlimit;<br>
+char version[6];<br>
+u8 ack;<br>
+&#39;&#39;&#39;<br>
+<br>
+<br>
+# Radio supports upper case and symbols<br>
+CHARSET_ASCII_PLUS = chirp_common.CHARSET_UPPER_NUMERIC + &#39;- &#39;<br>
+<br>
+# Band limits as defined by the band byte in ver_response, defined in Hz, for<br>
+# VHF and UHF, used for RX and TX.<br>
+RT98V_BAND_LIMITS = {0x00: [(149000000, 149200000)],<br>
+                     0x01: [(136000000, 174000000)],<br>
+                     0x02: [(147000000, 174000000)]}<br>
+<br>
+RT98U_BAND_LIMITS = {0x00: [(446000000, 446200000)],<br>
+                     0x01: [(400000000, 470000000)],<br>
+                     0x02: [(450000000, 470000000)]}<br>
+<br>
+<br>
+# Get band limits from a band limit value<br>
+def get_band_limits_Hz(radio_type, limit_value):<br>
+    if radio_type == &quot;RT98U&quot;:<br>
+        if limit_value not in RT98U_BAND_LIMITS:<br>
+            limit_value = 0x01<br>
+            LOG.warning(&#39;Unknown band limit value 0x%02x, default to 0x01&#39;)<br>
+        bandlimitfrequencies = RT98U_BAND_LIMITS[limit_value]<br>
+    elif radio_type == &quot;RT98V&quot;:<br>
+        if limit_value not in RT98V_BAND_LIMITS:<br>
+            limit_value = 0x01<br>
+            LOG.warning(&#39;Unknown band limit value 0x%02x, default to 0x01&#39;)<br>
+        bandlimitfrequencies = RT98V_BAND_LIMITS[limit_value]<br>
+    return bandlimitfrequencies<br>
+<br>
+<br>
+def _echo_write(radio, data):<br>
+    try:<br>
+        radio.pipe.write(data)<br>
+        radio.pipe.read(len(data))<br>
+    except Exception, e:<br>
+        LOG.error(&quot;Error writing to radio: %s&quot; % e)<br>
+        raise errors.RadioError(&quot;Unable to write to radio&quot;)<br>
+<br>
+<br>
+def _checksum(data):<br>
+    cs = 0<br>
+    for byte in data:<br>
+        cs += ord(byte)<br>
+    return cs % 256<br>
+<br>
+<br>
+def _read(radio, length):<br>
+    try:<br>
+        data = radio.pipe.read(length)<br>
+    except Exception, e:<br>
+        _finish(radio)<br>
+        LOG.error(&quot;Error reading from radio: %s&quot; % e)<br>
+        raise errors.RadioError(&quot;Unable to read from radio&quot;)<br>
+<br>
+    if len(data) != length:<br>
+        _finish(radio)<br>
+        LOG.error(&quot;Short read from radio (%i, expected %i)&quot; %<br>
+                  (len(data), length))<br>
+        LOG.debug(util.hexprint(data))<br>
+        raise errors.RadioError(&quot;Short read from radio&quot;)<br>
+    return data<br>
+<br>
+<br>
+# strip trailing 0x00 to convert a string returned by bitwise.parse into a<br>
+# python string<br>
+def cstring_to_py_string(cstring):<br>
+    return &quot;&quot;.join(c for c in cstring if c != &#39;\x00&#39;)<br>
+<br>
+<br>
+# Check the radio version reported to see if it&#39;s one we support,<br>
+# returns bool version supported, and the band index<br>
+def check_ver(ver_response, allowed_types):<br>
+    &#39;&#39;&#39; Check the returned radio version is one we approve of &#39;&#39;&#39;<br>
+<br>
+    LOG.debug(&#39;ver_response = &#39;)<br>
+    LOG.debug(util.hexprint(ver_response))<br>
+<br>
+    resp = bitwise.parse(VER_FORMAT, ver_response)<br>
+    verok = False<br>
+<br>
+    if resp.hdr == 0x49 and resp.ack == 0x06:<br>
+        model, version = [cstring_to_py_string(bitwise.get_string(s)).strip()<br>
+                          for s in (resp.model, resp.version)]<br>
+        LOG.debug(&#39;radio model: \&#39;%s\&#39; version: \&#39;%s\&#39;&#39; %<br>
+                  (model, version))<br>
+        LOG.debug(&#39;allowed_types = %s&#39; % allowed_types)<br>
+<br>
+        if model in allowed_types:<br>
+            LOG.debug(&#39;model in allowed_types&#39;)<br>
+<br>
+            if version in allowed_types[model]:<br>
+                LOG.debug(&#39;version in allowed_types[model]&#39;)<br>
+                verok = True<br>
+    else:<br>
+        _finish(radio)<br>
+        raise errors.RadioError(&#39;Failed to parse version response&#39;)<br>
+<br>
+    return verok, str(resp.model), int(resp.bandlimit)<br>
+<br>
+<br>
+def _ident(radio):<br>
+    radio.pipe.timeout = 1<br>
+    _echo_write(radio, &quot;PROGRAM&quot;)<br>
+    response = radio.pipe.read(3)<br>
+    if response != &quot;QX\06&quot;:<br>
+        _finish(radio)<br>
+        LOG.debug(&quot;Response was :\n%s&quot; % util.hexprint(response))<br>
+        raise errors.RadioError(&quot;Radio did not respond. Check connection.&quot;)<br>
+    _echo_write(radio, &quot;\x02&quot;)<br>
+    ver_response = radio.pipe.read(16)<br>
+    LOG.debug(util.hexprint(ver_response))<br>
+<br>
+    verok, model, bandlimit = check_ver(ver_response,<br>
+                                        radio.ALLOWED_RADIO_TYPES)<br>
+    if not verok:<br>
+        _finish(radio)<br>
+        raise errors.RadioError(<br>
+            &#39;Radio version not in allowed list for %s-%s: %s&#39; %<br>
+            (radio.VENDOR, radio.MODEL, util.hexprint(ver_response)))<br>
+<br>
+    return model, bandlimit<br>
+<br>
+<br>
+def _send(radio, cmd, addr, length, data=None):<br>
+    frame = struct.pack(&quot;&gt;cHb&quot;, cmd, addr, length)<br>
+    if data:<br>
+        frame += data<br>
+        frame += chr(_checksum(frame[1:]))<br>
+        frame += &quot;\x06&quot;<br>
+    _echo_write(radio, frame)<br>
+    LOG.debug(&quot;Sent:\n%s&quot; % util.hexprint(frame))<br>
+    if data:<br>
+        result = radio.pipe.read(1)<br>
+        if result != &quot;\x06&quot;:<br>
+            _finish(radio)<br>
+            LOG.debug(&quot;Ack was: %s&quot; % repr(result))<br>
+            raise errors.RadioError(&quot;Radio did not accept block at %04x&quot;<br>
+                                    % addr)<br>
+        return<br>
+    result = _read(radio, length + 6)<br>
+    LOG.debug(&quot;Got:\n%s&quot; % util.hexprint(result))<br>
+    header = result[0:4]<br>
+    data = result[4:-2]<br>
+    ack = result[-1]<br>
+    if ack != &quot;\x06&quot;:<br>
+        _finish(radio)<br>
+        LOG.debug(&quot;Ack was: %s&quot; % repr(ack))<br>
+        raise errors.RadioError(&quot;Radio NAK&#39;d block at %04x&quot; % addr)<br>
+    _cmd, _addr, _length = struct.unpack(&quot;&gt;cHb&quot;, header)<br>
+    if _addr != addr or _length != _length:<br>
+        _finish(radio)<br>
+        LOG.debug(&quot;Expected/Received:&quot;)<br>
+        LOG.debug(&quot; Length: %02x/%02x&quot; % (length, _length))<br>
+        LOG.debug(&quot; Addr: %04x/%04x&quot; % (addr, _addr))<br>
+        raise errors.RadioError(&quot;Radio send unexpected block&quot;)<br>
+    cs = _checksum(result[1:-2])<br>
+    if cs != ord(result[-2]):<br>
+        _finish(radio)<br>
+        LOG.debug(&quot;Calculated: %02x&quot; % cs)<br>
+        LOG.debug(&quot;Actual:     %02x&quot; % ord(result[-2]))<br>
+        raise errors.RadioError(&quot;Block at 0x%04x failed checksum&quot; % addr)<br>
+    return data<br>
+<br>
+<br>
+def _finish(radio):<br>
+    endframe = &quot;\x45\x4E\x44&quot;<br>
+    _echo_write(radio, endframe)<br>
+    result = radio.pipe.read(1)<br>
+    if result != &quot;\x06&quot;:<br>
+        LOG.error(&quot;Got:\n%s&quot; % util.hexprint(result))<br>
+        raise errors.RadioError(&quot;Radio did not finish cleanly&quot;)<br>
+<br>
+<br>
+def do_download(radio):<br>
+<br>
+    _ident(radio)<br>
+<br>
+    _memobj = None<br>
+    data = &quot;&quot;<br>
+<br>
+    for addr in range(0, radio._memsize, 0x10):<br>
+        block = _send(radio, &#39;R&#39;, addr, 0x10)<br>
+        data += block<br>
+        status = chirp_common.Status()<br>
+        status.cur = len(data)<br>
+        status.max = radio._memsize<br>
+        status.msg = &quot;Downloading from radio&quot;<br>
+        radio.status_fn(status)<br>
+<br>
+    _finish(radio)<br>
+<br>
+    return memmap.MemoryMap(data)<br>
+<br>
+<br>
+def do_upload(radio):<br>
+    model, bandlimit = _ident(radio)<br>
+    _embedded = radio._memobj.embedded_msg<br>
+<br>
+    if model != str(_embedded.radio_type):<br>
+        LOG.warning(&#39;radio and image model types differ&#39;)<br>
+        LOG.warning(&#39;model type (radio): %s&#39; % str(model))<br>
+        LOG.warning(&#39;model type (image): %s&#39; % str(_embedded.radio_type))<br>
+<br>
+        _finish(radio)<br>
+<br>
+        msg = (&quot;The upload was stopped because the radio type &quot;<br>
+               &quot;of the image (%s) does not match that &quot;<br>
+               &quot;of the radio (%s).&quot;)<br>
+        raise errors.RadioError(msg % (str(_embedded.radio_type), str(model)))<br>
+<br>
+    if bandlimit != int(_embedded.mode):<br>
+        if str(_embedded.radio_type) == &quot;RT98U&quot;:<br>
+            image_band_limits = LIST_RT98U_FREQS[int(_embedded.mode)]<br>
+        if str(_embedded.radio_type) == &quot;RT98V&quot;:<br>
+            image_band_limits = LIST_RT98V_FREQS[int(_embedded.mode)]<br>
+        if model == &quot;RT98U&quot;:<br>
+            radio_band_limits = LIST_RT98U_FREQS[int(bandlimit)]<br>
+        if model == &quot;RT98V&quot;:<br>
+            radio_band_limits = LIST_RT98V_FREQS[int(bandlimit)]<br>
+<br>
+        LOG.warning(&#39;radio and image band limits differ&#39;)<br>
+        LOG.warning(&#39;image band limits: %s&#39; % image_band_limits)<br>
+        LOG.warning(&#39;radio band limits: %s&#39; % radio_band_limits)<br>
+<br>
+        _finish(radio)<br>
+<br>
+        msg = (&quot;The upload was stopped because the band limits &quot;<br>
+               &quot;of the image (%s) does not match that &quot;<br>
+               &quot;of the radio (%s).&quot;)<br>
+        raise errors.RadioError(msg % (image_band_limits, radio_band_limits))<br>
+<br>
+    try:<br>
+        for start, end in radio._ranges:<br>
+            for addr in range(start, end, 0x10):<br>
+                block = radio._mmap[addr:addr+0x10]<br>
+                _send(radio, &#39;W&#39;, addr, len(block), block)<br>
+                status = chirp_common.Status()<br>
+                status.cur = addr<br>
+                status.max = end<br>
+                status.msg = &quot;Uploading to Radio&quot;<br>
+                radio.status_fn(status)<br>
+        _finish(radio)<br>
+    except errors.RadioError:<br>
+        raise<br>
+    except Exception as e:<br>
+        _finish(radio)<br>
+        raise errors.RadioError(&#39;Failed to upload to radio: %s&#39; % e)<br>
+<br>
+<br>
+#<br>
+# The base class, extended for use with other models<br>
+#<br>
+class Rt98BaseRadio(chirp_common.CloneModeRadio,<br>
+                    chirp_common.ExperimentalRadio):<br>
+    &quot;&quot;&quot;Retevis RT98 Base&quot;&quot;&quot;<br>
+    VENDOR = &quot;Retevis&quot;<br>
+    MODEL = &quot;RT98 Base&quot;<br>
+    BAUD_RATE = 9600<br>
+<br>
+    _memsize = 0x3E00<br>
+    _ranges = [(0x0000, 0x3310),<br>
+               (0x3320, 0x3390)]<br>
+<br>
+    @classmethod<br>
+    def get_prompts(cls):<br>
+        rp = chirp_common.RadioPrompts()<br>
+        rp.experimental = (&quot;The Retevis RT98 driver is an beta version.&quot;<br>
+                           &quot;Proceed with Caution and backup your data&quot;)<br>
+        return rp<br>
+<br>
+    def get_features(self):<br>
+        _embedded = self._memobj.embedded_msg<br>
+        rf = chirp_common.RadioFeatures()<br>
+        rf.has_settings = True<br>
+        rf.has_bank = False<br>
+        rf.can_odd_split = True<br>
+        rf.has_name = True<br>
+        if _embedded.mode == 0:  # PMR or FreeNet<br>
+            rf.has_offset = False<br>
+        else:<br>
+            rf.has_offset = True<br>
+        rf.has_ctone = True<br>
+        rf.has_cross = True<br>
+        rf.has_tuning_step = False<br>
+        rf.has_dtcs = True<br>
+        rf.has_rx_dtcs = True<br>
+        rf.has_dtcs_polarity = True<br>
+        rf.valid_skips = [&quot;&quot;, &quot;S&quot;]<br>
+        rf.memory_bounds = (1, 199)<br>
+        rf.valid_name_length = 6<br>
+        if _embedded.mode == 0:  # PMR or FreeNet<br>
+            rf.valid_duplexes = [&#39;&#39;]<br>
+        else:<br>
+            rf.valid_duplexes = DUPLEXES + [&#39;split&#39;, &#39;off&#39;]<br>
+        rf.valid_characters = chirp_common.CHARSET_UPPER_NUMERIC + &quot;- &quot;<br>
+        if _embedded.mode == 0:  # PMR or FreeNet<br>
+            rf.valid_modes = [&#39;NFM&#39;]<br>
+        else:<br>
+            rf.valid_modes = [&#39;FM&#39;, &#39;NFM&#39;]<br>
+        rf.valid_tmodes = [&#39;&#39;, &#39;Tone&#39;, &#39;TSQL&#39;, &#39;DTCS&#39;, &#39;Cross&#39;]<br>
+        rf.valid_cross_modes = CROSS_MODES<br>
+        if _embedded.mode == 0:  # PMR or FreeNet<br>
+            if str(_embedded.radio_type) == &quot;RT98U&quot;:<br>
+                rf.valid_power_levels = PMR_POWER_LEVELS<br>
+            if str(_embedded.radio_type) == &quot;RT98V&quot;:<br>
+                rf.valid_power_levels = FREENET_POWER_LEVELS<br>
+        else:<br>
+            rf.valid_power_levels = POWER_LEVELS<br>
+        rf.valid_dtcs_codes = chirp_common.ALL_DTCS_CODES<br>
+<br>
+        try:<br>
+            rf.valid_bands = get_band_limits_Hz(<br>
+                str(_embedded.radio_type),<br>
+                int(_embedded.mode))<br>
+        except TypeError as e:<br>
+            # If we&#39;re asked without memory loaded, assume the most permissive<br>
+            rf.valid_bands = get_band_limits_Hz(str(_embedded.radio_type), 1)<br>
+        except Exception as e:<br>
+            LOG.error(&#39;Failed to get band limits for RT98: %s&#39; % e)<br>
+            rf.valid_bands = get_band_limits_Hz(str(_embedded.radio_type), 1)<br>
+<br>
+        rf.valid_tuning_steps = TUNING_STEPS<br>
+        return rf<br>
+<br>
+    def validate_memory(self, mem):<br>
+        _embedded = self._memobj.embedded_msg<br>
+        msgs = &quot;&quot;<br>
+        msgs = chirp_common.CloneModeRadio.validate_memory(self, mem)<br>
+<br>
+        # FreeNet and PMR radio types<br>
+        if _embedded.mode == 0:  # PMR or FreeNet<br>
+            freq = float(mem.freq) / 1000000<br>
+<br>
+            # FreeNet<br>
+            if str(_embedded.radio_type) == &quot;RT98V&quot;:<br>
+                if freq not in FREENET_FREQS:<br>
+                    _msg_freq = &#39;Memory location not a valid FreeNet frequency&#39;<br>
+                    # warn user invalid frequency<br>
+                    msgs.append(chirp_common.ValidationError(_msg_freq))<br>
+<br>
+            # PMR<br>
+            if str(_embedded.radio_type) == &quot;RT98U&quot;:<br>
+                if freq not in PMR_FREQS:<br>
+                    _msg_freq = &#39;Memory location not a valid PMR frequency&#39;<br>
+                    # warn user invalid frequency<br>
+                    msgs.append(chirp_common.ValidationError(_msg_freq))<br>
+<br>
+        return msgs<br>
+<br>
+    # Do a download of the radio from the serial port<br>
+    def sync_in(self):<br>
+        self._mmap = do_download(self)<br>
+        self.process_mmap()<br>
+<br>
+    # Do an upload of the radio to the serial port<br>
+    def sync_out(self):<br>
+        do_upload(self)<br>
+<br>
+    def process_mmap(self):<br>
+        self._memobj = bitwise.parse(MEM_FORMAT, self._mmap)<br>
+<br>
+    # Return a raw representation of the memory object, which<br>
+    # is very helpful for development<br>
+    def get_raw_memory(self, number):<br>
+        return repr(self._memobj.memory[number - 1])<br>
+<br>
+    def _get_dcs_index(self, _mem, which):<br>
+        base = getattr(_mem, &#39;%scode&#39; % which)<br>
+        extra = getattr(_mem, &#39;%sdcsextra&#39; % which)<br>
+        return (int(extra) &lt;&lt; 8) | int(base)<br>
+<br>
+    def _set_dcs_index(self, _mem, which, index):<br>
+        base = getattr(_mem, &#39;%scode&#39; % which)<br>
+        extra = getattr(_mem, &#39;%sdcsextra&#39; % which)<br>
+        base.set_value(index &amp; 0xFF)<br>
+        extra.set_value(index &gt;&gt; 8)<br>
+<br>
+    # Extract a high-level memory object from the low-level memory map<br>
+    # This is called to populate a memory in the UI<br>
+    def get_memory(self, number):<br>
+        _embedded = self._memobj.embedded_msg<br>
+        # Get a low-level memory object mapped to the image<br>
+        _mem = self._memobj.memory[number - 1]<br>
+<br>
+        # get flag info<br>
+        cbyte = (number - 1) / 8<br>
+        cbit = 7 - ((number - 1) % 8)<br>
+        setflag = self._memobj.csetflag[cbyte].c[cbit]<br>
+        skipflag = self._memobj.cskipflag[cbyte].c[cbit]<br>
+<br>
+        mem = chirp_common.Memory()<br>
+<br>
+        mem.number = number  # Set the memory number<br>
+<br>
+        # We&#39;ll consider any blank (i.e. 0MHz frequency) to be empty<br>
+        if _mem.freq == 0:<br>
+            mem.empty = True<br>
+            return mem<br>
+<br>
+        if setflag == 0:<br>
+            mem.empty = True<br>
+            return mem<br>
+<br>
+        if _mem.get_raw()[0] == &quot;\xFF&quot;:<br>
+            mem.empty = True<br>
+            return mem<br>
+<br>
+        # set the name<br>
+        <a href="http://mem.name" rel="noreferrer" target="_blank">mem.name</a> = str(_<a href="http://mem.name" rel="noreferrer" target="_blank">mem.name</a>).rstrip()  # Set the alpha tag<br>
+<br>
+        # Convert your low-level frequency and offset to Hertz<br>
+        mem.freq = int(_mem.freq) * 10<br>
+        mem.offset = int(_mem.offset) * 10<br>
+<br>
+        # Set the duplex flags<br>
+        if _mem.duplex == DUPLEX_POSSPLIT:<br>
+            mem.duplex = &#39;+&#39;<br>
+        elif _mem.duplex == DUPLEX_NEGSPLIT:<br>
+            mem.duplex = &#39;-&#39;<br>
+        elif _mem.duplex == DUPLEX_NOSPLIT:<br>
+            mem.duplex = &#39;&#39;<br>
+        elif _mem.duplex == DUPLEX_ODDSPLIT:<br>
+            mem.duplex = &#39;split&#39;<br>
+        else:<br>
+            LOG.error(&#39;%s: get_mem: unhandled duplex: %02x&#39; %<br>
+                      (<a href="http://mem.name" rel="noreferrer" target="_blank">mem.name</a>, _mem.duplex))<br>
+<br>
+        # handle tx off<br>
+        if _mem.tx_off:<br>
+            mem.duplex = &#39;off&#39;<br>
+<br>
+        # Set the channel width<br>
+        if _mem.channel_width == CHANNEL_WIDTH_12d5kHz:<br>
+            mem.mode = &#39;NFM&#39;<br>
+        elif _embedded.mode == 0:  # PMR or FreeNet<br>
+            LOG.info(&#39;PMR and FreeNet channels must be Channel Width 12.5kHz&#39;)<br>
+            mem.mode = &#39;NFM&#39;<br>
+        elif _mem.channel_width == CHANNEL_WIDTH_25kHz:<br>
+            mem.mode = &#39;FM&#39;<br>
+        elif _mem.channel_width == CHANNEL_WIDTH_20kHz:<br>
+            LOG.info(<br>
+                &#39;%s: get_mem: promoting 20kHz channel width to 25kHz&#39; %<br>
+                <a href="http://mem.name" rel="noreferrer" target="_blank">mem.name</a>)<br>
+            mem.mode = &#39;FM&#39;<br>
+        else:<br>
+            LOG.error(&#39;%s: get_mem: unhandled channel width: 0x%02x&#39; %<br>
+                      (<a href="http://mem.name" rel="noreferrer" target="_blank">mem.name</a>, _mem.channel_width))<br>
+<br>
+        # set the power level<br>
+        if _embedded.mode == 0:  # PMR or FreeNet<br>
+            if str(_embedded.radio_type) == &quot;RT98U&quot;:<br>
+                LOG.info(&#39;using PMR power levels&#39;)<br>
+                _levels = PMR_POWER_LEVELS<br>
+            if str(_embedded.radio_type) == &quot;RT98V&quot;:<br>
+                LOG.info(&#39;using FreeNet power levels&#39;)<br>
+                _levels = FREENET_POWER_LEVELS<br>
+        else:  # COM or COMII<br>
+            LOG.info(&#39;using general power levels&#39;)<br>
+            _levels = POWER_LEVELS<br>
+<br>
+        if _mem.txpower == TXPOWER_LOW:<br>
+            mem.power = _levels[0]<br>
+        elif _embedded.mode == 0:  # PMR or FreeNet<br>
+            LOG.info(&#39;FreeNet or PMR channel is not set to TX Power Low&#39;)<br>
+            LOG.info(&#39;Setting channel to TX Power Low&#39;)<br>
+            mem.power = _levels[0]<br>
+        elif _mem.txpower == TXPOWER_MED:<br>
+            mem.power = _levels[1]<br>
+        elif _mem.txpower == TXPOWER_HIGH:<br>
+            mem.power = _levels[2]<br>
+        else:<br>
+            LOG.error(&#39;%s: get_mem: unhandled power level: 0x%02x&#39; %<br>
+                      (<a href="http://mem.name" rel="noreferrer" target="_blank">mem.name</a>, _mem.txpower))<br>
+<br>
+        # CTCSS Tones and DTCS Codes<br>
+        rxtone = txtone = None<br>
+<br>
+        rxmode = TMODES[_mem.rxtmode]<br>
+        txmode = TMODES[_mem.txtmode]<br>
+<br>
+        if rxmode == &quot;Tone&quot;:<br>
+            rxtone = TONES[_mem.rxtone]<br>
+        elif rxmode == &quot;DTCS&quot;:<br>
+            rxtone = chirp_common.ALL_DTCS_CODES[self._get_dcs_index(<br>
+                                                 _mem, &#39;rx&#39;)]<br>
+<br>
+        if txmode == &quot;Tone&quot;:<br>
+            txtone = TONES[_mem.txtone]<br>
+        elif txmode == &quot;DTCS&quot;:<br>
+            txtone = chirp_common.ALL_DTCS_CODES[self._get_dcs_index(<br>
+                                                 _mem, &#39;tx&#39;)]<br>
+<br>
+        rxpol = _mem.rxinv and &quot;R&quot; or &quot;N&quot;<br>
+        txpol = _mem.txinv and &quot;R&quot; or &quot;N&quot;<br>
+<br>
+        chirp_common.split_tone_decode(mem,<br>
+                                       (txmode, txtone, txpol),<br>
+                                       (rxmode, rxtone, rxpol))<br>
+<br>
+        # Check if this memory is in the scan enabled list<br>
+        mem.skip = &quot;S&quot; if skipflag == 0 else &quot;&quot;<br>
+<br>
+        # Extra<br>
+        mem.extra = RadioSettingGroup(&quot;extra&quot;, &quot;Extra&quot;)<br>
+<br>
+        rs = RadioSettingValueBoolean(bool(_mem.busychannellockout))<br>
+        rset = RadioSetting(&quot;busychannellockout&quot;, &quot;Busy channel lockout&quot;, rs)<br>
+        mem.extra.append(rset)<br>
+<br>
+        rs = RadioSettingValueBoolean(bool(_mem.reverse))<br>
+        rset = RadioSetting(&quot;reverse&quot;, &quot;Reverse&quot;, rs)<br>
+        mem.extra.append(rset)<br>
+<br>
+        rs = RadioSettingValueBoolean(bool(_mem.talkaround))<br>
+        rset = RadioSetting(&quot;talkaround&quot;, &quot;Talk around&quot;, rs)<br>
+        mem.extra.append(rset)<br>
+<br>
+        rs = RadioSettingValueBoolean(bool(_mem.squelch_mode))<br>
+        rset = RadioSetting(&quot;squelch_mode&quot;, &quot;Squelch mode&quot;, rs)<br>
+        mem.extra.append(rset)<br>
+<br>
+        return mem<br>
+<br>
+    # Store details about a high-level memory to the memory map<br>
+    # This is called when a user edits a memory in the UI<br>
+    def set_memory(self, mem):<br>
+        _embedded = self._memobj.embedded_msg<br>
+        # Get a low-level memory object mapped to the image<br>
+<br>
+        _mem = self._memobj.memory[mem.number - 1]<br>
+<br>
+        cbyte = (mem.number - 1) / 8<br>
+        cbit = 7 - ((mem.number - 1) % 8)<br>
+<br>
+        if mem.empty:<br>
+            self._memobj.csetflag[cbyte].c[cbit] = 0<br>
+            self._memobj.cskipflag[cbyte].c[cbit] = 0<br>
+            _mem.set_raw(&#39;\xff&#39; * (_mem.size() / 8))<br>
+            return<br>
+<br>
+        _mem.set_raw(&#39;\x00&#39; * (_mem.size() / 8))<br>
+<br>
+        # set the occupied bitfield<br>
+        self._memobj.csetflag[cbyte].c[cbit] = 1<br>
+        # set the scan add bitfield<br>
+        self._memobj.cskipflag[cbyte].c[cbit] = 0 if (mem.skip == &quot;S&quot;) else 1<br>
+<br>
+        _mem.freq = mem.freq / 10             # Convert to low-level frequency<br>
+        _mem.offset = mem.offset / 10         # Convert to low-level frequency<br>
+<br>
+        # Store the alpha tag<br>
+        _<a href="http://mem.name" rel="noreferrer" target="_blank">mem.name</a> = mem.name.ljust(6)[:6]  # Store the alpha tag<br>
+<br>
+        # Set duplex bitfields<br>
+        if mem.duplex == &#39;+&#39;:<br>
+            _mem.duplex = DUPLEX_POSSPLIT<br>
+        elif mem.duplex == &#39;-&#39;:<br>
+            _mem.duplex = DUPLEX_NEGSPLIT<br>
+        elif mem.duplex == &#39;&#39;:<br>
+            _mem.duplex = DUPLEX_NOSPLIT<br>
+        elif mem.duplex == &#39;split&#39;:<br>
+            diff = mem.offset - mem.freq<br>
+            _mem.duplex = DUPLEXES.index(&quot;-&quot;) \<br>
+                if diff &lt; 0 else DUPLEXES.index(&quot;+&quot;)<br>
+            _mem.offset = abs(diff) / 10<br>
+        else:<br>
+            LOG.error(&#39;%s: set_mem: unhandled duplex: %s&#39; %<br>
+                      (<a href="http://mem.name" rel="noreferrer" target="_blank">mem.name</a>, mem.duplex))<br>
+<br>
+        # handle tx off<br>
+        _mem.tx_off = 0<br>
+        if mem.duplex == &#39;off&#39;:<br>
+            _mem.tx_off = 1<br>
+<br>
+        # Set the channel width - remember we promote 20kHz channels to FM<br>
+        # on import, so don&#39;t handle them here<br>
+        if mem.mode == &#39;FM&#39;:<br>
+            _mem.channel_width = CHANNEL_WIDTH_25kHz<br>
+        elif mem.mode == &#39;NFM&#39;:<br>
+            _mem.channel_width = CHANNEL_WIDTH_12d5kHz<br>
+        else:<br>
+            LOG.error(&#39;%s: set_mem: unhandled mode: %s&#39; % (<br>
+                <a href="http://mem.name" rel="noreferrer" target="_blank">mem.name</a>, mem.mode))<br>
+<br>
+        # CTCSS Tones and DTCS Codes<br>
+        ((txmode, txtone, txpol),<br>
+         (rxmode, rxtone, rxpol)) = chirp_common.split_tone_encode(mem)<br>
+<br>
+        _mem.txtmode = TMODES.index(txmode)<br>
+<br>
+        _mem.rxtmode = TMODES.index(rxmode)<br>
+<br>
+        if txmode == &quot;Tone&quot;:<br>
+            _mem.txtone = TONES.index(txtone)<br>
+        elif txmode == &quot;DTCS&quot;:<br>
+            self._set_dcs_index(_mem, &#39;tx&#39;,<br>
+                                chirp_common.ALL_DTCS_CODES.index(txtone))<br>
+<br>
+        _mem.squelch_mode = False<br>
+        if rxmode == &quot;Tone&quot;:<br>
+            _mem.rxtone = TONES.index(rxtone)<br>
+            _mem.squelch_mode = True<br>
+        elif rxmode == &quot;DTCS&quot;:<br>
+            self._set_dcs_index(_mem, &#39;rx&#39;,<br>
+                                chirp_common.ALL_DTCS_CODES.index(rxtone))<br>
+            _mem.squelch_mode = True<br>
+<br>
+        _mem.txinv = txpol == &quot;R&quot;<br>
+        _mem.rxinv = rxpol == &quot;R&quot;<br>
+<br>
+        # set the power level<br>
+        if mem.power == POWER_LEVELS[0]:<br>
+            _mem.txpower = TXPOWER_LOW<br>
+        elif mem.power == POWER_LEVELS[1]:<br>
+            _mem.txpower = TXPOWER_MED<br>
+        elif mem.power == POWER_LEVELS[2]:<br>
+            _mem.txpower = TXPOWER_HIGH<br>
+        else:<br>
+            LOG.error(&#39;%s: set_mem: unhandled power level: %s&#39; %<br>
+                      (<a href="http://mem.name" rel="noreferrer" target="_blank">mem.name</a>, mem.power))<br>
+<br>
+        # extra settings<br>
+        for setting in mem.extra:<br>
+            setattr(_mem, setting.get_name(), setting.value)<br>
+<br>
+    def _get_settings(self):<br>
+        _embedded = self._memobj.embedded_msg<br>
+        _settings = self._memobj.settings<br>
+        _settings2 = self._memobj.settings2<br>
+        _settings3 = self._memobj.settings3<br>
+        _slabel = self._memobj.slabel<br>
+<br>
+        function = RadioSettingGroup(&quot;function&quot;, &quot;Function Setup&quot;)<br>
+        group = RadioSettings(function)<br>
+<br>
+        # Function Setup<br>
+        # MODE SET<br>
+        rs = RadioSettingValueList(LIST_DISPLAY_MODE,<br>
+                                   LIST_DISPLAY_MODE[_settings.display_mode])<br>
+        rset = RadioSetting(&quot;display_mode&quot;, &quot;Display Mode&quot;, rs)<br>
+        function.append(rset)<br>
+<br>
+        rs = RadioSettingValueInteger(1, 199, _settings3.ch_number + 1)<br>
+        rset = RadioSetting(&quot;settings3.ch_number&quot;, &quot;Channel Number&quot;, rs)<br>
+        function.append(rset)<br>
+<br>
+        # DISPLAY SET<br>
+        def _filter(name):<br>
+            filtered = &quot;&quot;<br>
+            for char in str(name):<br>
+                if char in chirp_common.CHARSET_ASCII:<br>
+                    filtered += char<br>
+                else:<br>
+                    filtered += &quot; &quot;<br>
+            return filtered<br>
+<br>
+        val = RadioSettingValueString(0, 6, _filter(_slabel.startname))<br>
+        rs = RadioSetting(&quot;slabel.startname&quot;, &quot;Startup Label&quot;, val)<br>
+        function.append(rs)<br>
+<br>
+        # VOL SET<br>
+        rs = RadioSettingValueBoolean(bool(_settings.beep))<br>
+        rset = RadioSetting(&quot;beep&quot;, &quot;Beep Prompt&quot;, rs)<br>
+        function.append(rset)<br>
+<br>
+        rs = RadioSettingValueInteger(1, 30, _settings.volume)<br>
+        rset = RadioSetting(&quot;volume&quot;, &quot;Volume Level&quot;, rs)<br>
+        function.append(rset)<br>
+<br>
+        rs = RadioSettingValueInteger(1, 16, _settings.mic_gain)<br>
+        rset = RadioSetting(&quot;mic_gain&quot;, &quot;Mic Gain&quot;, rs)<br>
+        function.append(rset)<br>
+<br>
+        # ON/OFF SET<br>
+        rs = RadioSettingValueList(LIST_APO,<br>
+                                   LIST_APO[_settings.auto_power_off])<br>
+        rset = RadioSetting(&quot;auto_power_off&quot;, &quot;Auto Power Off&quot;, rs)<br>
+        function.append(rset)<br>
+<br>
+        rs = RadioSettingValueList(LIST_AOP, LIST_AOP[_settings.auto_power_on])<br>
+        rset = RadioSetting(&quot;auto_power_on&quot;, &quot;Power On Method&quot;, rs)<br>
+        function.append(rset)<br>
+<br>
+        # STE SET<br>
+        rs = RadioSettingValueList(LIST_STE_FREQ,<br>
+                                   LIST_STE_FREQ[_settings.ste_frequency])<br>
+        rset = RadioSetting(&quot;ste_frequency&quot;, &quot;STE Frequency&quot;, rs)<br>
+        function.append(rset)<br>
+<br>
+        rs = RadioSettingValueList(LIST_STE_TYPE,<br>
+                                   LIST_STE_TYPE[_settings.ste_type])<br>
+        rset = RadioSetting(&quot;ste_type&quot;, &quot;STE Type&quot;, rs)<br>
+        function.append(rset)<br>
+<br>
+        # FUNCTION SET<br>
+        rs = RadioSettingValueList(LIST_STEP, LIST_STEP[_settings.tuning_step])<br>
+        rset = RadioSetting(&quot;tuning_step&quot;, &quot;Tuning Step&quot;, rs)<br>
+        function.append(rset)<br>
+<br>
+        rs = RadioSettingValueList(LIST_SQUELCH,<br>
+                                   LIST_SQUELCH[_settings.squelch])<br>
+        rset = RadioSetting(&quot;squelch&quot;, &quot;Squelch Level&quot;, rs)<br>
+        function.append(rset)<br>
+<br>
+        rs = RadioSettingValueBoolean(bool(_settings.sql_key_function))<br>
+        rset = RadioSetting(&quot;sql_key_function&quot;, &quot;SQL Key Function&quot;, rs)<br>
+        function.append(rset)<br>
+<br>
+        rs = RadioSettingValueList(LIST_TIMEOUT,<br>
+                                   LIST_TIMEOUT[_settings.timeout_timer])<br>
+        rset = RadioSetting(&quot;timeout_timer&quot;, &quot;Timeout Timer&quot;, rs)<br>
+        function.append(rset)<br>
+<br>
+        # uncategorized<br>
+        rs = RadioSettingValueBoolean(bool(_settings.save_chan_param))<br>
+        rset = RadioSetting(&quot;save_chan_param&quot;, &quot;Save Channel Parameters&quot;, rs)<br>
+        function.append(rset)<br>
+<br>
+        rs = RadioSettingValueBoolean(bool(_settings.forbid_chan_menu))<br>
+        rset = RadioSetting(&quot;forbid_chan_menu&quot;, &quot;Forbid Channel Menu&quot;, rs)<br>
+        function.append(rset)<br>
+<br>
+        rs = RadioSettingValueBoolean(bool(not _settings.forbid_initialize))<br>
+        rset = RadioSetting(&quot;forbid_initialize&quot;, &quot;Forbid Initialize&quot;, rs)<br>
+        function.append(rset)<br>
+<br>
+        rs = RadioSettingValueBoolean(bool(_settings.forbid_setting))<br>
+        rset = RadioSetting(&quot;forbid_setting&quot;, &quot;Forbid Setting&quot;, rs)<br>
+        function.append(rset)<br>
+<br>
+        # Information Of Scanning Channel<br>
+        scanning = RadioSettingGroup(&quot;scanning&quot;, &quot;Scanning Setup&quot;)<br>
+        group.append(scanning)<br>
+<br>
+        rs = RadioSettingValueBoolean(bool(_settings2.scan_mode))<br>
+        rset = RadioSetting(&quot;settings2.scan_mode&quot;, &quot;Scan Mode&quot;, rs)<br>
+        scanning.append(rset)<br>
+<br>
+        rs = RadioSettingValueList(LIST_PRIORITY_CH,<br>
+                                   LIST_PRIORITY_CH[_settings2.priority_ch])<br>
+        rset = RadioSetting(&quot;settings2.priority_ch&quot;, &quot;Priority Channel&quot;, rs)<br>
+        scanning.append(rset)<br>
+<br>
+        rs = RadioSettingValueInteger(1, 199, _settings2.priority_ch1 + 1)<br>
+        rset = RadioSetting(&quot;settings2.priority_ch1&quot;, &quot;Priority Channel 1&quot;, rs)<br>
+        scanning.append(rset)<br>
+<br>
+        rs = RadioSettingValueInteger(1, 199, _settings2.priority_ch2 + 1)<br>
+        rset = RadioSetting(&quot;settings2.priority_ch2&quot;, &quot;Priority Channel 2&quot;, rs)<br>
+        scanning.append(rset)<br>
+<br>
+        rs = RadioSettingValueList(LIST_REVERT_CH,<br>
+                                   LIST_REVERT_CH[_settings2.revert_ch])<br>
+        rset = RadioSetting(&quot;settings2.revert_ch&quot;, &quot;Revert Channel&quot;, rs)<br>
+        scanning.append(rset)<br>
+<br>
+        rs = RadioSettingValueList(LIST_TIME46,<br>
+                                   LIST_TIME46[_settings2.look_back_time_a])<br>
+        rset = RadioSetting(&quot;settings2.look_back_time_a&quot;,<br>
+                            &quot;Look Back Time A&quot;, rs)<br>
+        scanning.append(rset)<br>
+<br>
+        rs = RadioSettingValueList(LIST_TIME46,<br>
+                                   LIST_TIME46[_settings2.look_back_time_b])<br>
+        rset = RadioSetting(&quot;settings2.look_back_time_b&quot;,<br>
+                            &quot;Look Back Time B&quot;, rs)<br>
+        scanning.append(rset)<br>
+<br>
+        rs = RadioSettingValueList(LIST_TIME50,<br>
+                                   LIST_TIME50[_settings2.dropout_delay_time])<br>
+        rset = RadioSetting(&quot;settings2.dropout_delay_time&quot;,<br>
+                            &quot;Dropout Delay Time&quot;, rs)<br>
+        scanning.append(rset)<br>
+<br>
+        rs = RadioSettingValueList(LIST_TIME50,<br>
+                                   LIST_TIME50[_settings2.dwell_time])<br>
+        rset = RadioSetting(&quot;settings2.dwell_time&quot;, &quot;Dwell Time&quot;, rs)<br>
+        scanning.append(rset)<br>
+<br>
+        # Embedded Message<br>
+        embedded = RadioSettingGroup(&quot;embedded&quot;, &quot;Embedded Message&quot;)<br>
+        group.append(embedded)<br>
+<br>
+        rs = RadioSettingValueString(0, 5, _filter(_embedded.radio_type))<br>
+        rs.set_mutable(False)<br>
+        rset = RadioSetting(&quot;embedded_msg.radio_type&quot;, &quot;Radio Type&quot;, rs)<br>
+        embedded.append(rset)<br>
+<br>
+        if str(_embedded.radio_type) == &quot;RT98V&quot;:<br>
+            options = LIST_RT98V_MODES<br>
+        else:<br>
+            options = LIST_RT98U_MODES<br>
+        rs = RadioSettingValueList(options, options[_embedded.mode])<br>
+        rs.set_mutable(False)<br>
+        rset = RadioSetting(&quot;embedded_msg.mode&quot;, &quot;Mode&quot;, rs)<br>
+        embedded.append(rset)<br>
+<br>
+        # frequency<br>
+        if str(_embedded.radio_type) == &quot;RT98V&quot;:<br>
+            options = LIST_RT98V_FREQS<br>
+        else:<br>
+            options = LIST_RT98U_FREQS<br>
+        rs = RadioSettingValueList(options, options[_settings3.bandlimit])<br>
+        rs.set_mutable(False)<br>
+        rset = RadioSetting(&quot;settings3.bandlimit&quot;, &quot;Frequency&quot;, rs)<br>
+        embedded.append(rset)<br>
+<br>
+        rs = RadioSettingValueString(0, 10, _filter(_embedded.date_mfg))<br>
+        rs.set_mutable(False)<br>
+        rset = RadioSetting(&quot;embedded_msg.date_mfg&quot;, &quot;Production Date&quot;, rs)<br>
+        embedded.append(rset)<br>
+<br>
+        rs = RadioSettingValueString(0, 4, _filter(_embedded.mcu_version))<br>
+        rs.set_mutable(False)<br>
+        rset = RadioSetting(&quot;embedded_msg.mcu_version&quot;, &quot;MCU Version&quot;, rs)<br>
+        embedded.append(rset)<br>
+<br>
+        return group<br>
+<br>
+    def get_settings(self):<br>
+        try:<br>
+            return self._get_settings()<br>
+        except:<br>
+            import traceback<br>
+            LOG.error(&quot;failed to parse settings&quot;)<br>
+            traceback.print_exc()<br>
+            return None<br>
+<br>
+    def set_settings(self, settings):<br>
+        for element in settings:<br>
+            if not isinstance(element, RadioSetting):<br>
+                self.set_settings(element)<br>
+                continue<br>
+            else:<br>
+                try:<br>
+                    if &quot;.&quot; in element.get_name():<br>
+                        bits = element.get_name().split(&quot;.&quot;)<br>
+                        obj = self._memobj<br>
+                        for bit in bits[:-1]:<br>
+                            obj = getattr(obj, bit)<br>
+                        setting = bits[-1]<br>
+                    else:<br>
+                        obj = self._memobj.settings<br>
+                        setting = element.get_name()<br>
+<br>
+                    if element.has_apply_callback():<br>
+                        LOG.debug(&quot;using apply callback&quot;)<br>
+                        element.run_apply_callback()<br>
+                    elif setting == &quot;ch_number&quot;:<br>
+                        setattr(obj, setting, int(element.value) - 1)<br>
+                    elif setting == &quot;forbid_initialize&quot;:<br>
+                        setattr(obj, setting, not int(element.value))<br>
+                    elif setting == &quot;priority_ch1&quot;:<br>
+                        setattr(obj, setting, int(element.value) - 1)<br>
+                    elif setting == &quot;priority_ch2&quot;:<br>
+                        setattr(obj, setting, int(element.value) - 1)<br>
+                    elif element.value.get_mutable():<br>
+                        LOG.debug(&quot;Setting %s = %s&quot; % (setting, element.value))<br>
+                        setattr(obj, setting, element.value)<br>
+                except Exception, e:<br>
+                    LOG.debug(element.get_name())<br>
+                    raise<br>
+<br>
+    @classmethod<br>
+    def match_model(cls, filedata, filename):<br>
+        # This radio has always been post-metadata, so never do<br>
+        # old-school detection<br>
+        return False<br>
+<br>
+<br>
+@directory.register<br>
+class Rt98Radio(Rt98BaseRadio):<br>
+    &quot;&quot;&quot;Retevis RT98&quot;&quot;&quot;<br>
+    VENDOR = &quot;Retevis&quot;<br>
+    MODEL = &quot;RT98&quot;<br>
+    # Allowed radio types is a dict keyed by model of a list of version<br>
+    # strings<br>
+    ALLOWED_RADIO_TYPES = {&#39;RT98V&#39;: [&#39;V100&#39;],<br>
+                           &#39;RT98U&#39;: [&#39;V100&#39;]}<br>
diff -r f586574bc878 -r 0eab8146b294 tools/cpep8.manifest<br>
--- a/tools/cpep8.manifest      Thu Jun 17 21:57:05 2021 -0400<br>
+++ b/tools/cpep8.manifest      Sat Jul 03 14:13:35 2021 -0400<br>
@@ -83,6 +83,7 @@<br>
 ./chirp/drivers/retevis_rt23.py<br>
 ./chirp/drivers/retevis_rt26.py<br>
 ./chirp/drivers/retevis_rt76p.py<br>
+./chirp/drivers/retevis_rt98.py<br>
 ./chirp/drivers/rfinder.py<br>
 ./chirp/drivers/tdxone_tdq8a.py<br>
 ./chirp/drivers/template.py<br>
</div></div></div>