Hello
This was done following the call on the mailing list. I'm a bit rusty so this is probably not following the chirp PR etiquette. I remember the process was somewhat unusual but may have changed since this is now using git rather than mercurial.
In any case, the current py3 branch does not work with the radio in the subject. This is because the driver is expecting strings rather than python bytes
and is also using strings internally to compile the proper commands that are then sent to the radio. In particular, the "... %s ..." % foo
idiom is used quite a bit, and would include the the b
prefix if foo
is of the bytes
type. That is, of course, undesired. To make this work, we removed the b
prefix in all _model
variables and added encode()
and decode()
in _send()
and receive()
. We also amended the list of tested radios.
I can only guess that there was some debate among developers how to deal with this very problem. The solution chosen here has the advantage that it leaves most of the driver untouched. One could make the point that now would be a great time to implement this in a cleaner way, but I have no way to test the change for all other Alinco radios; I would probably introduce bugs if I go for a more elaborate change.
This code passes the unit tests and reading from / writing to the Alinco DJ-G7 is successful. I assume that I am allowed to add the "byte clean" flag to the list of tested radios under these conditions (not sure what that column really means...)
Thank you for all your efforts!
Matt