diff options
author | Manoj Gudi | 2013-10-07 20:19:55 +0530 |
---|---|---|
committer | Manoj Gudi | 2013-10-07 20:20:35 +0530 |
commit | 1826d0763c8595997f5f4af1fdb0354e9c0998ad (patch) | |
tree | acbd852cd5a1bf17241b1038b5e37a0e72e64612 /grc/blocks/xmlrpc_server.xml | |
parent | 452defdb4a78e9e826740ddf4b9673e926c568a4 (diff) | |
parent | 24b640997ba7fee0c725e65f401f5cbebdab8d08 (diff) | |
download | gnuradio-1826d0763c8595997f5f4af1fdb0354e9c0998ad.tar.gz gnuradio-1826d0763c8595997f5f4af1fdb0354e9c0998ad.tar.bz2 gnuradio-1826d0763c8595997f5f4af1fdb0354e9c0998ad.zip |
README change
Diffstat (limited to 'grc/blocks/xmlrpc_server.xml')
-rw-r--r-- | grc/blocks/xmlrpc_server.xml | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/grc/blocks/xmlrpc_server.xml b/grc/blocks/xmlrpc_server.xml new file mode 100644 index 000000000..6c31bd1a9 --- /dev/null +++ b/grc/blocks/xmlrpc_server.xml @@ -0,0 +1,39 @@ +<?xml version="1.0"?> +<!-- +################################################### +##Simple XMLRPC Server +################################################### + --> +<block> + <name>XMLRPC Server</name> + <key>xmlrpc_server</key> + <import>import SimpleXMLRPCServer</import> + <import>import threading</import> + <make>SimpleXMLRPCServer.SimpleXMLRPCServer(($addr, $port), allow_none=True) +self.$(id).register_instance(self) +threading.Thread(target=self.$(id).serve_forever).start()</make> + <param> + <name>Address</name> + <key>addr</key> + <value>localhost</value> + <type>string</type> + </param> + <param> + <name>Port</name> + <key>port</key> + <value>8080</value> + <type>int</type> + </param> + <doc> +This block will start an XMLRPC server. \ +The server provides access to the run, start, stop, wait functions of the flow graph. \ +The server also provides access to the variable callbacks in the flow graph. \ +Ex: If the variable is called freq, the function provided by the server will be called set_freq(new_freq). + +Example client in python: + +import xmlrpclib +s = xmlrpclib.Server('http://localhost:8080') +s.set_freq(5000) + </doc> +</block> |