diff options
Diffstat (limited to 'gr-digital/python/digital/bindings')
6 files changed, 62 insertions, 2 deletions
diff --git a/gr-digital/python/digital/bindings/CMakeLists.txt b/gr-digital/python/digital/bindings/CMakeLists.txt index 4d24678ec9..762769419b 100644 --- a/gr-digital/python/digital/bindings/CMakeLists.txt +++ b/gr-digital/python/digital/bindings/CMakeLists.txt @@ -32,6 +32,7 @@ list(APPEND digital_python_files crc32_bb_python.cc decision_feedback_equalizer_python.cc descrambler_bb_python.cc + diff_coding_type_python.cc diff_decoder_bb_python.cc diff_encoder_bb_python.cc diff_phasor_cc_python.cc diff --git a/gr-digital/python/digital/bindings/diff_coding_type_python.cc b/gr-digital/python/digital/bindings/diff_coding_type_python.cc new file mode 100644 index 0000000000..5663b27127 --- /dev/null +++ b/gr-digital/python/digital/bindings/diff_coding_type_python.cc @@ -0,0 +1,40 @@ +/* + * Copyright 2021 Daniel Estevez <daniel@destevez.net> + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ + +/***********************************************************************************/ +/* This file is automatically generated using bindtool and can be manually edited */ +/* The following lines can be configured to regenerate this file during cmake */ +/* If manual edits are made, the following tags should be modified accordingly. */ +/* BINDTOOL_GEN_AUTOMATIC(0) */ +/* BINDTOOL_USE_PYGCCXML(0) */ +/* BINDTOOL_HEADER_FILE(diff_coding_type.h) */ +/* BINDTOOL_HEADER_FILE_HASH(d2a67d2eacf4d643b8df9d240a971837) */ +/***********************************************************************************/ + +#include <pybind11/complex.h> +#include <pybind11/pybind11.h> +#include <pybind11/stl.h> + +namespace py = pybind11; + +#include <gnuradio/digital/diff_coding_type.h> +// pydoc.h is automatically generated in the build directory +#include <diff_coding_type_pydoc.h> + +void bind_diff_coding_type(py::module& m) +{ + + + py::enum_<::gr::digital::diff_coding_type>(m, "diff_coding_type") + .value("DIFF_DIFFERENTIAL", ::gr::digital::DIFF_DIFFERENTIAL) // 0 + .value("DIFF_NRZI", ::gr::digital::DIFF_NRZI) // 1 + .export_values(); + + py::implicitly_convertible<int, ::gr::digital::diff_coding_type>(); +} diff --git a/gr-digital/python/digital/bindings/diff_decoder_bb_python.cc b/gr-digital/python/digital/bindings/diff_decoder_bb_python.cc index f7fb6b0943..a5628fb372 100644 --- a/gr-digital/python/digital/bindings/diff_decoder_bb_python.cc +++ b/gr-digital/python/digital/bindings/diff_decoder_bb_python.cc @@ -14,7 +14,7 @@ /* BINDTOOL_GEN_AUTOMATIC(0) */ /* BINDTOOL_USE_PYGCCXML(0) */ /* BINDTOOL_HEADER_FILE(diff_decoder_bb.h) */ -/* BINDTOOL_HEADER_FILE_HASH(3814f3ba5b3a9425eae5611e1a4876ec) */ +/* BINDTOOL_HEADER_FILE_HASH(92f143bcb3f067b3cdf8292a75956d31) */ /***********************************************************************************/ #include <pybind11/complex.h> @@ -41,6 +41,7 @@ void bind_diff_decoder_bb(py::module& m) .def(py::init(&diff_decoder_bb::make), py::arg("modulus"), + py::arg("nrzi") = ::gr::digital::DIFF_DIFFERENTIAL, D(diff_decoder_bb, make)) diff --git a/gr-digital/python/digital/bindings/diff_encoder_bb_python.cc b/gr-digital/python/digital/bindings/diff_encoder_bb_python.cc index d27c5feec2..817b2e3da1 100644 --- a/gr-digital/python/digital/bindings/diff_encoder_bb_python.cc +++ b/gr-digital/python/digital/bindings/diff_encoder_bb_python.cc @@ -14,7 +14,7 @@ /* BINDTOOL_GEN_AUTOMATIC(0) */ /* BINDTOOL_USE_PYGCCXML(0) */ /* BINDTOOL_HEADER_FILE(diff_encoder_bb.h) */ -/* BINDTOOL_HEADER_FILE_HASH(e817d23aac894b3563101df2958577de) */ +/* BINDTOOL_HEADER_FILE_HASH(866ae99d6fc12353e8d45ba2424bcecd) */ /***********************************************************************************/ #include <pybind11/complex.h> @@ -41,6 +41,7 @@ void bind_diff_encoder_bb(py::module& m) .def(py::init(&diff_encoder_bb::make), py::arg("modulus"), + py::arg("coding") = ::gr::digital::DIFF_DIFFERENTIAL, D(diff_encoder_bb, make)) diff --git a/gr-digital/python/digital/bindings/docstrings/diff_coding_type_pydoc_template.h b/gr-digital/python/digital/bindings/docstrings/diff_coding_type_pydoc_template.h new file mode 100644 index 0000000000..84c1cb8104 --- /dev/null +++ b/gr-digital/python/digital/bindings/docstrings/diff_coding_type_pydoc_template.h @@ -0,0 +1,15 @@ +/* + * Copyright 2020 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + */ +#include "pydoc_macros.h" +#define D(...) DOC(gr, digital, __VA_ARGS__) +/* + This file contains placeholders for docstrings for the Python bindings. + Do not edit! These were automatically extracted during the binding process + and will be overwritten during the build process + */ diff --git a/gr-digital/python/digital/bindings/python_bindings.cc b/gr-digital/python/digital/bindings/python_bindings.cc index 830902679d..0eabcf63d1 100644 --- a/gr-digital/python/digital/bindings/python_bindings.cc +++ b/gr-digital/python/digital/bindings/python_bindings.cc @@ -42,6 +42,7 @@ void bind_crc32_async_bb(py::module&); void bind_crc32_bb(py::module&); void bind_decision_feedback_equalizer(py::module&); void bind_descrambler_bb(py::module&); +void bind_diff_coding_type(py::module&); void bind_diff_decoder_bb(py::module&); void bind_diff_encoder_bb(py::module&); void bind_diff_phasor_cc(py::module&); @@ -143,6 +144,7 @@ PYBIND11_MODULE(digital_python, m) bind_crc32_bb(m); bind_decision_feedback_equalizer(m); bind_descrambler_bb(m); + bind_diff_coding_type(m); bind_diff_decoder_bb(m); bind_diff_encoder_bb(m); bind_diff_phasor_cc(m); |