summaryrefslogtreecommitdiff
path: root/gr-uhd/python/uhd
diff options
context:
space:
mode:
authorCodey McCodeface <Codey.McCodeface@gmail.com>2021-05-21 11:23:27 -0400
committermormj <34754695+mormj@users.noreply.github.com>2021-05-28 11:01:38 -0400
commitc751bf59e074c6fc41920de0d782d34d78768ee9 (patch)
tree3af243d823e9c28c92792acd6937348934bad57b /gr-uhd/python/uhd
parent04f1eb0f98682b8f3a0924273262eacec41355ea (diff)
gr-uhd: Adding missing Python binding for uhd::tune_request_t::policy_t.
Signed-off-by: Codey McCodeface <Codey.McCodeface@gmail.com>
Diffstat (limited to 'gr-uhd/python/uhd')
-rw-r--r--gr-uhd/python/uhd/bindings/uhd_types_python.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/gr-uhd/python/uhd/bindings/uhd_types_python.cc b/gr-uhd/python/uhd/bindings/uhd_types_python.cc
index c593ce480b..f05df299c1 100644
--- a/gr-uhd/python/uhd/bindings/uhd_types_python.cc
+++ b/gr-uhd/python/uhd/bindings/uhd_types_python.cc
@@ -141,7 +141,8 @@ void bind_uhd_types(py::module& m)
// ::uhd::tune_request_t
using tune_request_t = ::uhd::tune_request_t;
- py::class_<tune_request_t>(m, "tune_request_t")
+ py::class_<tune_request_t> tune_request(m, "tune_request_t");
+ tune_request
.def(py::init<double, double>())
.def(py::init<double>(), py::arg("target_freq") = 0.0)
.def_readwrite("target_freq", &tune_request_t::target_freq)
@@ -151,6 +152,13 @@ void bind_uhd_types(py::module& m)
.def_readwrite("dsp_freq", &tune_request_t::dsp_freq)
.def_readwrite("args", &tune_request_t::args);
+ // ::uhd::tune_request_t::policy_t
+ using policy_t = ::uhd::tune_request_t::policy_t;
+ py::enum_<policy_t>(tune_request, "policy_t")
+ .value("POLICY_NONE", policy_t::POLICY_NONE)
+ .value("POLICY_AUTO", policy_t::POLICY_AUTO)
+ .value("POLICY_MANUAL", policy_t::POLICY_MANUAL)
+ .export_values();
// ::uhd::sensor_value_t
using sensor_value_t = uhd::sensor_value_t;