Digi Connect IT Mini User Manual page 362

Hide thumbs Also See for Connect IT Mini:
Table of Contents

Advertisement

Applications
2. At the shell prompt, use the python command with no parameters to enter an interactive
Python session:
# python
Python 3.6.10 (default, Jan 31 2020, 08:45:19)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
3. Import the device_request module:
>>> from digidevice import device_request
>>>
4. Create a function to handle the request from Remote Manager:
>>> def handler(target, request):
...
print ("received request %s for target %s" % (request, target))
...
return "OK"
...
>>>
5. Register a callbackup function that will be called when the device receives a SCI request from
Remote Manager:
>>> device_request.register("myTarget", handler)
>>>
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>
Digi Connect IT® Mini User Guide
Digidevice module
362

Advertisement

Table of Contents
loading

Table of Contents