[chirp_devel] [PATCH 1 of 1] [FT1D] Remove more invalid chars from APRS message body
Marco Filippi IZ3GME
Mon Dec 29 12:30:51 PST 2014
# HG changeset patch
# User Marco Filippi <iz3gme.marco at gmail.com>
# Date 1419884832 -3600
# lun dic 29 21:27:12 2014 +0100
# Node ID 27c16a6830bbe7ed9e47796fdf0e0582ab6849a9
# Parent 6175949a0c3837f842e40c599ce051c9a84553f1
[FT1D] Remove more invalid chars from APRS message body
Some chars are printable but not accepted as valid chars setting string
To avoid exceptions remove them all from APRS message body
Fix implementation of #967
diff -r 6175949a0c38 -r 27c16a6830bb chirp/ft1d.py
--- a/chirp/ft1d.py lun dic 29 10:27:34 2014 -0700
+++ b/chirp/ft1d.py lun dic 29 21:27:12 2014 +0100
@@ -1006,8 +1006,12 @@
body = str( aprs_beacon[index].body ).rstrip("\xFF")
checksum = body[-2:]
- body = ''.join(s for s in body[:-2] if s in string.printable).replace( "\x0d", " " )
- val = RadioSettingValueString(0, 134, body.strip())
+ body = ''.join(s for s in body[:-2] if s in string.printable).translate(None, "\x09\x0a\x0b\x0c\x0d")
+ try:
+ val = RadioSettingValueString(0, 134, body.strip())
+ except Exception as e:
+ print "Error in APRS beacon at index", index
+ raise e
rs = RadioSetting("aprs_beacon.body%d" % index, "Body", val)
menu.append(rs)
More information about the chirp_devel
mailing list