I am working with a radio that I am having a problem with the upload procedure. Normally, after a "frame" is sent, the radio replies with an ACK and the programming software sends the next "frame", another ACK is received and so on.
The problem is that randomly the radio with reply with 2 ACKs instead of 1. Currently my upload progresses fine until the double ACK is encountered.
My upload code is below. Does anyone have any suggestions for how I can bypass these occasional extra ACKs?
Thanks in advance, Jim
def _upload(radio): """Upload procedure"""
MEM_SIZE = 0x7000
# put radio in program mode and identify it _do_ident(radio)
# UI progress status = chirp_common.Status() status.cur = 0 status.max = MEM_SIZE / BLOCK_SIZE status.msg = "Cloning to radio..." radio.status_fn(status)
# the fun start here for addr in range(0, MEM_SIZE, BLOCK_SIZE): # sending the data data = radio.get_mmap()[addr:addr + BLOCK_SIZE]
frame = _make_frame("W", addr, BLOCK_SIZE, data)
_send(radio, frame)
# receiving the response ack = _rawrecv(radio, 1) if ack != "\x06": msg = "Bad ack writing block 0x%04x" % addr raise errors.RadioError(msg)
# UI Update status.cur = addr / BLOCK_SIZE status.msg = "Cloning to radio..." radio.status_fn(status)
_exit_program_mode(radio)