def METHOD_NAME(cmd, pin):
    conn.sendall(compose(MsgType.HW_SYNC, cmd, pin))
    while True:
        data = receive(conn, hdr.size)
        if not data:
            log.warning("Data read timeout")
            sys.exit(1)
        msg_type, msg_id, msg_len = hdr.unpack(data)
        if msg_type == MsgType.RSP:
            log.debug(" > %2d,%2d    : status %2d", msg_type, msg_id, msg_len)
        elif msg_type == MsgType.HW or msg_type == MsgType.BRIDGE:
            data = receive(conn, msg_len).decode('utf-8').split("\0")
            log.debug(" > %2d,%2d,%2d : %s", msg_type, msg_id, msg_len, "=".join(data))
            if data[0] == cmd[0]+'w' and data[1] == pin:
                data = data[2:]
                if len(data) > 1:
                    print(data)
                else:
                    print(data[0])
                break