def execute(self, protocol):
        result = []
        for next in protocol.execute():
            if hasattr(next, "execute"):
                result.extend(self.execute(next))
            else:
                pid, data = next
                in_packets = []
                self.stream.write(pack(pid, data))
                while True:
                    pkt = self.stream.read()
                    if not pkt: break
                    for pid, length, data in tokenize(pkt):
                        in_packets.append((pid, length, protocol.decode_packet(pid, length, data)))
                        self.stream.write(pack(P000.PID_ACK, pid))
                in_packets.append((0, 0, None))
                result.append(protocol.decode_list(in_packets))

        return protocol.decode_result(result)
Execute the give garmin Applection protcol.
dataset/ETHPy150Open braiden/python-ant-downloader/antd/garmin.py/Device.execute