EasyManua.ls Logo

Digi ConnectPort X2e ZB - Page 65

Digi ConnectPort X2e ZB
72 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Sample programs
65
Make an RCI request-example program
Following is a simple RCI callback example:
import rci (1)
def cb(req): (2)
print "Received request: " + req (3)
r=rci.RciCallback() (4)
r.register_callback('test', cb) (5)
rci.process_request('<rci_request version="1.1"><do_command
target="test"><customxml/></do_command></rci_request>') (6)
Program notes
1 The rci module includes the RciCallback class needed by the program.
2 Create a function to be called whenever a remote entity wishes to communicate with this
script.
3 This simple function will simply demonstrate that it received a request that could be parsed
and handled however the application saw fit.
4 Create a callback object.
5 Assign the target “test” to the new callback object. If a remote entity issues a
“do_command” with the target “test”, the supplied callback function will be called.
6 This is simply an example that causes the callback to be called. This example could also
have been a remote SCI query through iDigi.

Table of Contents

Other manuals for Digi ConnectPort X2e ZB

Related product manuals