[chirp_devel] [PATCH] [leixen] Filter out-of-bounds audio processor setting

Brian Dickman
Wed Aug 31 21:40:09 PDT 2016


Ugh, sorry. Previous patch included a syntax error because I
apparently can't cut and paste before export properly. Disregard and
consider this patch instead.
--
Brian


######

# HG changeset patch
# User Brian Dickman <brian.maybe at gmail.com>
# Date 1472704626 25200
#      Wed Aug 31 21:37:06 2016 -0700
# Node ID 1cb22d6d9ec6628495c30d2a41b6daa7e18de0c8
# Parent  072644da3599231a2b8fe6a0b89186a7b4beab26
[leixen] Filter out-of-bounds audio processor setting, fixes #3675

After doing a clear all reset on the VV-898, the apro setting on
memory 1 is out of range (0xff), but the radio honors it as "off"
anyway. This fix prevents such a memory from throwing an exception on
download.

diff -r 072644da3599 -r 1cb22d6d9ec6 chirp/drivers/leixen.py
--- a/chirp/drivers/leixen.py Wed Aug 31 19:46:58 2016 -0700
+++ b/chirp/drivers/leixen.py Wed Aug 31 21:37:06 2016 -0700
@@ -512,11 +512,12 @@
                           RadioSettingValueList(
                               opts, opts[_mem.tailcut]))
         mem.extra.append(rs)
+        apro = _mem.apro if _mem.apro < 0x5 else 0
         opts = ["Off", "Compander", "Scrambler", "TX Scrambler",
                 "RX Scrambler"]
         rs = RadioSetting("apro", "Audio Processing",
                           RadioSettingValueList(
-                              opts, opts[_mem.apro]))
+                              opts, opts[apro]))
         mem.extra.append(rs)
         opts = ["On", "Off"]
         rs = RadioSetting("voxoff", "VOX",

On Wed, Aug 31, 2016 at 9:34 PM, Brian Dickman <brian.maybe at gmail.com> wrote:
> # HG changeset patch
> # User Brian Dickman <brian.maybe at gmail.com>
> # Date 1472704355 25200
> #      Wed Aug 31 21:32:35 2016 -0700
> # Node ID 6be6cfb51c15e604d78ad5bcd5f421adac718c4f
> # Parent  072644da3599231a2b8fe6a0b89186a7b4beab26
> [leixen] Filter out-of-bounds audio processor setting, fixes #3675
>
> After doing a clear all reset on the VV-898, the apro setting on
> memory 1 is out of range (0xff), but the radio honors it as "off"
> anyway. This fix prevents such a memory from throwing an exception on
> download.
>
> diff -r 072644da3599 -r 6be6cfb51c15 chirp/drivers/leixen.py
> --- a/chirp/drivers/leixen.py Wed Aug 31 19:46:58 2016 -0700
> +++ b/chirp/drivers/leixen.py Wed Aug 31 21:32:35 2016 -0700
> @@ -512,11 +512,13 @@
>                            RadioSettingValueList(
>                                opts, opts[_mem.tailcut]))
>          mem.extra.append(rs)
> +        apro = _mem.apro if _mem.apro < 0x5 else 0
> +        rs = RadioSetting("apro", "Audio Processing",
>          opts = ["Off", "Compander", "Scrambler", "TX Scrambler",
>                  "RX Scrambler"]
>          rs = RadioSetting("apro", "Audio Processing",
>                            RadioSettingValueList(
> -                              opts, opts[_mem.apro]))
> +                              opts, opts[apro]))
>          mem.extra.append(rs)
>          opts = ["On", "Off"]
>          rs = RadioSetting("voxoff", "VOX",



More information about the chirp_devel mailing list