diff options
author | Josh Morman <mormjb@gmail.com> | 2020-06-11 11:32:44 -0400 |
---|---|---|
committer | Josh Morman <mormjb@gmail.com> | 2020-06-11 12:14:08 -0400 |
commit | b779baccca6233ac124951ebcf031d641b4bb33b (patch) | |
tree | 922d8a01a24509a8bc6f15621255f6d3cb97a11c | |
parent | a7436c3062aa6e81e476b283f571626b8dd73a07 (diff) |
uhd: remove members not defined in earlier uhd api
-rw-r--r-- | gr-uhd/python/uhd/bindings/uhd_types_python.cc | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/gr-uhd/python/uhd/bindings/uhd_types_python.cc b/gr-uhd/python/uhd/bindings/uhd_types_python.cc index fc4cfb86f2..45202c8395 100644 --- a/gr-uhd/python/uhd/bindings/uhd_types_python.cc +++ b/gr-uhd/python/uhd/bindings/uhd_types_python.cc @@ -22,13 +22,14 @@ void bind_uhd_types(py::module& m) { // Bindings copied from UHD - using str_map = std::map<std::string, std::string>; + // using str_map = std::map<std::string, std::string>; py::class_<::uhd::device_addr_t>(m, "device_addr_t") // Constructors .def(py::init<>()) .def(py::init<std::string>()) - .def(py::init<str_map>()) + // Not defined for UHD < 3.11 + // .def(py::init<str_map>()) // Methods .def("__str__", &uhd::device_addr_t::to_pp_string) @@ -145,11 +146,13 @@ void bind_uhd_types(py::module& m) .def("to_bool", &sensor_value_t::to_bool) .def("to_int", &sensor_value_t::to_int) .def("to_real", &sensor_value_t::to_real) - .def("__str__", &sensor_value_t::to_pp_string) - - // Properties - .def_readwrite("name", &sensor_value_t::name) - .def_readwrite("value", &sensor_value_t::value) - .def_readwrite("unit", &sensor_value_t::unit) - .def_readwrite("type", &sensor_value_t::type); + .def("__str__", &sensor_value_t::to_pp_string); + + // NOTE: UHD 3.9 has these properties defined as const so they cannot be + // set in this manner. + // // Properties + // .def_readwrite("name", &sensor_value_t::name) + // .def_readwrite("value", &sensor_value_t::value) + // .def_readwrite("unit", &sensor_value_t::unit) + // .def_readwrite("type", &sensor_value_t::type); } |