Skip to content

Commit

Permalink
objectdictionary: Use node_id from DCF if not provided (#350)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thesummer authored Jun 4, 2024
1 parent 98283a2 commit 5367d83
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions canopen/objectdictionary/eds.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def import_eds(source, node_id):
if eds.has_section("DeviceComissioning"):
od.bitrate = int(eds.get("DeviceComissioning", "Baudrate")) * 1000
od.node_id = int(eds.get("DeviceComissioning", "NodeID"), 0)
node_id = node_id or od.node_id

for section in eds.sections():
# Match dummy definitions
Expand Down

0 comments on commit 5367d83

Please sign in to comment.