def generate_query(command):
data = bytearray(command)<EOL>c = checksum(data)<EOL>data.append(c >> <NUM_LIT:8>)<EOL>data.append(c & <NUM_LIT>)<EOL>data.replace(b'<STR_LIT>', b'<STR_LIT>')<EOL>data = bytearray.fromhex("<STR_LIT>") + data + bytearray.fromhex("<STR_LIT>")<EOL>return data<EOL>
Add header, checksum and footer to command data.