> +def variable_len_resp(pipe):
> + """
> + when length of expected reply is not known, read byte at a time
> + until the ack character is found.
> + """
> + response = b""
> + i = 0
> + toolong = 256 # arbitrary
> + while True:
> + b = pipe.read(1)
> + if b == b'\x06':
> + break
> + else:
> + response += b
> + i += 1
> + if i > toolong:
> + LOG.debug("Response too long. got" + util.hexprint(response))
> + raise errors.RadioError("Response too long.")
Did you have a response to my comments in this part of the first patch?
--Dan
_______________________________________________
chirp_devel mailing list
chirp_devel@intrepid.danplanet.com
http://intrepid.danplanet.com/mailman/listinfo/chirp_devel
Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers