import struct BOUNDARY = b"C" * 10 def build_ht(htdata, zif, cmd, size=384): if len(cmd) > 0x160 - 0x98: raise ValueError("command too long for the 384-byte carrier") ht = bytearray(size) struct.pack_into("