@staticmethod
def _sense_packet_to_data(packet):
    'Remove the escape pad bytes from a sense packet (\x02\x00 -> \x02).'
    data = bytearray(0)
    last = 0
    i = 1
    while i < len(packet):
        if not (last == 2 and packet[i] == 0):
            data.append(packet[i])
        last = packet[i]
        i += 1
    return data
