aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorEric Callahan <arksine.code@gmail.com>2022-04-25 18:09:06 -0400
committerKevinOConnor <kevin@koconnor.net>2022-05-10 11:48:06 -0400
commit88731c283629f116be0c81b82a41db8f8ecb067b (patch)
tree8ca6e6a4dd5ccb351fab1ef75c9c009f7cfa14a0 /scripts
parent95d06c95e3fd1e83048dde55523ccde606b4f728 (diff)
downloadkutter-88731c283629f116be0c81b82a41db8f8ecb067b.tar.gz
kutter-88731c283629f116be0c81b82a41db8f8ecb067b.tar.xz
kutter-88731c283629f116be0c81b82a41db8f8ecb067b.zip
scripts: identify application in canbus_query
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/canbus_query.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/canbus_query.py b/scripts/canbus_query.py
index 7312a0c6..52dd4706 100644
--- a/scripts/canbus_query.py
+++ b/scripts/canbus_query.py
@@ -10,6 +10,8 @@ import can
CANBUS_ID_ADMIN = 0x3f0
CMD_QUERY_UNASSIGNED = 0x00
RESP_NEED_NODEID = 0x20
+CMD_SET_KLIPPER_NODEID = 0x01
+CMD_SET_CANBOOT_NODEID = 0x11
def query_unassigned(canbus_iface):
# Open CAN socket
@@ -37,7 +39,16 @@ def query_unassigned(canbus_iface):
if uuid in found_ids:
continue
found_ids[uuid] = 1
- sys.stdout.write("Found canbus_uuid=%012x\n" % (uuid,))
+ AppNames = {
+ CMD_SET_KLIPPER_NODEID: "Klipper",
+ CMD_SET_CANBOOT_NODEID: "CanBoot"
+ }
+ app_id = CMD_SET_KLIPPER_NODEID
+ if msg.dlc > 7:
+ app_id = msg.data[7]
+ app_name = AppNames.get(app_id, "Unknown")
+ sys.stdout.write("Found canbus_uuid=%012x, Application: %s\n"
+ % (uuid, app_name))
sys.stdout.write("Total %d uuids found\n" % (len(found_ids,)))
def main():