script: add special decoding for CAN devid

This commit is contained in:
bugobliterator 2020-03-06 23:24:26 +05:30 committed by Andrew Tridgell
parent 1edf1d265c
commit 49843fc3e7

View File

@ -93,6 +93,13 @@ if opts.compass:
if opts.imu:
decoded_devname = imu_types.get(devtype, "UNKNOWN")
print("bus_type:%s(%u) bus:%u address:%u(0x%x) devtype:%u(0x%x) %s" % (
if bus_type == 3:
#uavcan devtype represents sensor_id
print("bus_type:%s(%u) bus:%u address:%u(0x%x) sensor_id:%u(0x%x) %s" % (
bustypes.get(bus_type,"UNKNOWN"), bus_type,
bus, address, address, devtype-1, devtype-1, decoded_devname))
else:
print("bus_type:%s(%u) bus:%u address:%u(0x%x) devtype:%u(0x%x) %s" % (
bustypes.get(bus_type,"UNKNOWN"), bus_type,
bus, address, address, devtype, devtype, decoded_devname))