Example #1
0
def verify(data, fullcrc):

    data = data.ljust(packet_size, pad)
    crc = calc_crc(data, fullcrc)

    return crc
Example #2
0
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))