def encode(self, data, errors='strict'):
        return serial.to_bytes([int(h, 16) for h in data.split()])
'40 41 42' -> b'@ab'
dataset/ETHPy150Open pyserial/pyserial/serial/tools/hexlify_codec.py/Codec.encode