diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2015-10-17 10:19:36 -0700 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2015-10-17 10:19:36 -0700 |
commit | 1ae4db2cd676a027cc146015851ab57810ba84c0 (patch) | |
tree | 7b8091aa379e5f87b1ce88abe7524bf020b585d1 /gnuradio-runtime/python | |
parent | de3f86e60c4c9b64b7ba887e315aef2c53143213 (diff) | |
parent | 83da78945f7e68da2630f7006ce319d758fdc29d (diff) |
Merge branch 'master' into next
Diffstat (limited to 'gnuradio-runtime/python')
-rw-r--r-- | gnuradio-runtime/python/gnuradio/ctrlport/RPCConnection.py | 3 | ||||
-rw-r--r-- | gnuradio-runtime/python/gnuradio/ctrlport/RPCConnectionThrift.py | 17 |
2 files changed, 20 insertions, 0 deletions
diff --git a/gnuradio-runtime/python/gnuradio/ctrlport/RPCConnection.py b/gnuradio-runtime/python/gnuradio/ctrlport/RPCConnection.py index e14cc0cea7..1b129534c9 100644 --- a/gnuradio-runtime/python/gnuradio/ctrlport/RPCConnection.py +++ b/gnuradio-runtime/python/gnuradio/ctrlport/RPCConnection.py @@ -105,6 +105,9 @@ class RPCConnection(object): def getRe(self,*args): raise exceptions.NotImplementedError() + def postMessage(self,*args): + raise exceptions.NotImplementedError() + def setKnobs(self,*args): raise exceptions.NotImplementedError() diff --git a/gnuradio-runtime/python/gnuradio/ctrlport/RPCConnectionThrift.py b/gnuradio-runtime/python/gnuradio/ctrlport/RPCConnectionThrift.py index 9a2a302af5..522c74117b 100644 --- a/gnuradio-runtime/python/gnuradio/ctrlport/RPCConnectionThrift.py +++ b/gnuradio-runtime/python/gnuradio/ctrlport/RPCConnectionThrift.py @@ -27,6 +27,7 @@ from thrift.protocol import TBinaryProtocol from gnuradio.ctrlport.GNURadio import ControlPort from gnuradio.ctrlport import RPCConnection from gnuradio import gr +import pmt import sys class ThriftRadioClient: @@ -196,6 +197,22 @@ class RPCConnectionThrift(RPCConnection.RPCConnection): def shutdown(self): self.thriftclient.radio.shutdown() + def postMessage(self, blk_alias, port, msg): + ''' + blk_alias: the alias of the block we are posting the message + to; must have an open message port named 'port'. + Provide as a string. + port: The name of the message port we are sending the message to. + Provide as a string. + msg: The actual message. Provide this as a PMT of the form + right for the message port. + The alias and port names are converted to PMT symbols and + serialized. The msg is already a PMT and so just serialized. + ''' + self.thriftclient.radio.postMessage(pmt.serialize_str(pmt.intern(blk_alias)), + pmt.serialize_str(pmt.intern(port)), + pmt.serialize_str(msg)); + def printProperties(self, props): info = "" info += "Item:\t\t{0}\n".format(props.description) |