Skip to content

Commit 72b75b4

Browse files
mlchanmlchan
mlchan
authored and
mlchan
committed
ADded attribute to send sci operaton tag
Signed-off-by: mlchan <Ming.Liu-Chan@digi.com>
1 parent 3cf1bf7 commit 72b75b4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

devicecloud/sci.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
SCI_TEMPLATE = """\
1414
<sci_request version="1.0">
15-
<{operation}{reply}{synchronous}{cache}{sync_timeout}{allow_offline}{wait_for_reconnect}>
15+
<{operation}{attribute}{reply}{synchronous}{cache}{sync_timeout}{allow_offline}{wait_for_reconnect}>
1616
<targets>
1717
{targets}
1818
</targets>
@@ -131,7 +131,7 @@ def send_sci_async(self, operation, target, payload, **sci_options):
131131
return AsyncRequestProxy(job_id, self._conn)
132132

133133
def send_sci(self, operation, target, payload, reply=None, synchronous=None, sync_timeout=None,
134-
cache=None, allow_offline=None, wait_for_reconnect=None):
134+
cache=None, allow_offline=None, wait_for_reconnect=None, attribute=None):
135135
"""Send SCI request to 1 or more targets
136136
137137
:param str operation: The operation is one of {send_message, update_firmware, disconnect, query_firmware_targets,
@@ -204,6 +204,11 @@ def send_sci(self, operation, target, payload, reply=None, synchronous=None, syn
204204
else:
205205
wait_for_reconnect_xml = ''
206206

207+
if attribute is not None:
208+
operation_attribute = ' ' + attribute
209+
else:
210+
operation_attribute = ''
211+
207212
full_request = SCI_TEMPLATE.format(
208213
operation=operation,
209214
targets=targets_xml,
@@ -213,7 +218,8 @@ def send_sci(self, operation, target, payload, reply=None, synchronous=None, syn
213218
cache=cache_xml,
214219
allow_offline=allow_offline_xml,
215220
wait_for_reconnect=wait_for_reconnect_xml,
216-
payload=payload
221+
payload=payload,
222+
attribute=operation_attribute
217223
)
218224

219225
# TODO: do parsing here?

0 commit comments

Comments
 (0)