diff --git a/include/ieee802_11/constellations.h b/include/ieee802_11/constellations.h index 76b6dde..c6c9e89 100644 --- a/include/ieee802_11/constellations.h +++ b/include/ieee802_11/constellations.h @@ -29,6 +29,7 @@ class IEEE802_11_API constellation_bpsk : virtual public digital::constellation public: typedef std::shared_ptr sptr; static sptr make(); + sptr base() { return std::dynamic_pointer_cast(shared_from_this()); } protected: constellation_bpsk(); @@ -39,6 +40,7 @@ class IEEE802_11_API constellation_qpsk : virtual public digital::constellation public: typedef std::shared_ptr sptr; static sptr make(); + sptr base() { return std::dynamic_pointer_cast(shared_from_this()); } protected: constellation_qpsk(); @@ -49,6 +51,7 @@ class IEEE802_11_API constellation_16qam : virtual public digital::constellation public: typedef std::shared_ptr sptr; static sptr make(); + sptr base() { return std::dynamic_pointer_cast(shared_from_this()); } protected: constellation_16qam(); @@ -59,6 +62,7 @@ class IEEE802_11_API constellation_64qam : virtual public digital::constellation public: typedef std::shared_ptr sptr; static sptr make(); + sptr base() { return std::dynamic_pointer_cast(shared_from_this()); } protected: constellation_64qam(); diff --git a/include/ieee802_11/frame_equalizer.h b/include/ieee802_11/frame_equalizer.h index a73943b..2627f66 100644 --- a/include/ieee802_11/frame_equalizer.h +++ b/include/ieee802_11/frame_equalizer.h @@ -23,6 +23,9 @@ #include #include +namespace gr { +namespace ieee802_11 { + enum Equalizer { LS = 0, LMS = 1, @@ -30,8 +33,6 @@ enum Equalizer { STA = 3, }; -namespace gr { -namespace ieee802_11 { class IEEE802_11_API frame_equalizer : virtual public gr::block { diff --git a/include/ieee802_11/mapper.h b/include/ieee802_11/mapper.h index 900ce5d..fd9512d 100644 --- a/include/ieee802_11/mapper.h +++ b/include/ieee802_11/mapper.h @@ -20,6 +20,9 @@ #include #include +namespace gr { +namespace ieee802_11 { + enum Encoding { BPSK_1_2 = 0, BPSK_3_4 = 1, @@ -31,9 +34,6 @@ enum Encoding { QAM64_3_4 = 7, }; -namespace gr { -namespace ieee802_11 { - class IEEE802_11_API mapper : virtual public block { public: diff --git a/include/ieee802_11/signal_field.h b/include/ieee802_11/signal_field.h index 60529a4..ef0bcc5 100644 --- a/include/ieee802_11/signal_field.h +++ b/include/ieee802_11/signal_field.h @@ -20,6 +20,7 @@ #include #include +#include namespace gr { namespace ieee802_11 { @@ -29,6 +30,12 @@ class IEEE802_11_API signal_field : virtual public digital::packet_header_defaul public: typedef std::shared_ptr sptr; static sptr make(); + sptr base() { + return std::dynamic_pointer_cast(shared_from_this()); + } + sptr formatter() { + return std::dynamic_pointer_cast(shared_from_this()); + } protected: signal_field(); diff --git a/lib/utils.cc b/lib/utils.cc index 7aabab3..0561ff7 100644 --- a/lib/utils.cc +++ b/lib/utils.cc @@ -20,6 +20,15 @@ #include #include +using gr::ieee802_11::BPSK_1_2; +using gr::ieee802_11::BPSK_3_4; +using gr::ieee802_11::QPSK_1_2; +using gr::ieee802_11::QPSK_3_4; +using gr::ieee802_11::QAM16_1_2; +using gr::ieee802_11::QAM16_3_4; +using gr::ieee802_11::QAM64_2_3; +using gr::ieee802_11::QAM64_3_4; + ofdm_param::ofdm_param(Encoding e) { encoding = e; diff --git a/lib/utils.h b/lib/utils.h index 8a1fd50..b4694ad 100644 --- a/lib/utils.h +++ b/lib/utils.h @@ -23,6 +23,8 @@ #include #include +using gr::ieee802_11::Encoding; + #define MAX_PAYLOAD_SIZE 1500 #define MAX_PSDU_SIZE (MAX_PAYLOAD_SIZE + 28) // MAC, CRC #define MAX_SYM (((16 + 8 * MAX_PSDU_SIZE + 6) / 24) + 1) diff --git a/python/bindings/CMakeLists.txt b/python/bindings/CMakeLists.txt index 3fa4e12..60263a8 100644 --- a/python/bindings/CMakeLists.txt +++ b/python/bindings/CMakeLists.txt @@ -29,6 +29,18 @@ include(GrPybind) ######################################################################## list(APPEND ieee802_11_python_files + chunks_to_symbols_python.cc + constellations_python.cc + decode_mac_python.cc + ether_encap_python.cc + extract_csi_python.cc + frame_equalizer_python.cc + mac_python.cc + mapper_python.cc + parse_mac_python.cc + signal_field_python.cc + sync_long_python.cc + sync_short_python.cc python_bindings.cc) GR_PYBIND_MAKE_OOT(ieee802_11 diff --git a/python/bindings/chunks_to_symbols_python.cc b/python/bindings/chunks_to_symbols_python.cc new file mode 100644 index 0000000..1658f37 --- /dev/null +++ b/python/bindings/chunks_to_symbols_python.cc @@ -0,0 +1,59 @@ +/* + * Copyright 2021 Free Software Foundation, Inc. + * + * 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(chunks_to_symbols.h) */ +/* BINDTOOL_HEADER_FILE_HASH(3d2f4de89018fc7c7ee96d450ca48179) */ +/***********************************************************************************/ + +#include +#include +#include + +namespace py = pybind11; + +#include +// pydoc.h is automatically generated in the build directory +#include + +void bind_chunks_to_symbols(py::module& m) +{ + + using chunks_to_symbols = ::gr::ieee802_11::chunks_to_symbols; + + + py::class_>(m, "chunks_to_symbols", D(chunks_to_symbols)) + + .def(py::init(&chunks_to_symbols::make), + D(chunks_to_symbols,make) + ) + + + + + ; + + + + +} + + + + + + + + diff --git a/python/bindings/constellations_python.cc b/python/bindings/constellations_python.cc new file mode 100644 index 0000000..0b2ca6b --- /dev/null +++ b/python/bindings/constellations_python.cc @@ -0,0 +1,125 @@ +/* + * Copyright 2021 Free Software Foundation, Inc. + * + * 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(constellations.h) */ +/* BINDTOOL_HEADER_FILE_HASH(b80d50dfe0fc254d8d6101aee3d2bcad) */ +/***********************************************************************************/ + +#include +#include +#include + +namespace py = pybind11; + +#include +// pydoc.h is automatically generated in the build directory +#include + +void bind_constellations(py::module& m) +{ + + using constellation_bpsk = ::gr::ieee802_11::constellation_bpsk; + using constellation_qpsk = ::gr::ieee802_11::constellation_qpsk; + using constellation_16qam = ::gr::ieee802_11::constellation_16qam; + using constellation_64qam = ::gr::ieee802_11::constellation_64qam; + + + py::class_>(m, "constellation_bpsk", D(constellation_bpsk)) + + .def(py::init(&constellation_bpsk::make), + D(constellation_bpsk,make) + ) + + + + + + + .def("base",&constellation_bpsk::base, + D(constellation_bpsk,base) + ) + + ; + + + py::class_>(m, "constellation_qpsk", D(constellation_qpsk)) + + .def(py::init(&constellation_qpsk::make), + D(constellation_qpsk,make) + ) + + + + + + + .def("base",&constellation_qpsk::base, + D(constellation_qpsk,base) + ) + + ; + + + py::class_>(m, "constellation_16qam", D(constellation_16qam)) + + .def(py::init(&constellation_16qam::make), + D(constellation_16qam,make) + ) + + + + + + + .def("base",&constellation_16qam::base, + D(constellation_16qam,base) + ) + + ; + + + py::class_>(m, "constellation_64qam", D(constellation_64qam)) + + .def(py::init(&constellation_64qam::make), + D(constellation_64qam,make) + ) + + + + + + + .def("base",&constellation_64qam::base, + D(constellation_64qam,base) + ) + + ; + + + + +} + + + + + + + + diff --git a/python/bindings/decode_mac_python.cc b/python/bindings/decode_mac_python.cc new file mode 100644 index 0000000..a1dfde6 --- /dev/null +++ b/python/bindings/decode_mac_python.cc @@ -0,0 +1,61 @@ +/* + * Copyright 2021 Free Software Foundation, Inc. + * + * 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(decode_mac.h) */ +/* BINDTOOL_HEADER_FILE_HASH(cace2c32f544fb653ce489c979eb4082) */ +/***********************************************************************************/ + +#include +#include +#include + +namespace py = pybind11; + +#include +// pydoc.h is automatically generated in the build directory +#include + +void bind_decode_mac(py::module& m) +{ + + using decode_mac = ::gr::ieee802_11::decode_mac; + + + py::class_>(m, "decode_mac", D(decode_mac)) + + .def(py::init(&decode_mac::make), + py::arg("log") = false, + py::arg("debug") = false, + D(decode_mac,make) + ) + + + + + ; + + + + +} + + + + + + + + diff --git a/python/bindings/docstrings/chunks_to_symbols_pydoc_template.h b/python/bindings/docstrings/chunks_to_symbols_pydoc_template.h new file mode 100644 index 0000000..44c5689 --- /dev/null +++ b/python/bindings/docstrings/chunks_to_symbols_pydoc_template.h @@ -0,0 +1,27 @@ +/* + * Copyright 2021 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,ieee802_11, __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 + */ + + + + static const char *__doc_gr_ieee802_11_chunks_to_symbols = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_chunks_to_symbols_chunks_to_symbols = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_chunks_to_symbols_make = R"doc()doc"; + + diff --git a/python/bindings/docstrings/constellations_pydoc_template.h b/python/bindings/docstrings/constellations_pydoc_template.h new file mode 100644 index 0000000..7397d4d --- /dev/null +++ b/python/bindings/docstrings/constellations_pydoc_template.h @@ -0,0 +1,66 @@ +/* + * Copyright 2021 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,ieee802_11, __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 + */ + + + + static const char *__doc_gr_ieee802_11_constellation_bpsk = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_constellation_bpsk_constellation_bpsk = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_constellation_bpsk_make = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_constellation_bpsk_base = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_constellation_qpsk = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_constellation_qpsk_constellation_qpsk = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_constellation_qpsk_make = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_constellation_qpsk_base = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_constellation_16qam = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_constellation_16qam_constellation_16qam = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_constellation_16qam_make = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_constellation_16qam_base = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_constellation_64qam = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_constellation_64qam_constellation_64qam = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_constellation_64qam_make = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_constellation_64qam_base = R"doc()doc"; + + diff --git a/python/bindings/docstrings/decode_mac_pydoc_template.h b/python/bindings/docstrings/decode_mac_pydoc_template.h new file mode 100644 index 0000000..050b772 --- /dev/null +++ b/python/bindings/docstrings/decode_mac_pydoc_template.h @@ -0,0 +1,27 @@ +/* + * Copyright 2021 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,ieee802_11, __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 + */ + + + + static const char *__doc_gr_ieee802_11_decode_mac = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_decode_mac_decode_mac = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_decode_mac_make = R"doc()doc"; + + diff --git a/python/bindings/docstrings/ether_encap_pydoc_template.h b/python/bindings/docstrings/ether_encap_pydoc_template.h new file mode 100644 index 0000000..54b3ce3 --- /dev/null +++ b/python/bindings/docstrings/ether_encap_pydoc_template.h @@ -0,0 +1,27 @@ +/* + * Copyright 2021 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,ieee802_11, __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 + */ + + + + static const char *__doc_gr_ieee802_11_ether_encap = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_ether_encap_ether_encap = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_ether_encap_make = R"doc()doc"; + + diff --git a/python/bindings/docstrings/extract_csi_pydoc_template.h b/python/bindings/docstrings/extract_csi_pydoc_template.h new file mode 100644 index 0000000..9902b3d --- /dev/null +++ b/python/bindings/docstrings/extract_csi_pydoc_template.h @@ -0,0 +1,27 @@ +/* + * Copyright 2021 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,ieee802_11, __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 + */ + + + + static const char *__doc_gr_ieee802_11_extract_csi = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_extract_csi_extract_csi = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_extract_csi_make = R"doc()doc"; + + diff --git a/python/bindings/docstrings/frame_equalizer_pydoc_template.h b/python/bindings/docstrings/frame_equalizer_pydoc_template.h new file mode 100644 index 0000000..9ba8141 --- /dev/null +++ b/python/bindings/docstrings/frame_equalizer_pydoc_template.h @@ -0,0 +1,39 @@ +/* + * Copyright 2021 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,ieee802_11, __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 + */ + + + + static const char *__doc_gr_ieee802_11_frame_equalizer = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_frame_equalizer_frame_equalizer_0 = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_frame_equalizer_frame_equalizer_1 = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_frame_equalizer_make = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_frame_equalizer_set_algorithm = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_frame_equalizer_set_bandwidth = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_frame_equalizer_set_frequency = R"doc()doc"; + + diff --git a/python/bindings/docstrings/mac_pydoc_template.h b/python/bindings/docstrings/mac_pydoc_template.h new file mode 100644 index 0000000..52dc376 --- /dev/null +++ b/python/bindings/docstrings/mac_pydoc_template.h @@ -0,0 +1,27 @@ +/* + * Copyright 2021 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,ieee802_11, __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 + */ + + + + static const char *__doc_gr_ieee802_11_mac = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_mac_mac = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_mac_make = R"doc()doc"; + + diff --git a/python/bindings/docstrings/mapper_pydoc_template.h b/python/bindings/docstrings/mapper_pydoc_template.h new file mode 100644 index 0000000..6e63d0c --- /dev/null +++ b/python/bindings/docstrings/mapper_pydoc_template.h @@ -0,0 +1,33 @@ +/* + * Copyright 2021 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,ieee802_11, __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 + */ + + + + static const char *__doc_gr_ieee802_11_mapper = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_mapper_mapper_0 = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_mapper_mapper_1 = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_mapper_make = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_mapper_set_encoding = R"doc()doc"; + + diff --git a/python/bindings/docstrings/parse_mac_pydoc_template.h b/python/bindings/docstrings/parse_mac_pydoc_template.h new file mode 100644 index 0000000..3c3a644 --- /dev/null +++ b/python/bindings/docstrings/parse_mac_pydoc_template.h @@ -0,0 +1,27 @@ +/* + * Copyright 2021 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,ieee802_11, __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 + */ + + + + static const char *__doc_gr_ieee802_11_parse_mac = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_parse_mac_parse_mac = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_parse_mac_make = R"doc()doc"; + + diff --git a/python/bindings/docstrings/signal_field_pydoc_template.h b/python/bindings/docstrings/signal_field_pydoc_template.h new file mode 100644 index 0000000..3680993 --- /dev/null +++ b/python/bindings/docstrings/signal_field_pydoc_template.h @@ -0,0 +1,33 @@ +/* + * Copyright 2021 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,ieee802_11, __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 + */ + + + + static const char *__doc_gr_ieee802_11_signal_field = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_signal_field_signal_field = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_signal_field_make = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_signal_field_base = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_signal_field_formatter = R"doc()doc"; + + diff --git a/python/bindings/docstrings/sync_long_pydoc_template.h b/python/bindings/docstrings/sync_long_pydoc_template.h new file mode 100644 index 0000000..08b3a2c --- /dev/null +++ b/python/bindings/docstrings/sync_long_pydoc_template.h @@ -0,0 +1,27 @@ +/* + * Copyright 2021 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,ieee802_11, __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 + */ + + + + static const char *__doc_gr_ieee802_11_sync_long = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_sync_long_sync_long = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_sync_long_make = R"doc()doc"; + + diff --git a/python/bindings/docstrings/sync_short_pydoc_template.h b/python/bindings/docstrings/sync_short_pydoc_template.h new file mode 100644 index 0000000..26cab34 --- /dev/null +++ b/python/bindings/docstrings/sync_short_pydoc_template.h @@ -0,0 +1,27 @@ +/* + * Copyright 2021 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,ieee802_11, __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 + */ + + + + static const char *__doc_gr_ieee802_11_sync_short = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_sync_short_sync_short = R"doc()doc"; + + + static const char *__doc_gr_ieee802_11_sync_short_make = R"doc()doc"; + + diff --git a/python/bindings/ether_encap_python.cc b/python/bindings/ether_encap_python.cc new file mode 100644 index 0000000..45d10f9 --- /dev/null +++ b/python/bindings/ether_encap_python.cc @@ -0,0 +1,60 @@ +/* + * Copyright 2021 Free Software Foundation, Inc. + * + * 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(ether_encap.h) */ +/* BINDTOOL_HEADER_FILE_HASH(280e9072b32d4443bd89d2ad5560bdea) */ +/***********************************************************************************/ + +#include +#include +#include + +namespace py = pybind11; + +#include +// pydoc.h is automatically generated in the build directory +#include + +void bind_ether_encap(py::module& m) +{ + + using ether_encap = ::gr::ieee802_11::ether_encap; + + + py::class_>(m, "ether_encap", D(ether_encap)) + + .def(py::init(ðer_encap::make), + py::arg("debug"), + D(ether_encap,make) + ) + + + + + ; + + + + +} + + + + + + + + diff --git a/python/bindings/extract_csi_python.cc b/python/bindings/extract_csi_python.cc new file mode 100644 index 0000000..0e65e43 --- /dev/null +++ b/python/bindings/extract_csi_python.cc @@ -0,0 +1,59 @@ +/* + * Copyright 2021 Free Software Foundation, Inc. + * + * 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(extract_csi.h) */ +/* BINDTOOL_HEADER_FILE_HASH(e25959f49b55fd96cbc9354d42ad8c72) */ +/***********************************************************************************/ + +#include +#include +#include + +namespace py = pybind11; + +#include +// pydoc.h is automatically generated in the build directory +#include + +void bind_extract_csi(py::module& m) +{ + + using extract_csi = ::gr::ieee802_11::extract_csi; + + + py::class_>(m, "extract_csi", D(extract_csi)) + + .def(py::init(&extract_csi::make), + D(extract_csi,make) + ) + + + + + ; + + + + +} + + + + + + + + diff --git a/python/bindings/frame_equalizer_python.cc b/python/bindings/frame_equalizer_python.cc new file mode 100644 index 0000000..217716d --- /dev/null +++ b/python/bindings/frame_equalizer_python.cc @@ -0,0 +1,94 @@ +/* + * Copyright 2021 Free Software Foundation, Inc. + * + * 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(frame_equalizer.h) */ +/* BINDTOOL_HEADER_FILE_HASH(16ff5ed7a4d765b220d8e93bba89c627) */ +/***********************************************************************************/ + +#include +#include +#include + +namespace py = pybind11; + +#include +// pydoc.h is automatically generated in the build directory +#include + +void bind_frame_equalizer(py::module& m) +{ + + using frame_equalizer = ::gr::ieee802_11::frame_equalizer; + + + py::class_>(m, "frame_equalizer", D(frame_equalizer)) + + .def(py::init(&frame_equalizer::make), + py::arg("algo"), + py::arg("freq"), + py::arg("bw"), + py::arg("log"), + py::arg("debug"), + D(frame_equalizer,make) + ) + + + + + + + .def("set_algorithm",&frame_equalizer::set_algorithm, + py::arg("algo"), + D(frame_equalizer,set_algorithm) + ) + + + + .def("set_bandwidth",&frame_equalizer::set_bandwidth, + py::arg("bw"), + D(frame_equalizer,set_bandwidth) + ) + + + + .def("set_frequency",&frame_equalizer::set_frequency, + py::arg("freq"), + D(frame_equalizer,set_frequency) + ) + + ; + + py::enum_<::gr::ieee802_11::Equalizer>(m,"Equalizer") + .value("LS", ::gr::ieee802_11::LS) // 0 + .value("LMS", ::gr::ieee802_11::LMS) // 1 + .value("COMB", ::gr::ieee802_11::COMB) // 2 + .value("STA", ::gr::ieee802_11::STA) // 3 + .export_values() + ; + + py::implicitly_convertible(); + + + +} + + + + + + + + diff --git a/python/bindings/mac_python.cc b/python/bindings/mac_python.cc new file mode 100644 index 0000000..eeb4223 --- /dev/null +++ b/python/bindings/mac_python.cc @@ -0,0 +1,62 @@ +/* + * Copyright 2021 Free Software Foundation, Inc. + * + * 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(mac.h) */ +/* BINDTOOL_HEADER_FILE_HASH(1c47a20e97ec549a0e6ec5362f06ad6f) */ +/***********************************************************************************/ + +#include +#include +#include + +namespace py = pybind11; + +#include +// pydoc.h is automatically generated in the build directory +#include + +void bind_mac(py::module& m) +{ + + using mac = ::gr::ieee802_11::mac; + + + py::class_>(m, "mac", D(mac)) + + .def(py::init(&mac::make), + py::arg("src_mac"), + py::arg("dst_mac"), + py::arg("bss_mac"), + D(mac,make) + ) + + + + + ; + + + + +} + + + + + + + + diff --git a/python/bindings/mapper_python.cc b/python/bindings/mapper_python.cc new file mode 100644 index 0000000..3c7fdc8 --- /dev/null +++ b/python/bindings/mapper_python.cc @@ -0,0 +1,81 @@ +/* + * Copyright 2021 Free Software Foundation, Inc. + * + * 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(mapper.h) */ +/* BINDTOOL_HEADER_FILE_HASH(58c66a6e35e1e775b96dcb8f7b38b293) */ +/***********************************************************************************/ + +#include +#include +#include + +namespace py = pybind11; + +#include +// pydoc.h is automatically generated in the build directory +#include + +void bind_mapper(py::module& m) +{ + + using mapper = ::gr::ieee802_11::mapper; + + + py::class_>(m, "mapper", D(mapper)) + + .def(py::init(&mapper::make), + py::arg("mcs"), + py::arg("debug") = false, + D(mapper,make) + ) + + + + + + + .def("set_encoding",&mapper::set_encoding, + py::arg("mcs"), + D(mapper,set_encoding) + ) + + ; + + py::enum_<::gr::ieee802_11::Encoding>(m,"Encoding") + .value("BPSK_1_2", ::gr::ieee802_11::BPSK_1_2) // 0 + .value("BPSK_3_4", ::gr::ieee802_11::BPSK_3_4) // 1 + .value("QPSK_1_2", ::gr::ieee802_11::QPSK_1_2) // 2 + .value("QPSK_3_4", ::gr::ieee802_11::QPSK_3_4) // 3 + .value("QAM16_1_2", ::gr::ieee802_11::QAM16_1_2) // 4 + .value("QAM16_3_4", ::gr::ieee802_11::QAM16_3_4) // 5 + .value("QAM64_2_3", ::gr::ieee802_11::QAM64_2_3) // 6 + .value("QAM64_3_4", ::gr::ieee802_11::QAM64_3_4) // 7 + .export_values() + ; + + py::implicitly_convertible(); + + + +} + + + + + + + + diff --git a/python/bindings/parse_mac_python.cc b/python/bindings/parse_mac_python.cc new file mode 100644 index 0000000..79b8ff3 --- /dev/null +++ b/python/bindings/parse_mac_python.cc @@ -0,0 +1,61 @@ +/* + * Copyright 2021 Free Software Foundation, Inc. + * + * 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(parse_mac.h) */ +/* BINDTOOL_HEADER_FILE_HASH(ebc81ff01bea127fd4abde631ac5f0f3) */ +/***********************************************************************************/ + +#include +#include +#include + +namespace py = pybind11; + +#include +// pydoc.h is automatically generated in the build directory +#include + +void bind_parse_mac(py::module& m) +{ + + using parse_mac = ::gr::ieee802_11::parse_mac; + + + py::class_>(m, "parse_mac", D(parse_mac)) + + .def(py::init(&parse_mac::make), + py::arg("log") = false, + py::arg("debug") = false, + D(parse_mac,make) + ) + + + + + ; + + + + +} + + + + + + + + diff --git a/python/bindings/python_bindings.cc b/python/bindings/python_bindings.cc index 56795ea..5f0c79f 100644 --- a/python/bindings/python_bindings.cc +++ b/python/bindings/python_bindings.cc @@ -21,6 +21,18 @@ namespace py = pybind11; // Please do not delete /**************************************/ // BINDING_FUNCTION_PROTOTYPES( +void bind_chunks_to_symbols(py::module& m); +void bind_constellations(py::module& m); +void bind_decode_mac(py::module& m); +void bind_ether_encap(py::module& m); +void bind_extract_csi(py::module& m); +void bind_frame_equalizer(py::module& m); +void bind_mac(py::module& m); +void bind_mapper(py::module& m); +void bind_parse_mac(py::module& m); +void bind_signal_field(py::module& m); +void bind_sync_long(py::module& m); +void bind_sync_short(py::module& m); // ) END BINDING_FUNCTION_PROTOTYPES @@ -42,6 +54,7 @@ PYBIND11_MODULE(ieee802_11_python, m) // Allow access to base block methods py::module::import("gnuradio.gr"); + py::module::import("gnuradio.digital"); /**************************************/ // The following comment block is used for @@ -49,5 +62,17 @@ PYBIND11_MODULE(ieee802_11_python, m) // Please do not delete /**************************************/ // BINDING_FUNCTION_CALLS( + bind_chunks_to_symbols(m); + bind_constellations(m); + bind_decode_mac(m); + bind_ether_encap(m); + bind_extract_csi(m); + bind_frame_equalizer(m); + bind_mac(m); + bind_mapper(m); + bind_parse_mac(m); + bind_signal_field(m); + bind_sync_long(m); + bind_sync_short(m); // ) END BINDING_FUNCTION_CALLS } diff --git a/python/bindings/signal_field_python.cc b/python/bindings/signal_field_python.cc new file mode 100644 index 0000000..6daea5a --- /dev/null +++ b/python/bindings/signal_field_python.cc @@ -0,0 +1,71 @@ +/* + * Copyright 2021 Free Software Foundation, Inc. + * + * 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(signal_field.h) */ +/* BINDTOOL_HEADER_FILE_HASH(704b5399c8f91c472b1826c74dee0a5a) */ +/***********************************************************************************/ + +#include +#include +#include + +namespace py = pybind11; + +#include +// pydoc.h is automatically generated in the build directory +#include + +void bind_signal_field(py::module& m) +{ + + using signal_field = ::gr::ieee802_11::signal_field; + + + py::class_>(m, "signal_field", D(signal_field)) + + .def(py::init(&signal_field::make), + D(signal_field,make) + ) + + + + + + + .def("base",&signal_field::base, + D(signal_field,base) + ) + + + + .def("formatter",&signal_field::formatter, + D(signal_field,formatter) + ) + + ; + + + + +} + + + + + + + + diff --git a/python/bindings/sync_long_python.cc b/python/bindings/sync_long_python.cc new file mode 100644 index 0000000..7647fea --- /dev/null +++ b/python/bindings/sync_long_python.cc @@ -0,0 +1,62 @@ +/* + * Copyright 2021 Free Software Foundation, Inc. + * + * 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(sync_long.h) */ +/* BINDTOOL_HEADER_FILE_HASH(a0194fa153fe85f65ac2b217646c1d12) */ +/***********************************************************************************/ + +#include +#include +#include + +namespace py = pybind11; + +#include +// pydoc.h is automatically generated in the build directory +#include + +void bind_sync_long(py::module& m) +{ + + using sync_long = ::gr::ieee802_11::sync_long; + + + py::class_>(m, "sync_long", D(sync_long)) + + .def(py::init(&sync_long::make), + py::arg("sync_length"), + py::arg("log") = false, + py::arg("debug") = false, + D(sync_long,make) + ) + + + + + ; + + + + +} + + + + + + + + diff --git a/python/bindings/sync_short_python.cc b/python/bindings/sync_short_python.cc new file mode 100644 index 0000000..8fdba39 --- /dev/null +++ b/python/bindings/sync_short_python.cc @@ -0,0 +1,63 @@ +/* + * Copyright 2021 Free Software Foundation, Inc. + * + * 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(sync_short.h) */ +/* BINDTOOL_HEADER_FILE_HASH(ce2bf4884eae2d4c7695586469e38b17) */ +/***********************************************************************************/ + +#include +#include +#include + +namespace py = pybind11; + +#include +// pydoc.h is automatically generated in the build directory +#include + +void bind_sync_short(py::module& m) +{ + + using sync_short = ::gr::ieee802_11::sync_short; + + + py::class_>(m, "sync_short", D(sync_short)) + + .def(py::init(&sync_short::make), + py::arg("threshold"), + py::arg("min_plateau"), + py::arg("log") = false, + py::arg("debug") = false, + D(sync_short,make) + ) + + + + + ; + + + + +} + + + + + + + +