[chirp_devel] Porting Sainsonic RST599

Mikhail Titov
Mon Oct 12 14:54:13 PDT 2015


On Mon, Oct 12, 2015 at  3:39 PM, Dan Smith via chirp_devel <chirp_devel at intrepid.danplanet.com> wrote:
>> P.S. Is there an utility BCD decoding code in chirp common to all
>> models? I failed to find it.
>
> We have this in bitwise. Look for drivers in the tree that use "lbcd" or
> "bbcd" types in memory structure definitions. If that works for you,
> defining a structure to pythonify a data blob will definitely be
> easiest.

Hey!

Thank you! I've figured it out and I can read the majority of settings
now. I have best practices questions to catch up...

Do we try to maintain compatibility with original software for radios? I
noticed that original software stores file in a "messed up" way with
blocks order changed. Right now, I try to follow memory addresses and
use sparse memmap by using its __setitem__ via subscripts and partially
overwriting some data from there. Is it okay thing to do as I didn't see
any other drivers doing that? It is easier to work with rather than
doing some math for auxiliary block. It is way faster than copying
entire memory full of unused segments and I can skip fetching non-set
channels as I know bitmask.

Is there (or planned) general purpose table editor widget? It is
somewhat ugly to edit FM presets as it is done now. And there is also
Automatic Repeaters Offset settings, tone codes, and 4(!) lines of
power-on welcome message with various font sizes and alignment. It looks
somewhat cluttered now. Some generic table widget would be better. Did I
miss it? Is there an example?

Is there an extensive list (wiki?) with all common namings? I mean like
how to name things in that data blob as I see code outside of drivers
uses some... like autorpt. What would I name frequency ranges? I guess
more generic question is: are we trying to achieve cross compatibility
like loading settings (besides channels) from other radios?

Also I see some non-DRY code in drivers regarding charset filtering,
block reading/writing and checking things (send something & expect
0x06). There are tons of similar looking code between Wouxon and
Baofeng. How shall I approach it? Copy/paste and modify as necessary for
now? I feel like since I'm writing the new one, I still can do it
right. Perhaps it would be nice to have an extra class to derive from
that would define ACK for write commands, and form read command via
struct "<cHb" and check "Hb" part in return.

-- 
Mikhail



More information about the chirp_devel mailing list