Forum: GNU Radio numpy to blob

7408b19ec32de6d126b50f442490c93f?d=identicon&s=25 Peter Horvath (Guest)
on 2013-08-11 23:20
(Received via mailing list)
Hi,

in pmt_to_python.py, there is the following function:

def numpy_to_blob(p):
    p = p.view(np.uint8)
    b = pmt.make_blob(len(p))
    pmt.blob_data(b)[:] = p
    return b

What is the assumed input here? It doesn't seem to work with an ordinary
1D NumPy uint8 array. The pmt.make_blob() function wants to behave like
a C++ function, and expects two arguments, address and array length.

What is the best way to convert NumPy arrays to blobs?

(grextras and all the other stuff Josh was pointing to a couple of days
ago seem to have gone from github.)
Thanks,
Peter
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.