summaryrefslogtreecommitdiff
path: root/gr-uhd/python/uhd/bindings/usrp_sink_python.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/usrp_sink_python.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/usrp_sink_python.cc')
-rw-r--r--gr-uhd/python/uhd/bindings/usrp_sink_python.cc22
1 files changed, 19 insertions, 3 deletions
diff --git a/gr-uhd/python/uhd/bindings/usrp_sink_python.cc b/gr-uhd/python/uhd/bindings/usrp_sink_python.cc
index bbc8ee0fe4..d0a7dc482d 100644
--- a/gr-uhd/python/uhd/bindings/usrp_sink_python.cc
+++ b/gr-uhd/python/uhd/bindings/usrp_sink_python.cc
@@ -25,10 +25,26 @@ void bind_usrp_sink(py::module& m)
using usrp_sink = ::gr::uhd::usrp_sink;
- py::class_<usrp_sink, gr::uhd::usrp_block, std::shared_ptr<usrp_sink>>(
- m, "usrp_sink", D(usrp_sink))
+ py::class_<usrp_sink,
+ gr::uhd::usrp_block,
+ gr::sync_block,
+ gr::block,
+ gr::basic_block,
+ std::shared_ptr<usrp_sink>>(m, "usrp_sink", D(usrp_sink))
+
+ .def(py::init((std::shared_ptr<gr::uhd::usrp_sink>(*)(const ::uhd::device_addr_t&,
+ const ::uhd::stream_args_t&,
+ const std::string&)) &
+ usrp_sink::make),
+ py::arg("device_addr"),
+ py::arg("stream_args"),
+ py::arg("tsb_tag_name") = "",
+ D(usrp_sink, make))
- .def(py::init(&usrp_sink::make),
+ .def(py::init((std::shared_ptr<gr::uhd::usrp_sink>(*)(const std::string&,
+ const ::uhd::stream_args_t&,
+ const std::string&)) &
+ usrp_sink::make),
py::arg("device_addr"),
py::arg("stream_args"),
py::arg("tsb_tag_name") = "",