aboutsummaryrefslogtreecommitdiffstats
path: root/host/python/pyuhd.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2020-12-04 13:53:34 +0100
committermichael-west <michael.west@ettus.com>2020-12-07 11:53:35 -0800
commit60fb5d5f1377f5a4af7e1e55b1ec83fed864153f (patch)
treea9e12d953cad5de20be2270fb9504a9b0c6c83fe /host/python/pyuhd.cpp
parenteaf006225425e146657a09c7360aca1f9615886d (diff)
downloaduhd-60fb5d5f1377f5a4af7e1e55b1ec83fed864153f.tar.gz
uhd-60fb5d5f1377f5a4af7e1e55b1ec83fed864153f.tar.bz2
uhd-60fb5d5f1377f5a4af7e1e55b1ec83fed864153f.zip
python: Add find() to the Python API
This a mapping of uhd::device::find() into uhd.find() on the Python side. The uhd::device is intentionally not mapped into Python (prefer MultiUSRP or RfnocGraph instead), so the namespace is moved up one level. Example: >>> import uhd >>> # Now print the device args for all found B200s: >>> for dev_args in uhd.find("type=b200")): print(dev_args.to_string())
Diffstat (limited to 'host/python/pyuhd.cpp')
-rw-r--r--host/python/pyuhd.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/host/python/pyuhd.cpp b/host/python/pyuhd.cpp
index eadb88d40..ca06f2d97 100644
--- a/host/python/pyuhd.cpp
+++ b/host/python/pyuhd.cpp
@@ -14,6 +14,7 @@
namespace py = pybind11;
#include "cal/cal_python.hpp"
+#include "device_python.hpp"
#include "property_tree_python.hpp"
#include "rfnoc/ddc_block_control_python.hpp"
#include "rfnoc/duc_block_control_python.hpp"
@@ -61,6 +62,9 @@ PYBIND11_MODULE(libpyuhd, m)
// (otherwise we will see segmentation faults)
init_numpy();
+ // Register uhd::device::find
+ export_device(m);
+
// Register paths submodule
auto paths_module = m.def_submodule("paths", "Path Utilities");
export_paths(paths_module);