Skip to content

Commit

Permalink
eds io supports BaudRate and Baudrate
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanpdx committed Apr 15, 2023
1 parent efff34f commit a916644
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
5 changes: 4 additions & 1 deletion eds_utils/core/file_io/read_eds.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,10 @@ def _read_device_commissioning(header: str, lines: dict) -> (DeviceCommissioning
errors.append(f'{_LEVEL}: NodeName was missing from {header}')

try:
temp = _read_int_value(header, lines, 'Baudrate')
try:
temp = _read_int_value(header, lines, 'Baudrate')
except Exception:
temp = _read_int_value(header, lines, 'BaudRate')
if temp in BAUD_RATE:
device_comm.baud_rate = temp
else:
Expand Down
2 changes: 1 addition & 1 deletion eds_utils/core/file_io/write_eds.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def write_eds(eds: EDS, file_path='', dcf=False):
lines.append('[DeviceComissioning]') # only one 'm' in header
lines.append(f'NodeID=0x{eds.device_commissioning.node_id:X}')
lines.append(f'NodeName={eds.device_commissioning.node_name}')
lines.append(f'Baudrate={eds.device_commissioning.baud_rate}')
lines.append(f'BaudRate={eds.device_commissioning.baud_rate}')
lines.append(f'NetNumber={eds.device_commissioning.net_number}')
lines.append(f'NetworkName={eds.device_commissioning.network_name}')
lines.append(f'CANopenManager={int(eds.device_commissioning.canopen_manager)}')
Expand Down
3 changes: 1 addition & 2 deletions eds_utils/eds_autofix.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ def eds_autofix(sys_args=None):
if sys_args is None:
sys_args = sys.argv[1:]

name = 'eds-autofix'
parser = argparse.ArgumentParser(description=EDS_AUTOFIX_DESCRIPTION, prog=name)
parser = argparse.ArgumentParser(description=EDS_AUTOFIX_DESCRIPTION, prog='eds-autofix')
parser.add_argument('filepath', metavar='FILEPATH', help='file path to EDS/DCF file')
parser.add_argument('-s', '--silence', action='store_true', help='silence prints to stdout')
args = parser.parse_args(sys_args)
Expand Down
2 changes: 1 addition & 1 deletion eds_utils/eds_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def eds_merge(sys_args=None):
if sys_args is None:
sys_args = sys.argv[1:]

parser = argparse.ArgumentParser(description=EDS_MERGE_DESCRIPTION, prog='eds_merge')
parser = argparse.ArgumentParser(description=EDS_MERGE_DESCRIPTION, prog='eds-merge')
parser.add_argument('filepath1', metavar='FILEPATH1',
help='file path to EDS/DCF file to merge from')
parser.add_argument('filepath2', metavar='FILEPATH2',
Expand Down
3 changes: 1 addition & 2 deletions eds_utils/eds_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ def eds_validate(sys_args=None):
if sys_args is None:
sys_args = sys.argv[1:]

name = 'eds-validate'
parser = argparse.ArgumentParser(description=EDS_VALIDATE_DESCRIPTION, prog=name)
parser = argparse.ArgumentParser(description=EDS_VALIDATE_DESCRIPTION, prog='eds-validate')
parser.add_argument('filepath', metavar='FILEPATH', help='file path to EDS/DCF file')
parser.add_argument('-s', '--silence', action='store_true', help='silence prints to stderr')
args = parser.parse_args(sys_args)
Expand Down

0 comments on commit a916644

Please sign in to comment.