Project

General

Profile

New Model #53 » wouxun6.patch

Initial wouxun6 patch - Dan Smith, 03/14/2012 05:32 PM

View differences:

chirp/wouxun.py Wed Mar 14 07:19:05 2012 -0700 → chirp/wouxun.py Wed Mar 14 17:30:33 2012 -0700
} names[128];
"""
def wouxun_identify(radio):
def wouxun_identify(radio, string):
for i in range(0, 5):
radio.pipe.write("HiWOUXUN\x02")
radio.pipe.write(string)
r = radio.pipe.read(9)
if len(r) != 9:
print "Got:\n%s" % util.hexprint(r)
print "Retrying identification..."
time.sleep(1)
continue
if r[2:8] != radio._model:
print "Model:\n%s" % util.hexprint(r)
raise Exception("I can't talk to this model")
return
if len(r) == 0:
......
else:
raise Exception("Unable to identify radio")
def wouxun_identify(radio):
return _wouxun_identify(radio, "HiWOUXUN\x02")
def wouxun6_identify(radio):
return _wouxun_identify(radio, "HiWXUVD1")
def wouxun_start_transfer(radio):
radio.pipe.write("\x02\x06")
time.sleep(0.05)
......
wouxun_start_transfer(radio)
return do_upload(radio, 0x0000, 0x2000, 0x0010)
def wouxun6_download(radio):
wouxun_identify(radio)
wouxun_start_transfer(radio)
return do_download(radio, 0x0000, 0x2000, 0x0040)
def wouxun6_upload(radio):
wouxun6_identify(radio)
wouxun_start_transfer(radio)
return do_upload(radio, 0x0000, 0x2000, 0x0010)
CHARSET = list("0123456789") + [chr(x + ord("A")) for x in range(0, 26)] + \
list("?+ ")
......
return True
return False
@directory.register
class KGUV6DRadio(KGUVD1PRadio):
MODEL = "KG-UV6D"
_model = "KG????"
def sync_in(self):
self._mmap = wouxun6_download(self)
self.process_mmap()
def sync_out(self):
wouxun6_upload(self)
def _puxing_prep(radio):
radio.pipe.write("\x02PROGRA")
ack = radio.pipe.read(1)
(1-1/12)