I am trying to use message passing in gnuradio maint branch, 3.7.11.1
(python 2.7 based)
When just bringing up a command line window, starting python 2.7,
importing gnuradio, numpy and pmt,
the behavior I get (which agrees with the documentation):
n = np.array([1,2,3,4,5], dtype=uint8)
p = pmt.to_pmt(n)
r = pmt.to_python(p)
printing the types of a, p, and r yield the expected...
type(n) --> <type 'numpy.ndarray'>
type(p) --> <class 'pmt.pmt_swig.swig_int_ptr'>
type(r) --> <type 'numpy.ndarray'>
However when in gnuradio
create and pass the pmt via the message port,
I get a string type after converting to python:
def handle_rxmsg(self, msg):
dat = pmt.to_python(msg) # dat is an np.array[9] of type np.uint8
print "Type of msg: ", type(msg)
print "Type of dat: ", type(dat)
This prints on the gnuradio console:
Type of msg: <class 'pmt.pmt_swig.swig_int_ptr'>
Type of dat: <type 'str'>