-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Retevis RA87 - fixes #10871 #1035
Conversation
_mem.duplex = DUPLEX_NOSPLIT | ||
else: | ||
LOG.error('%s: set_mem: unhandled duplex: %s' % | ||
(mem.name, mem.duplex)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UI should not send you any duplexes other than those your radio claims to handle... Is this for a specific behavior you saw, or are you just being comprehensive? If it can happen for some reason, this should probably raise an error so there's some indication to the user that something went wrong, right? Otherwise it'll just flip back when it refreshes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is basically code borrowed from the anytone778uv.py driver. DUPLEX_NOSPLIT is just a variable that holds the value of 0x00 which is the value of 'duplex' when the radio's memory is set to simplex (no split).
u8 step:4, // STEP // 5
unk1:2,
duplex:2; // Duplex 0: Simplex, 1: Plus, 2: Minus
Do you just want me to rename the variable to something like DUPLEX_SIMPLEX, replace it directly with 0x00 or am I not understanding what you are trying to tell me?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, I'm just wondering about the else condition for mem.duplex
and the error log. I'm just wondering if you added that because you saw the UI send you a duplex that wasn't in the radio's supported_duplexes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. It it there only because it was in the anytone778uv.py driver that I borrowed it from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, gotcha, just wanted to make sure it wasn't signaling something else going on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a similar else condition in both get_memory() and set_memory(). Should I just remove them both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to remove them, I just wanted to make sure there wasn't some reason for it :)
# DTMF - Autodial Memory | ||
codes = self._memobj.dtmf_codes | ||
i = 1 | ||
for dtmfcode in codes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Protip life hack for you. Whenever you need to iterate a list and have the index, you can do this:
for i, dtmfcode in enumerate(codes):
Now, i
will be zero-origin instead of 1 like you're doing here, but it looks like you're using it as i-1
anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tip. Appreciated.
CHIRP PR Guidelines
The following must be true before PRs can be merged:
Fixes #1234
orRelated to #1234
so that the ticket system links the commit to the issue.tests/images
(except for thin aliases where the driver is sufficiently tested already). All new drivers should setNEEDS_COMPAT_SERIAL=False
and useMemoryMapBytes
. New drivers and radio models will affect the Python3 test matrix. You should regenerate this file withtox -emakesupported
and include it in your commit.six
,future
, etc).