summaryrefslogtreecommitdiff
path: root/gr-uhd/python/uhd/bindings/python_bindings.cc
diff options
context:
space:
mode:
authorJosh Morman <mormjb@gmail.com>2020-06-10 10:30:12 -0400
committerJosh Morman <mormjb@gmail.com>2020-06-10 13:26:30 -0400
commit0f7369481c40f4b841de8d4f6eca825e7e7b4bda (patch)
tree4498000e906a58639a0bd3a5243ba74ea85d91f9 /gr-uhd/python/uhd/bindings/python_bindings.cc
parent868ec8eecaa1d06696bc072bcf5db300d00da130 (diff)
uhd: fix pybind11 bindings
Instead of relying on the pyuhd pybind11 bindings, create new gr::uhd pybind11 bindings that wrap the underlying types. Trying to use the pyuhd bindings directly has many issues Also, push some of the overloading into the constructors as opposed to in the __init__ functions with constructor interception
Diffstat (limited to 'gr-uhd/python/uhd/bindings/python_bindings.cc')
-rw-r--r--gr-uhd/python/uhd/bindings/python_bindings.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/gr-uhd/python/uhd/bindings/python_bindings.cc b/gr-uhd/python/uhd/bindings/python_bindings.cc
index eeb7c6e430..e32d1b48cc 100644
--- a/gr-uhd/python/uhd/bindings/python_bindings.cc
+++ b/gr-uhd/python/uhd/bindings/python_bindings.cc
@@ -13,8 +13,11 @@
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <numpy/arrayobject.h>
+#include <uhd/version.hpp>
+
namespace py = pybind11;
+void bind_uhd_types(py::module&);
void bind_amsg_source(py::module&);
void bind_usrp_block(py::module&);
void bind_usrp_sink(py::module&);
@@ -39,8 +42,14 @@ PYBIND11_MODULE(uhd_python, m)
// Allow access to base block methods
py::module::import("gnuradio.gr");
+ bind_uhd_types(m);
bind_amsg_source(m);
bind_usrp_block(m);
bind_usrp_sink(m);
bind_usrp_source(m);
+
+ m.def(
+ "get_version_string",
+ []() { return ::uhd::get_version_string(); },
+ "Returns UHD Version String");
}