X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=grc%2Fblocks%2Fxmlrpc_server.xml;fp=grc%2Fblocks%2Fxmlrpc_server.xml;h=6c31bd1a9a78a47afc423acde0518bde1bed031c;hb=ea29b08aeb54227e6628f655ccfdb96fe4d8c378;hp=0000000000000000000000000000000000000000;hpb=09a1e803a9e6587c78d20cdf16891e5295874668;p=debian%2Fgnuradio diff --git a/grc/blocks/xmlrpc_server.xml b/grc/blocks/xmlrpc_server.xml new file mode 100644 index 00000000..6c31bd1a --- /dev/null +++ b/grc/blocks/xmlrpc_server.xml @@ -0,0 +1,39 @@ + + + + XMLRPC Server + xmlrpc_server + import SimpleXMLRPCServer + import threading + SimpleXMLRPCServer.SimpleXMLRPCServer(($addr, $port), allow_none=True) +self.$(id).register_instance(self) +threading.Thread(target=self.$(id).serve_forever).start() + + Address + addr + localhost + string + + + Port + port + 8080 + int + + +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) + +