[Discuss-gnuradio] Using the UHD API for Python Programming
From:
Alexander Olihovik
Subject:
[Discuss-gnuradio] Using the UHD API for Python Programming
Date:
Fri, 22 Jun 2012 10:33:47 -0400
Hi all, I'm having some trouble using the C++ UHD API for writing Python code. I understand that the code has been SWIG'd from C++ to Python.
Specifically, the C++ code I want to convert to Python is:
--------------------------------------- uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE);
stream_cmd.num_samps = samps_to_recv;
stream_cmd.stream_now = false;
stream_cmd.time_spec = time_to_recv;
usrp->issue_stream_cmd(stream_cmd);
Running this, I get the error: AttributeError: 'module' object has no attribute 'stream_cmd_t'
What is this struct called after it has been swigged into Python, and how do I access it? As a follow up, does anyone have any general guidelines to follow when writing code from the C++ UHD API into Python?
I've checked the gr-uhd source tree examples, but they didn't provide the insight needed to access the full C++ API.