diff options
author | Martin Braun <martin.braun@ettus.com> | 2020-10-12 12:22:00 +0200 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-10-16 14:58:15 -0500 |
commit | 7ee106187e1d0991e7ae79abd905a79dc5760b5f (patch) | |
tree | 4cf445e5b170817692567120e8506e20f5afb878 /host/lib/usrp/multi_usrp_python.cpp | |
parent | 0167ad7608adb170970458b19735738808f0c5c8 (diff) | |
download | uhd-7ee106187e1d0991e7ae79abd905a79dc5760b5f.tar.gz uhd-7ee106187e1d0991e7ae79abd905a79dc5760b5f.tar.bz2 uhd-7ee106187e1d0991e7ae79abd905a79dc5760b5f.zip |
python: Add access to the property_tree from Python
Example:
>>> usrp = uhd.usrp.multi_usrp("")
>>> tree = usrp.get_tree()
>>> print(tree.access_int("/name").get())
Diffstat (limited to 'host/lib/usrp/multi_usrp_python.cpp')
-rw-r--r-- | host/lib/usrp/multi_usrp_python.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/host/lib/usrp/multi_usrp_python.cpp b/host/lib/usrp/multi_usrp_python.cpp index 602fc5178..c1ee17d0b 100644 --- a/host/lib/usrp/multi_usrp_python.cpp +++ b/host/lib/usrp/multi_usrp_python.cpp @@ -5,7 +5,9 @@ // SPDX-License-Identifier: GPL-3.0-or-later // +#include <pybind11/complex.h> #include <pybind11/pybind11.h> +#include <pybind11/stl.h> namespace py = pybind11; @@ -27,6 +29,8 @@ void export_multi_usrp(py::module& m) .def(py::init(&multi_usrp::make)) // clang-format off + .def("get_tree" , &multi_usrp::get_tree) + // General USRP methods .def("get_rx_freq" , &multi_usrp::get_rx_freq, py::arg("chan") = 0) .def("get_rx_num_channels" , &multi_usrp::get_rx_num_channels) |