def send_obd(data): conn2 = IsoTPSocketConnection('can0', rxid=0x7E8, txid=0x700, params=params) conn2.tpsock.set_opts(txpad=0x55, tx_stmin=2500000) conn2.open() conn2.send(data) conn2.wait_frame() conn2.wait_frame() conn2.close()
def send_raw(data): global params conn2 = IsoTPSocketConnection('can0', rxid=0x7E8, txid=0x7E0, params=params) conn2.tpsock.set_opts(txpad=0x55, tx_stmin=2500000) conn2.open() conn2.send(data) results = conn2.wait_frame() conn2.close() if results: print(str(results)) return results else: return data + b'0x00'