diff options
author | jblum | 2008-09-07 21:38:12 +0000 |
---|---|---|
committer | jblum | 2008-09-07 21:38:12 +0000 |
commit | c86f6c23c6883f73d953d64c28ab42cedb77e4d7 (patch) | |
tree | 0193b2a649eb0f7f1065912862de340a02848e16 /grc/data/platforms/python/blocks/xmlrpc_server.xml | |
parent | ddec4fc07744a6519086b1b111f29d551b7f19c6 (diff) | |
download | gnuradio-c86f6c23c6883f73d953d64c28ab42cedb77e4d7.tar.gz gnuradio-c86f6c23c6883f73d953d64c28ab42cedb77e4d7.tar.bz2 gnuradio-c86f6c23c6883f73d953d64c28ab42cedb77e4d7.zip |
Merged r9481:9518 on jblum/grc_reorganize into trunk. Reorganized grc source under gnuradio.grc module. Trunk passes make distcheck.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9525 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc/data/platforms/python/blocks/xmlrpc_server.xml')
-rw-r--r-- | grc/data/platforms/python/blocks/xmlrpc_server.xml | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/grc/data/platforms/python/blocks/xmlrpc_server.xml b/grc/data/platforms/python/blocks/xmlrpc_server.xml new file mode 100644 index 000000000..40e547efc --- /dev/null +++ b/grc/data/platforms/python/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> |