summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/python/gnuradio/ctrlport/RPCConnectionThrift.py
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-runtime/python/gnuradio/ctrlport/RPCConnectionThrift.py')
-rw-r--r--gnuradio-runtime/python/gnuradio/ctrlport/RPCConnectionThrift.py17
1 files changed, 17 insertions, 0 deletions
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)