<div dir="ltr"><div><div><div><div><div><div><div>Marco,<br><br></div>It isn't just the lengh of the file. Since the "ident" that is returned is written to the .img first and the rest of the radio's memory follows it, all of the memory is shifted 4 bytes.<br><br></div>So...<br><br>#seekto 0x0B08;<br>struct {<br> u8 code[5];<br> u8 unused[11];<br>} pttid[15];<br><br></div>for a "normal" BaoFeng UV-5R style radio would need to be...<br><br>#seekto 0x0B0C;<br>struct {<br> u8 code[5];<br> u8 unused[11];<br>} pttid[15];<br><br></div>For this "odd" class of UV-6 and UV-8 radios.<br><br></div>I think there is a similar problem when writing to the radio. CHIRP currently does this...<br><br> # Main block<br> for i in range(0x08, 0x1808, 0x10):<br> _send_block(radio, i - 0x08, radio.get_mmap()[i:i + 0x10])<br> _do_status(radio, i)<br><br></div>It starts a 0x08 (right after the normal 8 byte "ident"). I think it would need to start at 0x0C (right after the 12 byte "ident").<br><br></div>Jim<br><div><div><div><div><div><div><div><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 1, 2014 at 4:52 AM, IZ3GME Marco <span dir="ltr"><<a href="mailto:iz3gme.marco@gmail.com" target="_blank">iz3gme.marco@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Just a couple of suggestions:<br>
- for the communication you can try reading 12 bytes lowering timeout so<br>
if only 8 are received read will bail out quickly enough<br>
- i would expand the structure to the longer size to have to deal with<br>
different sizes only when accessing ident field (i guess ident is only<br>
used during clone)<br>
<br>
my two cents<br>
73 de IZ3GME Marco<br>
<div><div class="h5"><br>
On 01/10/2014 01:53, Jim Unroe wrote:<br>
> Hi all,<br>
><br>
> I am working on two issues, #1225 (UV-8) and #1707 (UV-6), that after<br>
> doing research seems to indicate both issues are caused by the same thing.<br>
><br>
> The problem is that after the "magic" is sent to the radio to initiate<br>
> cloaning, the radio returns a 12 byte ident when every other Baofeng<br>
> radio that I know of returns an 8 byte ident. I have temporarily edited<br>
> the driver to accept 12 bytes and CHIRP downloads from the radio. But<br>
> since the ident is 4 bytes longer, all of the structures are off by 4 bytes.<br>
><br>
> After saving the downloaded data to a .img file, I can use a hex editor<br>
> to remove 4 bytes from the begining of .img file, save it to another<br>
> name and load it back into CHIRP and it is fine.<br>
><br>
> So I am looking for some help to figure out how to have CHIRP to be<br>
> tolerant of the 8 byte and 12 byte idents and also 4byte offset data<br>
> structures.<br>
><br>
> Got any ideas?<br>
><br>
> Thanks,<br>
> Jim KC9HI<br></div></div></blockquote></div><br></div></div></div></div></div></div></div></div></div></div></div></div>