ymodem.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:device-updater 作者: spark 项目源码 文件源码
def wait_until_ready(self, channel:RawIOBase, timeout=60):
        """
        sends ' ' (space) and waits for the corresponding ACK message. Once we have 3 of these in a row we can be fairly
        certain the device is ready for ymodem.
        :param channel:
        :param timeout:
        :return:
        """
        success_count = 0
        while channel.readline():  # flush any existing data
            success_count = 0

        while success_count < 2:
            channel.write(b' ')
            result = channel.read()
            if result and result[0]==LightYModemProtocol.ack:
                success_count += 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号