Skip to content

Commit

Permalink
fix(ot-sim): also subscribe to read-write variable types
Browse files Browse the repository at this point in the history
  • Loading branch information
activeshadow committed Dec 7, 2023
1 parent fc10ff3 commit 417479f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/python/phenix_apps/apps/otsim/infrastructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,24 +111,24 @@ def io_module_xml(self, doc, infra, devices):
if isinstance(var_type, dict):
var_type = var_type['type']

if var_type in ['analog-read', 'binary-read']:
sub = ET.Element('subscription')
sub = ET.Element('subscription')

key = ET.SubElement(sub, 'key')
key.text = f'{topic}.{var}'
key = ET.SubElement(sub, 'key')
key.text = f'{topic}.{var}'

tag = ET.SubElement(sub, 'tag')
tag.text = f'{tag_name}.{var}'
tag = ET.SubElement(sub, 'tag')
tag.text = f'{tag_name}.{var}'

typ = ET.SubElement(sub, 'type')
typ = ET.SubElement(sub, 'type')

if var_type == 'analog-read':
typ.text = 'double'
else:
typ.text = 'boolean'
if var_type in ['analog-read', 'analog-read-write']:
typ.text = 'double'
else:
typ.text = 'boolean'

doc.append(sub)

doc.append(sub)
elif var_type in ['analog-read-write', 'binary-read-write']:
if var_type in ['analog-read-write', 'binary-read-write']:
# `endpoint` will be False if disabled, otherwise it will be the name
# of the endpoint to send updates to (prepended with the destination
# federate name).
Expand Down

0 comments on commit 417479f

Please sign in to comment.