def verify(data, fullcrc): data = data.ljust(packet_size, pad) crc = calc_crc(data, fullcrc) return crc
def asmPkt(data, sequence): data = data.ljust(packet_size, pad) crc = calc_crc(data) return SOH + (chr(sequence)) + (chr(0xff - sequence)) + data + (chr(crc >> 8)) + (chr(crc & 0xff))