OpenCyphal / pycyphal

Python implementation of the Cyphal protocol stack.
https://pycyphal.readthedocs.io/
MIT License
123 stars 106 forks source link

Attempt to broadcast a service request raises an unintelligible exception #35

Closed pavel-kirienko closed 5 years ago

pavel-kirienko commented 6 years ago

Discovered by Kent Martin on the mailing list:

broadcast(uavcan.thirdparty.rfd.equipment.eng_mon.EngineStatus.Request(clearServiceData=0))
2018-05-21 11:08:39,887 ERROR uavcan_gui_tool.active_data_type_detector: Could not detect data type name from transfer Transfer(id=1, source_node_id=20, dest_node_id=None, transfer_priority=30, payload=bytearray(b'\x00'))
Traceback (most recent call last):
  File "C:\Program Files (x86)\UAVCAN\UAVCAN GUI Tool\uavcan_gui_tool\active_data_type_detector.py", line 37, in _on_transfer
    dtname = uavcan.get_uavcan_data_type(tr.payload).full_name
  File "C:\Program Files (x86)\UAVCAN\UAVCAN GUI Tool\uavcan\transport.py", line 33, in get_uavcan_data_type
    return obj._type
AttributeError: 'bytearray' object has no attribute '_type'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files (x86)\UAVCAN\UAVCAN GUI Tool\uavcan_gui_tool\active_data_type_detector.py", line 42, in _on_transfer
    dtname = uavcan.DATATYPES[(tr.data_type_id, kind)].full_name
KeyError: (210, 1)
pavel-kirienko commented 5 years ago

Addressed in the rewrite, see the branch uavcan-v1.0.