[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss-gnuradio] PMT blobs in Python
From: |
Peter Horvath |
Subject: |
[Discuss-gnuradio] PMT blobs in Python |
Date: |
Sat, 03 Aug 2013 21:37:18 -0500 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 |
Hi,
can I convert a blob created by my C++ code (unsigned chars) to a Python
list or NumPy array?
pmt.blob_data() returns a 'SwigPyObject' with which I can't do anything.
Passing it to a NumPy array constructor doesn't seem to do the job.
The blobs are in a tuple:
pmt::pmt_t b1 = pmt::make_blob(a, a_length);
pmt::pmt_t b2 = pmt::make_blob(b, b_length);
return pmt::make_tuple(b1, b2);
And I try to check the contents of b1 in QA code like this:
res = my_test_function()
b1 = pmt.blob_data(pmt.tuple_ref(res, 0))
b1_len = pmt.blob_length(pmt.tuple_ref(res, 0))
Thanks,
Peter
- [Discuss-gnuradio] PMT blobs in Python,
Peter Horvath <=