# HG changeset patch # User Tom Hayward tom@tomh.us # Date 1418966149 28800 # Thu Dec 18 21:15:49 2014 -0800 # Node ID dab6a8e2a7666c3beea65f4831f9c7161c648092 # Parent b67507019c2b8d7fa250c624eb72e04ef112904c ap510: Handle uninitialized data in the digipeat alias. #2095
diff -r b67507019c2b -r dab6a8e2a766 chirp/ap510.py --- a/chirp/ap510.py Sun Dec 14 15:45:10 2014 -0800 +++ b/chirp/ap510.py Thu Dec 18 21:15:49 2014 -0800 @@ -355,12 +355,17 @@ for field in fields: china.append(RadioSetting(*field))
+ try: + # Sometimes when digipeat is disabled, alias is 0xFF + alias = ALIAS[int(self._mmap.digipeat[1]) - 1] + except ValueError: + alias = ALIAS[0] fields = [ ("digipeat", "Digipeat", RadioSettingValueBoolean(strbool(self._mmap.digipeat[0]))), ("alias", "Digipeat Alias", RadioSettingValueList( - ALIAS, ALIAS[int(self._mmap.digipeat[1]) - 1])), + ALIAS, alias)), ("virtualgps", "Static Position", RadioSettingValueBoolean(strbool(self._mmap.virtualgps[0]))), ("btext", "Static Position BTEXT", RadioSettingValueString(