aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2020-11-23 17:59:17 +0100
committermichael-west <michael.west@ettus.com>2020-11-23 14:31:59 -0800
commit5cbcdd93d3e5e69aa8ebda13ad6b02085a3fb5f7 (patch)
tree2736a46adb5a50c681215159ce0cc7057763791b
parent27858fe5c8a512fe3a332d70e20847697e7a50c9 (diff)
downloaduhd-5cbcdd93d3e5e69aa8ebda13ad6b02085a3fb5f7.tar.gz
uhd-5cbcdd93d3e5e69aa8ebda13ad6b02085a3fb5f7.tar.bz2
uhd-5cbcdd93d3e5e69aa8ebda13ad6b02085a3fb5f7.zip
python: multi_usrp: Fix get_radio_control()
This function was incorrectly wrapped into Python and would fail with Python saying it can't hold a reference to the radio block. This changes the wrapping into returning a raw pointer, but also makes the return value policy reference_internal so that garbage collection happens in the right order.
-rw-r--r--host/lib/usrp/multi_usrp_python.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/host/lib/usrp/multi_usrp_python.cpp b/host/lib/usrp/multi_usrp_python.cpp
index c1ee17d0b..34bb96338 100644
--- a/host/lib/usrp/multi_usrp_python.cpp
+++ b/host/lib/usrp/multi_usrp_python.cpp
@@ -90,7 +90,7 @@ void export_multi_usrp(py::module& m)
.def("get_mboard_sensor" , &multi_usrp::get_mboard_sensor, py::arg("name"), py::arg("mboard") = 0)
.def("get_mboard_sensor_names" , &multi_usrp::get_mboard_sensor_names, py::arg("mboard") = 0)
.def("set_user_register" , &multi_usrp::set_user_register, py::arg("addr"), py::arg("data"), py::arg("mboard") = ALL_MBOARDS)
- .def("get_radio_control" , &multi_usrp::get_radio_control, py::arg("chan") = 0)
+ .def("get_radio_control" , [](multi_usrp& self, const size_t chan){ return &self.get_radio_control(chan); }, py::arg("chan") = 0, py::return_value_policy::reference_internal)
.def("get_mb_controller" , &multi_usrp::get_mb_controller, py::arg("mboard") = 0)
// RX methods