From 2363352d995202622ea0f6a36e02f8289e2b7e79 Mon Sep 17 00:00:00 2001 From: johannes Date: Thu, 16 Feb 2023 20:03:04 +0100 Subject: [PATCH] Added is_extended_id=False to can send calls --- can-updater.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/can-updater.py b/can-updater.py index 05a63e0..738dd55 100644 --- a/can-updater.py +++ b/can-updater.py @@ -76,7 +76,7 @@ def calcStmCrc(data, idx, len): print("Resetting device...") #This sends an SDO request to index 0x5002, subindex 2 which triggers a reset -msg = can.Message(arbitration_id=0x600 + int(options.nodeid), data = [ 0x23, 0x02, 0x50, 0x02, 0, 0, 0, 0 ]) +msg = can.Message(arbitration_id=0x600 + int(options.nodeid), is_extended_id=False, data = [ 0x23, 0x02, 0x50, 0x02, 0, 0, 0, 0 ]) bus.send(msg) if options.id: @@ -84,18 +84,18 @@ def calcStmCrc(data, idx, len): bytes = [id & 0xFF, (id >> 8) & 0xff, (id >> 16) & 0xff, (id >> 24) & 0xff] waitForId(bus, bytes) print("id specified, sending magic and id") - msg = can.Message(arbitration_id=0x7DD, data = bytes) + msg = can.Message(arbitration_id=0x7DD, is_extended_id=False, data = bytes) else: id = waitForId(bus, False) print("No id specified, reflecting id", id) - msg = can.Message(arbitration_id=0x7DD, data=id) + msg = can.Message(arbitration_id=0x7DD, is_extended_id=False, data=id) bus.send(msg) waitForChar(bus, b'S') print("Sending number of pages...") -msg = can.Message(arbitration_id=0x7DD, data=[numPages]) +msg = can.Message(arbitration_id=0x7DD, is_extended_id=False, data=[numPages]) bus.send(msg) waitForChar(bus, b'P') @@ -108,14 +108,14 @@ def calcStmCrc(data, idx, len): print("Sending page 0...", end=' ') while not done: - msg = can.Message(arbitration_id=0x7DD, data=data[idx:idx+8]) + msg = can.Message(arbitration_id=0x7DD, is_extended_id=False, data=data[idx:idx+8]) bus.send(msg) idx = idx + 8 c = waitForChar(bus, b'CDEPT') if 'C' == c: - msg = can.Message(arbitration_id=0x7DD, data=[crc & 0xFF, (crc >> 8) & 0xFF, (crc >> 16) & 0xFF, (crc >> 24) & 0xFF]) + msg = can.Message(arbitration_id=0x7DD, is_extended_id=False, data=[crc & 0xFF, (crc >> 8) & 0xFF, (crc >> 16) & 0xFF, (crc >> 24) & 0xFF]) bus.send(msg) c = waitForChar(bus, b'PED') if 'D' == c: