<div dir="ltr"><br><div>Thanks, I'll make the changes this weekend and repost. </div><div><br></div><div>For the auto file identification, I was going to try looking at the frequency ranges in the image file for identification. These are non-overlapping between the three models, and they are in a fixed location in the image file. Eg. The 144 mhz models has a settable tx/rx range between 132 and 152 Mhz (or close to this), the 220 Mhz model has 200-250 mhz, etc. </div><div><br></div><div>The file sizes are the same, AFAIK, for all three, so I can't use that approach. The image files don't have a consistent or usable "id string" to help identity them ( I did a od/hex dump and reviewed what's there), at least for the two radios ( 2 meter and 220 mhz models) that I have. </div><div><br></div><div>Dave</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 24, 2015 at 4:45 PM, Dan Smith <span dir="ltr"><<a href="mailto:dsmith@danplanet.com" target="_blank">dsmith@danplanet.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> All previous features are currently working for this patch, with the<br>
> exception of automatic file identifcation. The TH radios do not have<br>
> a identifer that can safely distingush between the radios, this<br>
> feature is still TBD. You will need to manually select the correct<br>
> model when you open a radio image file.<br>
<br>
</span>None of the other drivers have this problem right now, so I'd hate to<br>
add one that does. Many of our drivers detect by file size. Is this not<br>
possible with this driver for some reason?<br>
<span class=""><br>
> diff -r 31a7494c324a -r d5eee1cd5418 chirp/drivers/th9000.py<br>
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000<br>
> +++ b/chirp/drivers/th9000.py Sat Apr 18 22:02:22 2015 -0700<br>
> @@ -0,0 +1,882 @@<br>
> +# Copyright 2012 Dan Smith <<a href="mailto:dsmith@danplanet.com">dsmith@danplanet.com</a>><br>
<br>
</span>This should be your copyright, with a proper date.<br>
<span class=""><br>
> +#from chirp.settings import RadioSetting, RadioSettingGroup, \<br>
> +# RadioSettingValueInteger, RadioSettingValueList, \<br>
> +# RadioSettingValueBoolean, RadioSettingValueString, \<br>
> +# RadioSettingValueFloat, InvalidValueError<br>
<br>
</span>Please don't do this. Remove these lines if you don't need them.<br>
<span class=""><br>
> +# Chirp Driver for TYT TH-9000D Radio (2 meter, 1.25 and 70cm radios)<br>
> +# by David Fannin <<a href="mailto:dfannin@sushisoft.com">dfannin@sushisoft.com</a>>, KK6DF<br>
<br>
</span>The copyright, when fixed, should cover this so you can drop it.<br>
<span class=""><br>
> +#<br>
> +# Version 0.5 (Experimental - Known Bugs and Issues)<br>
> +# Use for development purposes only!<br>
> +# Features working:<br>
> +# - single class file for 3 radio types - 144, 220 and 440 mhz models)<br>
> +# - Download from Radio<br>
> +# - Display Memories (only None, Tone, TSQL signalling supported)<br>
> +# - Save image file<br>
> +# - memory map decoded (about 90%)<br>
> +# - Upload to radio<br>
> +# - Modification of memories<br>
> +# - feature settings<br>
> +# - added Startup ID label<br>
> +#<br>
> +# Features not working:<br>
> +# - DCS , Cross Signaling<br>
> +# - Skip channels<br>
<br>
</span>I don't think you need to put all this in the driver, except for maybe<br>
the known issues.<br>
<br>
Also, the "use for development only" means I shouldn't put this in the<br>
tree, even if the other issues were addressed, is that right?<br>
<span class=""><br>
> +SETTING_LISTS = {<br>
> + "auto_power_off": APO_LIST,<br>
> + "bg_color" : BGCOLOR_LIST,<br>
> + "bg_brightness" : BGBRIGHT_LIST,<br>
> + "squelch" : SQUELCH_LIST,<br>
> + "timeout_timer" : TIMEOUT_LIST,<br>
> + "choose_tx_power": TXPWR_LIST,<br>
> + "tbst_freq" : TBSTFREQ_LIST,<br>
> + "voice_prompt" : BEEP_LIST<br>
> +}<br>
> +<br>
> +<br>
> +#<br>
> +#<br>
> +#<br>
<br>
</span>I think you can drop these three blank(ish) lines :)<br>
<div><div class="h5"><br>
> +"""<br>
> +Overall Memory Map:<br>
> +<br>
> + Memory Map (Range 0x0100-3FF0, step 0x10):<br>
> +<br>
> + Field Start End Size<br>
> + (hex) (hex) (hex)<br>
> +<br>
> + 1 Channel Set Flag 0100 011F 20<br>
> + 2 Channel Skip Flag 0120 013F 20<br>
> + 3 Blank/Unknown 0140 01EF B0<br>
> + 4 Unknown 01F0 01FF 10<br>
> + 5 TX/RX Range 0200 020F 10<br>
> + 6 Bootup Passwd 0210 021F 10<br>
> + 7 Options, Radio 0220 023F 20<br>
> + 8 Unknown 0240 019F<br>
> + 8B Startup Label 03E0 03E7 07<br>
> + 9 Channel Bank 2000 38FF 1900<br>
> + Channel 000 2000 201F 20<br>
> + Channel 001 2020 202F 20<br>
> + ...<br>
> + Channel 199 38E0 38FF 20<br>
> + 10 Blank/Unknown 3900 3FFF 6FF 14592 16383 1792<br>
> + Total Map Size 16128 (2^8 = 16384)<br>
> +<br>
> +<br>
> +"""<br>
> +<br>
> +"""<br>
> + TH9000/220 memory map<br>
> + section: 1 and 2: Channel Set/Skip Flags<br>
> +<br>
> + Channel Set (starts 0x100) : Channel Set bit is value 0 if a memory location in the channel bank is active.<br>
> + Channel Skip (starts 0x120): Channel Skip bit is value 0 if a memory location in the channel bank is active.<br>
> +<br>
> + Both flag maps are a total 24 bytes in length, aligned on 32 byte records.<br>
> + bit = 0 channel set/no skip, 1 is channel not set/skip<br>
> +<br>
> + to index a channel:<br>
> + cbyte = channel / 8 ;<br>
> + cbit = channel % 8 ;<br>
> + setflag = csetflag[cbyte].c[cbit] ;<br>
> + skipflag = cskipflag[cbyte].c[cbit] ;<br>
> +<br>
> + channel range is 0-199, range is 32 bytes (last 7 unknown)<br>
> +"""<br>
<br>
</div></div>Like Tom said, these should be comments, not strings.<br>
<span class=""><br>
> +"""<br>
> + TH9000/220 memory map<br>
> + section: 5 TX/RX Range<br>
> + used to set the TX/RX range of the radio (e.g. 222-228Mhz for 220 meter)<br>
> + possible to set range to 220-260Mhz for tx/rx<br>
> +<br>
> +"""<br>
<br>
</span>This too.<br>
<span class=""><br>
> +"""<br>
> + TH9000/220 memory map<br>
> + section: 6 bootup_passwd<br>
> + used to set bootup passwd (see boot_passwd checkbox option)<br>
> +<br>
> + options - bootup password<br>
> +<br>
> + bytes:bit type description<br>
> + ---------------------------------------------------------------------------<br>
> + 6 u8 bootup_passwd[6] bootup passwd, 6 chars, numberic chars 30-39 , see boot_passwd checkbox to set<br>
> + 10 u8 unknown;<br>
> +<br>
> +"""<br>
<br>
</span>And this.<br>
<div><div class="h5"><br>
> +"""<br>
> + TH9000/220 memory map<br>
> + section: 7 Radio Options<br>
> + used to set a number of radio options<br>
> +<br>
> + bytes:bit type description<br>
> + ---------------------------------------------------------------------------<br>
> + 1 u8 display_mode display mode, range 0-2, 0=freq,1=channel,2=name (selecting name affects vfo_mr)<br>
> + 1 u8 vfo_mr; vfo_mr , 0=vfo, mr=1<br>
> + 1 u8 unknown;<br>
> + 1 u8 squelch; squelch level, range 0-19, hex for menu<br>
> + 1 u8 unknown[2];<br>
> + 1 u8 channel_lock; if display_mode[channel] selected, then lock=1,no lock =0<br>
> + 1 u8 unknown;<br>
> + 1 u8 bg_brightness ; background brightness, range 0-21, hex, menu index<br>
> + 1 u8 unknown;<br>
> + 1 u8 bg_color ; bg color, menu index, blue 0 , orange 1, purple 2<br>
> + 1 u8 tbst_freq ; tbst freq , menu 0 = 1750Hz, 1=2100 , 2=1000 , 3=1450hz<br>
> + 1 u8 timeout_timer; timeout timer, hex, value = minutes, 0= no timeout<br>
> + 1 u8 unknown;<br>
> + 1 u8 auto_power_off; auto power off, range 0-3, off,30min, 1hr, 2hr, hex menu index<br>
> + 1 u8 voice_prompt; voice prompt, value 0,1 , Beep ON = 1, Beep Off = 2<br>
> +<br>
> + description of function setup options, starting at 0x0230<br>
> +<br>
> + bytes:bit type description<br>
> + ---------------------------------------------------------------------------<br>
> + 1 u8 // 0<br>
> + :4 unknown:6<br>
> + :1 elim_sql_tail:1 eliminate squelsh tail when no ctcss checkbox (1=checked)<br>
> + :1 sql_key_function "squelch off" 1 , "squelch momentary off" 0 , menu index<br>
> + 2 u8 unknown[2] /1-2<br>
> + 1 u8 // 3<br>
> + :4 unknown:4<br>
> + :1 inhibit_init_ops:1 //bit 5<br>
> + :1 unknownD:1<br>
> + :1 inhibit_setup_bg_chk:1 //bit 7<br>
> + :1 unknown:1<br>
> + 1 u8 tail_elim_type menu , (off=0,120=1,180=2), // 4<br>
> + 1 u8 choose_tx_power menu , (60w=0,25w=1) // 5<br>
> + 2 u8 unknown[2]; // 6-7<br>
> + 1 u8 bootup_passwd_flag checkbox 1=on, 0=off // 8<br>
> + 7 u8 unknown[7]; // 9-F<br>
> +<br>
> +"""<br>
<br>
</div></div>Also this.<br>
<span class=""><br>
> +"""<br>
> + TH9000/220 memory map<br>
> + section: 8B Startup Label<br>
> +<br>
> + bytes:bit type description<br>
> + ---------------------------------------------------------------------------<br>
> + 7 char start_label[7] label displayed at startup (usually your call sign)<br>
> +"""<br>
<br>
</span>Yep, this too.<br>
<div><div class="h5"><br>
> +"""<br>
> + TH9000/220 memory map<br>
> + section: 9 Channel Bank<br>
> + description of channel bank (200 channels , range 0-199)<br>
> + Each 32 Byte (0x20 hex) record:<br>
> + bytes:bit type description<br>
> + ---------------------------------------------------------------------------<br>
> + 4 bbcd freq[4] receive frequency in packed binary coded decimal<br>
> + 4 bbcd offset[4] transmit offset in packed binary coded decimal (note: plus/minus direction set by 'duplex' field)<br>
> + 1 u8<br>
> + :4 unknown:4<br>
> + :4 tuning_step:4 tuning step, menu index value from 0-9<br>
> + 5,6.25,8.33,10,12.5,15,20,25,30,50<br>
> + 1 u8<br>
> + :4 unknown:4 not yet decoded, used for DCS coding?<br>
> + :2 channel_width:2 channel spacing, menu index value from 0-3<br>
> + 25,20,12.5<br>
> + :1 reverse:1 reverse flag, 0=off, 1=on (reverses tx and rx freqs)<br>
> + :1 txoff:1 transmitt off flag, 0=transmit , 1=do not transmit<br>
> + 1 u8<br>
> + :1 talkaround:1 talkaround flag, 0=off, 1=on (bypasses repeater)<br>
> + :1 compander:1 compander flag, 0=off, 1=on (turns on/off voice compander option)<br>
> + :2 unknown:2<br>
> + :2 power:2 tx power setting, value range 0-2, 0=hi,1=med,2=lo<br>
> + :2 duplex:2 duplex settings, 0=simplex,2= minus(-) offset, 3= plus (+) offset (see offset field)<br>
> +<br>
> + 1 u8<br>
> + :4 unknown:4<br>
> + :2 rxtmode:2 rx tone mode, value range 0-2, 0=none, 1=CTCSS, 2=DCS (ctcss tone in field rxtone)<br>
> + :2 txtmode:2 tx tone mode, value range 0-2, 0=none, 1=CTCSS, 3=DCS (ctcss tone in field txtone)<br>
> + 1 u8<br>
> + :2 unknown:2<br>
> + :6 txtone:6 tx ctcss tone, menu index<br>
> + 1 u8<br>
> + :2 unknown:2<br>
> + :6 rxtone:6 rx ctcss tone, menu index<br>
> + 1 u8 txcode ?, not used for ctcss<br>
> + 1 u8 rxcode ?, not used for ctcss<br>
> + 3 u8 unknown[3]<br>
> + 7 char name[7] 7 byte char string for channel name<br>
> + 1 u8<br>
> + :6 unknown:6,<br>
> + :2 busychannellockout:2 busy channel lockout option , 0=off, 1=repeater, 2=busy (lock out tx if channel busy)<br>
> + 4 u8 unknownI[4];<br>
> + 1 u8<br>
> + :7 unknown:7<br>
> + :1 scrambler:1 scrambler flag, 0=off, 1=on (turns on tyt scrambler option)<br>
> +"""<br>
<br>
</div></div>You guessed it, this as well ;)<br>
<br>
I'd like to see the above fixed up on the next revision. From the looks<br>
of it, this is more than just ready for development purposes. I think<br>
functionally, it's probably fine for testing with a wider audience,<br>
especially since you've got the runtime experimental warning bit.<br>
<br>
Thanks!<br>
<span class="HOEnZb"><font color="#888888"><br>
--Dan<br>
<br>
</font></span><br>_______________________________________________<br>
chirp_devel mailing list<br>
<a href="mailto:chirp_devel@intrepid.danplanet.com">chirp_devel@intrepid.danplanet.com</a><br>
<a href="http://intrepid.danplanet.com/mailman/listinfo/chirp_devel" target="_blank">http://intrepid.danplanet.com/mailman/listinfo/chirp_devel</a><br>
Developer docs: <a href="http://chirp.danplanet.com/projects/chirp/wiki/Developers" target="_blank">http://chirp.danplanet.com/projects/chirp/wiki/Developers</a><br></blockquote></div><br></div>