[chirp_devel] [PATCH 2 of 5] [ft4] improve serial i/o [#4787]

Dan Smith
Thu Feb 28 06:48:30 PST 2019


> +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


More information about the chirp_devel mailing list