Digi IX30 User Manual page 638

Table of Contents

Advertisement

Applications
Note
Leave the interactive Python session active while completing task two, below. Once you have
completed task two, exit the interactive session by using Ctrl-D. You can also exit the session using
exit() or quit().
Task two: Create and send an SCI request from Digi Remote Manager
The second step in using the device_request module is to create an SCI request that Remote Manager
will forward to the device. For example, you can create in SCI request a the Remote Manager API
explorer:
1. In Remote Manager, click Documentation > API Explorer.
2. Select the device to use as the SCI target:
a. Click SCI Targets.
b. Click Add Targets.
c. Enter or select the device ID of the device.
d. Click Add.
e. Click OK.
3. Click Examples > SCI > Data Service > Send Request.
Code similar to the following will be displayed in the HTTP message body text box:
<sci_request version="1.0">
<data_service>
<targets>
<device id="00000000-00000000-0000FFFF-A83CF6A3"/>
</targets>
<requests>
<device_request target_name="myTarget">
</device_request>
</requests>
</data_service>
</sci_request>
Note
The value of the target_name parameter in the device_request element must
correspond to the target parameter of the device_request.register function in the Python
script. In this example, the two are the same.
4. Click Send.
Once that the request has been sent to the device, the handler on the device is executed.
On the device, you will receive the following output:
n
>>> received request
>>>
In Remote Manager, you will receive a response similar to the following:
n
<sci_reply version="1.0">
<data_service>
IX30 User Guide
my payload string
my payload string
for target myTarget
Develop Python applications
638

Advertisement

Table of Contents
loading

Table of Contents