[chirp_devel] [PATCH] [AnyTone 5888UV] Add limited squelch mode & fix file identifier
# HG changeset patch # User Brad Schuler <brad@schuler.wsmailto:brad@schuler.ws> # Date 1604816852 25200 # Sat Nov 07 23:27:32 2020 -0700 # Node ID f13da43b1125af02a6dbc129a6e9e33760adc9a7 # Parent af9c114dd8c5d13c0a1031103900d7db5262bc62 [AnyTone 5888UV] Add limited squelch mode & fix file identifier
Set the radio's squelch mode to CTCSS/DCS Tones instead of Carrier when the receive tone mode is set. Recognize a file image from this radio when no metadata is present.
Related to issues 2989, 3653, 6633
diff -r af9c114dd8c5 -r f13da43b1125 chirp/drivers/anytone.py --- a/chirp/drivers/anytone.py Mon Nov 02 16:12:36 2020 -0700 +++ b/chirp/drivers/anytone.py Sat Nov 07 23:27:32 2020 -0700 @@ -68,7 +68,9 @@ u8 txcode; u8 rxcode; u8 unknown7[2]; - u8 unknown2[5]; + u8 unknown9:5, + sqlMode:3; // [Carrier, CTCSS/DCS Tones, Opt Sig Only, Tones & Opt Sig, Tones or Opt Sig] + u8 unknown2[4]; char name[7]; u8 unknownZ[2]; }; @@ -324,6 +326,7 @@ chirp_common.PowerLevel("Mid1", watts=25), chirp_common.PowerLevel("Mid2", watts=10), chirp_common.PowerLevel("Low", watts=5)] +SQL_MODES = ["Carrier", "CTCSS/DCS", "Opt Sig Only", "Tones AND Sig", "Tones OR Sig"]
@directory.register @@ -333,7 +336,7 @@ VENDOR = "AnyTone" MODEL = "5888UV" BAUD_RATE = 9600 - _file_ident = "QX588UV" + _file_ident = "588UVN" # May try to mirror the OEM behavior later _ranges = [ @@ -424,6 +427,8 @@ rxtone = txtone = None rxmode = TMODES[_mem.rxtmode] + if _mem.sqlMode == 0 or _mem.sqlMode == 2: + rxmode = TMODES.index('') txmode = TMODES[_mem.txtmode] if txmode == "Tone": txtone = TONES[_mem.txtone] @@ -472,6 +477,10 @@ _mem.txtmode = TMODES.index(txmode) _mem.rxtmode = TMODES.index(rxmode) + if rxmode != '': + _mem.sqlMode = SQL_MODES.index("CTCSS/DCS") + else: + _mem.sqlMode = SQL_MODES.index("Carrier") if txmode == "Tone": _mem.txtone = TONES.index(txtone) elif txmode == "DTCS":
@@ -333,7 +336,7 @@ VENDOR = "AnyTone" MODEL = "5888UV" BAUD_RATE = 9600
- _file_ident = "QX588UV"
- _file_ident = "588UVN"
I think this is likely due to you having a different version of the radio from other people, right? This will break their ability to open old images, which we want to try to avoid. Can you alter the detection logic to include both?
# May try to mirror the OEM behavior later _ranges = [
@@ -424,6 +427,8 @@ rxtone = txtone = None rxmode = TMODES[_mem.rxtmode]
if _mem.sqlMode == 0 or _mem.sqlMode == 2:
It would be great if you could also use the .index() method below for these two, to increase readability/
rxmode = TMODES.index('') txmode = TMODES[_mem.txtmode] if txmode == "Tone": txtone = TONES[_mem.txtone]
@@ -472,6 +477,10 @@ _mem.txtmode = TMODES.index(txmode) _mem.rxtmode = TMODES.index(rxmode)
if rxmode != '':
_mem.sqlMode = SQL_MODES.index("CTCSS/DCS")
else:
_mem.sqlMode = SQL_MODES.index("Carrier")
Thanks!
--Dan
Thanks for the suggestions. Will do. Is it better (when feedback like this occurs) for me to send a replacement patch or a patch with just these changes to be laid over the one you reviewed?
Brad Schuler K0BAS
-----Original Message----- From: chirp_devel-bounces@intrepid.danplanet.com chirp_devel-bounces@intrepid.danplanet.com On Behalf Of Dan Smith via chirp_devel Sent: Thursday, November 19, 2020 1:18 PM To: chirp_devel@intrepid.danplanet.com Subject: Re: [chirp_devel] [PATCH] [AnyTone 5888UV] Add limited squelch mode & fix file identifier
@@ -333,7 +336,7 @@ VENDOR = "AnyTone" MODEL = "5888UV" BAUD_RATE = 9600
- _file_ident = "QX588UV"
- _file_ident = "588UVN"
I think this is likely due to you having a different version of the radio from other people, right? This will break their ability to open old images, which we want to try to avoid. Can you alter the detection logic to include both?
# May try to mirror the OEM behavior later _ranges = [
@@ -424,6 +427,8 @@ rxtone = txtone = None rxmode = TMODES[_mem.rxtmode]
if _mem.sqlMode == 0 or _mem.sqlMode == 2:
It would be great if you could also use the .index() method below for these two, to increase readability/
rxmode = TMODES.index('') txmode = TMODES[_mem.txtmode] if txmode == "Tone": txtone = TONES[_mem.txtone] @@ -472,6 +477,10 @@ _mem.txtmode = TMODES.index(txmode) _mem.rxtmode = TMODES.index(rxmode)
if rxmode != '':
_mem.sqlMode = SQL_MODES.index("CTCSS/DCS")
else:
_mem.sqlMode = SQL_MODES.index("Carrier")
Thanks!
--Dan
_______________________________________________ chirp_devel mailing list chirp_devel@intrepid.danplanet.com http://intrepid.danplanet.com/mailman/listinfo/chirp_devel Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
Is it better (when feedback like this occurs) for me to send a replacement patch or a patch with just these changes to be laid over the one you reviewed?
No, please send a new single patch against the current tip. Multiple patches are fine, but ideally only when the changes are distinct. While iterating on something to get it ready for the tree, I'd rather just apply one thing without the noise in between.
Thanks!
--Dan
Understood.
I think, though that I'm stuck. I've submitted two patches for the anytone.py file (two different reasons). The second has changes upon the first, which is the one we're modifying. Shall I rollback both, redo, and send you replacement patches for both?
Trial by fire on using Mercurial!
Thanks for the guidance, Brad Schuler K0BAS
-----Original Message----- From: chirp_devel-bounces@intrepid.danplanet.com chirp_devel-bounces@intrepid.danplanet.com On Behalf Of Dan Smith via chirp_devel Sent: Thursday, November 19, 2020 6:05 PM To: chirp_devel@intrepid.danplanet.com Subject: Re: [chirp_devel] [PATCH] [AnyTone 5888UV] Add limited squelch mode & fix file identifier
Is it better (when feedback like this occurs) for me to send a replacement patch or a patch with just these changes to be laid over the one you reviewed?
No, please send a new single patch against the current tip. Multiple patches are fine, but ideally only when the changes are distinct. While iterating on something to get it ready for the tree, I'd rather just apply one thing without the noise in between.
Thanks!
--Dan _______________________________________________ chirp_devel mailing list chirp_devel@intrepid.danplanet.com http://intrepid.danplanet.com/mailman/listinfo/chirp_devel Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
I think, though that I'm stuck. I've submitted two patches for the anytone.py file (two different reasons). The second has changes upon the first, which is the one we're modifying. Shall I rollback both, redo, and send you replacement patches for both?
No, just fold them into the same patch. Use the 'qfold' command with one patch applied and the rest unapplied, and you'll be left with one. It'll probably combine the commit messages like a machine, so please 'qrefresh -e' the top patch and clean up the commit message so it looks like a single point in time before you send.
--Dan
participants (2)
-
Brad & Cindy Schuler
-
Dan Smith