Skip to content

Commit 5367d83

Browse files
authored
objectdictionary: Use node_id from DCF if not provided (#350)
If no valid node_id (zero or None) is passed to import_eds(), try applying the one from the DeviceComissioning section if available. This mainly affects internal usage during import, namely interpolation of $NODEID references.
1 parent 98283a2 commit 5367d83

File tree

1 file changed

+1
-0
lines changed
  • canopen/objectdictionary

1 file changed

+1
-0
lines changed

canopen/objectdictionary/eds.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def import_eds(source, node_id):
8787
if eds.has_section("DeviceComissioning"):
8888
od.bitrate = int(eds.get("DeviceComissioning", "Baudrate")) * 1000
8989
od.node_id = int(eds.get("DeviceComissioning", "NodeID"), 0)
90+
node_id = node_id or od.node_id
9091

9192
for section in eds.sections():
9293
# Match dummy definitions

0 commit comments

Comments
 (0)