├── CMakeLists.txt ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── gr-foo ├── .gitignore ├── CMakeLists.txt ├── MANIFEST.md ├── README.md ├── catkin │ └── catkin_generated │ │ └── version │ │ └── package.cmake ├── cmake │ ├── Modules │ │ ├── CMakeParseArgumentsCopy.cmake │ │ ├── FindCppUnit.cmake │ │ ├── FindGnuradioRuntime.cmake │ │ ├── FindGruel.cmake │ │ ├── FindUHD.cmake │ │ ├── GrComponent.cmake │ │ ├── GrMiscUtils.cmake │ │ ├── GrPlatform.cmake │ │ ├── GrPython.cmake │ │ ├── GrSwig.cmake │ │ ├── GrTest.cmake │ │ └── UseSWIG.cmake │ └── cmake_uninstall.cmake.in ├── docs │ ├── CMakeLists.txt │ ├── README.ccs │ └── doxygen │ │ ├── CMakeLists.txt │ │ ├── Doxyfile.in │ │ ├── Doxyfile.swig_doc.in │ │ ├── doxyxml │ │ ├── __init__.py │ │ ├── base.py │ │ ├── doxyindex.py │ │ ├── generated │ │ │ ├── __init__.py │ │ │ ├── compound.py │ │ │ ├── compoundsuper.py │ │ │ ├── index.py │ │ │ └── indexsuper.py │ │ └── text.py │ │ ├── other │ │ ├── group_defs.dox │ │ └── main_page.dox │ │ └── swig_doc.py ├── grc │ ├── CMakeLists.txt │ ├── foo_burst_tagger.xml │ ├── foo_packet_dropper.xml │ ├── foo_packet_pad.xml │ ├── foo_packet_pad2.xml │ ├── foo_periodic_msg_source.xml │ ├── foo_random_periodic_msg_source.xml │ ├── foo_rtt_measure.xml │ └── foo_wireshark_connector.xml ├── include │ └── foo │ │ ├── CMakeLists.txt │ │ ├── api.h │ │ ├── burst_tagger.h │ │ ├── packet_dropper.h │ │ ├── packet_pad.h │ │ ├── packet_pad2.h │ │ ├── periodic_msg_source.h │ │ ├── random_periodic_msg_source.h │ │ ├── rtt_measure.h │ │ └── wireshark_connector.h ├── lib │ ├── CMakeLists.txt │ ├── burst_tagger_impl.cc │ ├── burst_tagger_impl.h │ ├── packet_dropper_impl.cc │ ├── packet_dropper_impl.h │ ├── packet_pad2.cc │ ├── packet_pad_impl.cc │ ├── packet_pad_impl.h │ ├── periodic_msg_source_impl.cc │ ├── periodic_msg_source_impl.h │ ├── random_periodic_msg_source_impl.cc │ ├── random_periodic_msg_source_impl.h │ ├── rtt_measure_impl.cc │ ├── rtt_measure_impl.h │ ├── wireshark_connector_impl.cc │ └── wireshark_connector_impl.h ├── python │ ├── CMakeLists.txt │ └── __init__.py ├── swig │ ├── CMakeLists.txt │ └── foo_swig.i └── utils │ └── gr-perf-to-csv ├── gr-ieee802-11 ├── .editorconfig ├── .gitignore ├── CMakeLists.txt ├── MANIFEST.md ├── README.md ├── apps │ ├── debug.sh │ ├── nic.sh │ └── rx_demo.sh ├── cmake │ ├── Modules │ │ ├── CMakeParseArgumentsCopy.cmake │ │ ├── FindCppUnit.cmake │ │ ├── FindGnuradioRuntime.cmake │ │ ├── FindLog4cpp.cmake │ │ ├── GrComponent.cmake │ │ ├── GrMiscUtils.cmake │ │ ├── GrPlatform.cmake │ │ ├── GrPython.cmake │ │ ├── GrSwig.cmake │ │ ├── GrTest.cmake │ │ ├── GrVersion.cmake │ │ └── UseSWIG.cmake │ └── cmake_uninstall.cmake.in ├── docs │ └── doxygen │ │ ├── CMakeLists.txt │ │ ├── Doxyfile.in │ │ ├── Doxyfile.swig_doc.in │ │ ├── doxyxml │ │ ├── .gitignore │ │ ├── Makefile.am │ │ ├── __init__.py │ │ ├── base.py │ │ ├── doxyindex.py │ │ ├── example │ │ │ ├── Doxyfile │ │ │ ├── aadvark.cc │ │ │ ├── aadvark.h │ │ │ └── xml │ │ │ │ ├── aadvark_8cc.xml │ │ │ │ ├── aadvark_8h.xml │ │ │ │ ├── classAadvark.xml │ │ │ │ ├── combine.xslt │ │ │ │ ├── compound.xsd │ │ │ │ ├── index.xml │ │ │ │ └── index.xsd │ │ ├── generated │ │ │ ├── __init__.py │ │ │ ├── compound.py │ │ │ ├── compoundsuper.py │ │ │ ├── index.py │ │ │ └── indexsuper.py │ │ ├── run_tests.in │ │ └── text.py │ │ ├── other │ │ ├── group_defs.dox │ │ └── main_page.dox │ │ └── swig_doc.py ├── examples │ ├── wifi_loopback.grc │ ├── wifi_phy_hier.grc │ ├── wifi_rx.grc │ ├── wifi_transceiver.grc │ ├── wifi_transceiver_dev2.grc │ ├── wifi_transceiver_standalone.grc │ ├── wifi_transceiver_standalone_dev1.grc │ ├── wifi_transceiver_standalone_dev2.grc │ ├── wifi_transceiver_standalone_simplex.grc │ └── wifi_tx.grc ├── grc │ ├── CMakeLists.txt │ ├── ieee802_11_chunks_to_symbols.xml │ ├── ieee802_11_decode_mac.xml │ ├── ieee802_11_ether_encap.xml │ ├── ieee802_11_frame_equalizer.xml │ ├── ieee802_11_mac.xml │ ├── ieee802_11_mapper.xml │ ├── ieee802_11_moving_average_xx.xml │ ├── ieee802_11_parse_mac.xml │ ├── ieee802_11_sync_long.xml │ └── ieee802_11_sync_short.xml ├── include │ └── ieee802-11 │ │ ├── CMakeLists.txt │ │ ├── api.h │ │ ├── chunks_to_symbols.h │ │ ├── constellations.h │ │ ├── decode_mac.h │ │ ├── ether_encap.h │ │ ├── frame_equalizer.h │ │ ├── mac.h │ │ ├── mapper.h │ │ ├── moving_average_XX.h.t │ │ ├── parse_mac.h │ │ ├── signal_field.h │ │ ├── sync_long.h │ │ └── sync_short.h ├── lib │ ├── CMakeLists.txt │ ├── chunks_to_symbols_impl.cc │ ├── chunks_to_symbols_impl.h │ ├── constellations_impl.cc │ ├── constellations_impl.h │ ├── decode_mac.cc │ ├── equalizer │ │ ├── base.cc │ │ ├── base.h │ │ ├── comb.cc │ │ ├── comb.h │ │ ├── lms.cc │ │ ├── lms.h │ │ ├── ls.cc │ │ ├── ls.h │ │ ├── sta.cc │ │ └── sta.h │ ├── ether_encap_impl.cc │ ├── ether_encap_impl.h │ ├── frame_equalizer_impl.cc │ ├── frame_equalizer_impl.h │ ├── mac.cc │ ├── mapper.cc │ ├── moving_average_XX_impl.cc.t │ ├── moving_average_XX_impl.h.t │ ├── parse_mac.cc │ ├── signal_field_impl.cc │ ├── signal_field_impl.h │ ├── sync_long.cc │ ├── sync_short.cc │ ├── utils.cc │ ├── utils.h │ └── viterbi_decoder │ │ ├── base.cc │ │ ├── base.h │ │ ├── viterbi_decoder.h │ │ ├── viterbi_decoder_generic.cc │ │ ├── viterbi_decoder_generic.h │ │ ├── viterbi_decoder_x86.cc │ │ └── viterbi_decoder_x86.h ├── python │ ├── CMakeLists.txt │ ├── __init__.py │ ├── build_utils.py │ ├── build_utils_codes.py │ └── utils.py ├── simulations │ ├── awgn │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── parse.sh │ │ ├── pdr.pdf │ │ ├── plot.py │ │ └── sim.grc │ ├── interference │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── parse.sh │ │ ├── pdr.pdf │ │ ├── plot.py │ │ ├── sim.grc │ │ └── sim.py │ └── sensitivity │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── parse.sh │ │ ├── pdr.pdf │ │ ├── plot.py │ │ └── sim.grc ├── swig │ ├── CMakeLists.txt │ └── ieee802_11_swig.i └── utils │ ├── 16-qam.png │ ├── 64-qam.png │ ├── channels.py │ ├── constellations.py │ ├── create_long.R │ ├── managed.sh │ ├── monitor.sh │ ├── packetspammer │ ├── Makefile │ └── packetspammer.c │ ├── pilots.py │ ├── power.R │ └── sync_words.py ├── gr-ros_interface ├── .gitignore ├── CMakeLists.txt ├── MANIFEST.md ├── apps │ └── CMakeLists.txt ├── cmake │ ├── Modules │ │ ├── CMakeParseArgumentsCopy.cmake │ │ ├── FindCppUnit.cmake │ │ ├── FindGnuradioRuntime.cmake │ │ ├── FindLZ4.cmake │ │ ├── GrMiscUtils.cmake │ │ ├── GrPlatform.cmake │ │ ├── GrPython.cmake │ │ ├── GrSwig.cmake │ │ ├── GrTest.cmake │ │ ├── UseSWIG.cmake │ │ └── ros_interfaceConfig.cmake │ └── cmake_uninstall.cmake.in ├── docs │ ├── CMakeLists.txt │ ├── README.ros_interface │ └── doxygen │ │ ├── CMakeLists.txt │ │ ├── Doxyfile.in │ │ ├── Doxyfile.swig_doc.in │ │ ├── doxyxml │ │ ├── __init__.py │ │ ├── base.py │ │ ├── doxyindex.py │ │ ├── generated │ │ │ ├── __init__.py │ │ │ ├── compound.py │ │ │ ├── compoundsuper.py │ │ │ ├── index.py │ │ │ └── indexsuper.py │ │ └── text.py │ │ ├── other │ │ ├── group_defs.dox │ │ └── main_page.dox │ │ └── swig_doc.py ├── examples │ └── README ├── grc │ ├── CMakeLists.txt │ ├── ros_interface_message_strobe_custom.xml │ ├── ros_interface_rate_debug.xml │ └── ros_interface_ros_interface.xml ├── include │ ├── ERAMsg.h │ └── ros_interface │ │ ├── CMakeLists.txt │ │ ├── api.h │ │ ├── message_strobe_custom.h │ │ ├── rate_debug.h │ │ └── ros_interface.h ├── lib │ ├── CMakeLists.txt │ ├── message_strobe_custom_impl.cc │ ├── message_strobe_custom_impl.h │ ├── rate_debug_impl.cc │ ├── rate_debug_impl.h │ ├── ros_interface_impl.cc │ └── ros_interface_impl.h ├── python │ ├── CMakeLists.txt │ └── __init__.py └── swig │ ├── CMakeLists.txt │ └── ros_interface_swig.i ├── package.xml └── utils ├── .gitignore ├── build_generic_volk_config.py └── remote_agent.cpp /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | All contributors must agree to the Developer Certificate of Origin Version 1.1. (DCO 1.1) by signing their commits with: 2 | 3 | ``` 4 | Signed-off-by: [NAME] <[EMAIL]> 5 | ``` 6 | 7 | This can be simply achieved with `git commit -s` when formatting your commit message. 8 | 9 | The full text of the DCO 1.1 is as follows: 10 | 11 | ``` 12 | Developer Certificate of Origin 13 | Version 1.1 14 | 15 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 16 | 660 York Street, Suite 102, 17 | San Francisco, CA 94110 USA 18 | 19 | Everyone is permitted to copy and distribute verbatim copies of this 20 | license document, but changing it is not allowed. 21 | 22 | 23 | Developer's Certificate of Origin 1.1 24 | 25 | By making a contribution to this project, I certify that: 26 | 27 | (a) The contribution was created in whole or in part by me and I 28 | have the right to submit it under the open source license 29 | indicated in the file; or 30 | 31 | (b) The contribution is based upon previous work that, to the best 32 | of my knowledge, is covered under an appropriate open source 33 | license and I have the right under that license to submit that 34 | work with modifications, whether created in whole or in part 35 | by me, under the same open source license (unless I am 36 | permitted to submit under a different license), as indicated 37 | in the file; or 38 | 39 | (c) The contribution was provided directly to me by some other 40 | person who certified (a), (b) or (c) and I have not modified 41 | it. 42 | 43 | (d) I understand and agree that this project and the contribution 44 | are public and that a record of the contribution (including all 45 | personal information I submit with it, including my sign-off) is 46 | maintained indefinitely and may be redistributed consistent with 47 | this project or the open source license(s) involved. 48 | ``` 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DSRC Package 2 | 3 | This package implements the DSRC module for V2V communication for ERA. It uses gr-ieee802-11, a GNURadio-based implementation of the 802.11p standard provided by Bastian Bloessl. 4 | 5 | **Please note that this is only one package within the EPOCHS Reference Application (ERA) project. You should refer to the main repository for a full installation of ERA.** 6 | -------------------------------------------------------------------------------- /gr-foo/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | tags 3 | -------------------------------------------------------------------------------- /gr-foo/MANIFEST.md: -------------------------------------------------------------------------------- 1 | brief: some utility blocks 2 | author: 3 | - Bastian Bloessl 4 | copyright_owner: 5 | - Bastian Bloessl 6 | dependencies: 7 | - gnuradio (>= 3.7.4) 8 | repo: https://github.com/bastibl/gr-foo.git 9 | tags: 10 | - foo 11 | website: https://github.com/bastibl/gr-foo 12 | title: gr-foo 13 | icon: http://www.ccs-labs.org/projects/wime/wime.png 14 | --- 15 | This is a collection of custom blocks that are not directly associated with a project. For sample applications see: 16 | 17 | https://github.com/bastibl/gr-ieee802-11 18 | https://github.com/bastibl/gr-ieee802-15-4 19 | -------------------------------------------------------------------------------- /gr-foo/catkin/catkin_generated/version/package.cmake: -------------------------------------------------------------------------------- 1 | set(_CATKIN_CURRENT_PACKAGE "catkin") 2 | set(catkin_VERSION "0.7.11") 3 | set(catkin_MAINTAINER "Dirk Thomas ") 4 | set(catkin_PACKAGE_FORMAT "2") 5 | set(catkin_BUILD_DEPENDS "python-empy" "python-argparse" "python-catkin-pkg") 6 | set(catkin_BUILD_DEPENDS_python-catkin-pkg_VERSION_GT "0.2.9") 7 | set(catkin_BUILD_EXPORT_DEPENDS "google-mock" "gtest" "python-empy" "python-nose" "python-argparse" "python-catkin-pkg") 8 | set(catkin_BUILD_EXPORT_DEPENDS_python-catkin-pkg_VERSION_GT "0.2.9") 9 | set(catkin_BUILDTOOL_DEPENDS "cmake") 10 | set(catkin_BUILDTOOL_EXPORT_DEPENDS "cmake") 11 | set(catkin_EXEC_DEPENDS "python-argparse" "python-catkin-pkg") 12 | set(catkin_EXEC_DEPENDS_python-catkin-pkg_VERSION_GT "0.2.9") 13 | set(catkin_RUN_DEPENDS "python-argparse" "python-catkin-pkg" "google-mock" "gtest" "python-empy" "python-nose") 14 | set(catkin_RUN_DEPENDS_python-catkin-pkg_VERSION_GT "0.2.9") 15 | set(catkin_TEST_DEPENDS "python-mock" "python-nose") 16 | set(catkin_DOC_DEPENDS ) 17 | set(catkin_URL_WEBSITE "http://www.ros.org/wiki/catkin") 18 | set(catkin_URL_BUGTRACKER "https://github.com/ros/catkin/issues") 19 | set(catkin_URL_REPOSITORY "https://github.com/ros/catkin") 20 | set(catkin_DEPRECATED "") -------------------------------------------------------------------------------- /gr-foo/cmake/Modules/FindCppUnit.cmake: -------------------------------------------------------------------------------- 1 | # http://www.cmake.org/pipermail/cmake/2006-October/011446.html 2 | # Modified to use pkg config and use standard var names 3 | 4 | # 5 | # Find the CppUnit includes and library 6 | # 7 | # This module defines 8 | # CPPUNIT_INCLUDE_DIR, where to find tiff.h, etc. 9 | # CPPUNIT_LIBRARIES, the libraries to link against to use CppUnit. 10 | # CPPUNIT_FOUND, If false, do not try to use CppUnit. 11 | 12 | INCLUDE(FindPkgConfig) 13 | PKG_CHECK_MODULES(PC_CPPUNIT "cppunit") 14 | 15 | FIND_PATH(CPPUNIT_INCLUDE_DIRS 16 | NAMES cppunit/TestCase.h 17 | HINTS ${PC_CPPUNIT_INCLUDE_DIR} 18 | ${CMAKE_INSTALL_PREFIX}/include 19 | PATHS 20 | /usr/local/include 21 | /usr/include 22 | ) 23 | 24 | FIND_LIBRARY(CPPUNIT_LIBRARIES 25 | NAMES cppunit 26 | HINTS ${PC_CPPUNIT_LIBDIR} 27 | ${CMAKE_INSTALL_PREFIX}/lib 28 | ${CMAKE_INSTALL_PREFIX}/lib64 29 | PATHS 30 | ${CPPUNIT_INCLUDE_DIRS}/../lib 31 | /usr/local/lib 32 | /usr/lib 33 | ) 34 | 35 | LIST(APPEND CPPUNIT_LIBRARIES ${CMAKE_DL_LIBS}) 36 | 37 | INCLUDE(FindPackageHandleStandardArgs) 38 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS) 39 | MARK_AS_ADVANCED(CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS) 40 | -------------------------------------------------------------------------------- /gr-foo/cmake/Modules/FindGnuradioRuntime.cmake: -------------------------------------------------------------------------------- 1 | INCLUDE(FindPkgConfig) 2 | PKG_CHECK_MODULES(PC_GNURADIO_RUNTIME gnuradio-runtime) 3 | 4 | if(PC_GNURADIO_RUNTIME_FOUND) 5 | # look for include files 6 | FIND_PATH( 7 | GNURADIO_RUNTIME_INCLUDE_DIRS 8 | NAMES gnuradio/top_block.h 9 | HINTS $ENV{GNURADIO_RUNTIME_DIR}/include 10 | ${PC_GNURADIO_RUNTIME_INCLUDE_DIRS} 11 | ${CMAKE_INSTALL_PREFIX}/include 12 | PATHS /usr/local/include 13 | /usr/include 14 | ) 15 | 16 | # look for libs 17 | FIND_LIBRARY( 18 | GNURADIO_RUNTIME_LIBRARIES 19 | NAMES gnuradio-runtime 20 | HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib 21 | ${PC_GNURADIO_RUNTIME_LIBDIR} 22 | ${CMAKE_INSTALL_PREFIX}/lib/ 23 | ${CMAKE_INSTALL_PREFIX}/lib64/ 24 | PATHS /usr/local/lib 25 | /usr/local/lib64 26 | /usr/lib 27 | /usr/lib64 28 | ) 29 | 30 | set(GNURADIO_RUNTIME_FOUND ${PC_GNURADIO_RUNTIME_FOUND}) 31 | endif(PC_GNURADIO_RUNTIME_FOUND) 32 | 33 | INCLUDE(FindPackageHandleStandardArgs) 34 | # do not check GNURADIO_RUNTIME_INCLUDE_DIRS, is not set when default include path us used. 35 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_RUNTIME DEFAULT_MSG GNURADIO_RUNTIME_LIBRARIES) 36 | MARK_AS_ADVANCED(GNURADIO_RUNTIME_LIBRARIES GNURADIO_RUNTIME_INCLUDE_DIRS) 37 | -------------------------------------------------------------------------------- /gr-foo/cmake/Modules/FindGruel.cmake: -------------------------------------------------------------------------------- 1 | INCLUDE(FindPkgConfig) 2 | PKG_CHECK_MODULES(PC_GRUEL gruel) 3 | 4 | FIND_PATH( 5 | GRUEL_INCLUDE_DIRS 6 | NAMES gruel/attributes.h 7 | HINTS $ENV{GRUEL_DIR}/include 8 | ${PC_GRUEL_INCLUDEDIR} 9 | PATHS /usr/local/include 10 | /usr/include 11 | ) 12 | 13 | FIND_LIBRARY( 14 | GRUEL_LIBRARIES 15 | NAMES gruel 16 | HINTS $ENV{GRUEL_DIR}/lib 17 | ${PC_GRUEL_LIBDIR} 18 | PATHS /usr/local/lib 19 | /usr/local/lib64 20 | /usr/lib 21 | /usr/lib64 22 | ) 23 | 24 | INCLUDE(FindPackageHandleStandardArgs) 25 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(GRUEL DEFAULT_MSG GRUEL_LIBRARIES GRUEL_INCLUDE_DIRS) 26 | MARK_AS_ADVANCED(GRUEL_LIBRARIES GRUEL_INCLUDE_DIRS) 27 | -------------------------------------------------------------------------------- /gr-foo/cmake/Modules/FindUHD.cmake: -------------------------------------------------------------------------------- 1 | ######################################################################## 2 | # Find the library for the USRP Hardware Driver 3 | ######################################################################## 4 | 5 | INCLUDE(FindPkgConfig) 6 | PKG_CHECK_MODULES(PC_UHD uhd) 7 | 8 | FIND_PATH( 9 | UHD_INCLUDE_DIRS 10 | NAMES uhd/config.hpp 11 | HINTS $ENV{UHD_DIR}/include 12 | ${PC_UHD_INCLUDEDIR} 13 | PATHS /usr/local/include 14 | /usr/include 15 | ) 16 | 17 | FIND_LIBRARY( 18 | UHD_LIBRARIES 19 | NAMES uhd 20 | HINTS $ENV{UHD_DIR}/lib 21 | ${PC_UHD_LIBDIR} 22 | PATHS /usr/local/lib 23 | /usr/lib 24 | ) 25 | 26 | INCLUDE(FindPackageHandleStandardArgs) 27 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS) 28 | MARK_AS_ADVANCED(UHD_LIBRARIES UHD_INCLUDE_DIRS) 29 | -------------------------------------------------------------------------------- /gr-foo/cmake/Modules/GrPlatform.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | if(DEFINED __INCLUDED_GR_PLATFORM_CMAKE) 21 | return() 22 | endif() 23 | set(__INCLUDED_GR_PLATFORM_CMAKE TRUE) 24 | 25 | ######################################################################## 26 | # Setup additional defines for OS types 27 | ######################################################################## 28 | if(CMAKE_SYSTEM_NAME STREQUAL "Linux") 29 | set(LINUX TRUE) 30 | endif() 31 | 32 | if(NOT CMAKE_CROSSCOMPILING AND LINUX AND EXISTS "/etc/debian_version") 33 | set(DEBIAN TRUE) 34 | endif() 35 | 36 | if(NOT CMAKE_CROSSCOMPILING AND LINUX AND EXISTS "/etc/redhat-release") 37 | set(REDHAT TRUE) 38 | endif() 39 | 40 | if(NOT CMAKE_CROSSCOMPILING AND LINUX AND EXISTS "/etc/slackware-version") 41 | set(SLACKWARE TRUE) 42 | endif() 43 | 44 | ######################################################################## 45 | # when the library suffix should be 64 (applies to redhat linux family) 46 | ######################################################################## 47 | if (REDHAT OR SLACKWARE) 48 | set(LIB64_CONVENTION TRUE) 49 | endif() 50 | 51 | if(NOT DEFINED LIB_SUFFIX AND LIB64_CONVENTION AND CMAKE_SYSTEM_PROCESSOR MATCHES "64$") 52 | set(LIB_SUFFIX 64) 53 | endif() 54 | set(LIB_SUFFIX ${LIB_SUFFIX} CACHE STRING "lib directory suffix") 55 | -------------------------------------------------------------------------------- /gr-foo/cmake/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | # http://www.vtk.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F 2 | 3 | IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 4 | MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 5 | ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 6 | 7 | FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 8 | STRING(REGEX REPLACE "\n" ";" files "${files}") 9 | FOREACH(file ${files}) 10 | MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 11 | IF(EXISTS "$ENV{DESTDIR}${file}") 12 | EXEC_PROGRAM( 13 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 14 | OUTPUT_VARIABLE rm_out 15 | RETURN_VALUE rm_retval 16 | ) 17 | IF(NOT "${rm_retval}" STREQUAL 0) 18 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 19 | ENDIF(NOT "${rm_retval}" STREQUAL 0) 20 | ELSEIF(IS_SYMLINK "$ENV{DESTDIR}${file}") 21 | EXEC_PROGRAM( 22 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 23 | OUTPUT_VARIABLE rm_out 24 | RETURN_VALUE rm_retval 25 | ) 26 | IF(NOT "${rm_retval}" STREQUAL 0) 27 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 28 | ENDIF(NOT "${rm_retval}" STREQUAL 0) 29 | ELSE(EXISTS "$ENV{DESTDIR}${file}") 30 | MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 31 | ENDIF(EXISTS "$ENV{DESTDIR}${file}") 32 | ENDFOREACH(file) 33 | -------------------------------------------------------------------------------- /gr-foo/docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | ######################################################################## 21 | # Setup dependencies 22 | ######################################################################## 23 | find_package(Doxygen) 24 | 25 | ######################################################################## 26 | # Begin conditional configuration 27 | ######################################################################## 28 | if(ENABLE_DOXYGEN) 29 | 30 | ######################################################################## 31 | # Add subdirectories 32 | ######################################################################## 33 | add_subdirectory(doxygen) 34 | 35 | endif(ENABLE_DOXYGEN) 36 | -------------------------------------------------------------------------------- /gr-foo/docs/README.ccs: -------------------------------------------------------------------------------- 1 | This is the ccs-write-a-block package meant as a guide to building 2 | out-of-tree packages. To use the ccs blocks, the Python namespaces 3 | is in 'ccs', which is imported as: 4 | 5 | import ccs 6 | 7 | See the Doxygen documentation for details about the blocks available 8 | in this package. A quick listing of the details can be found in Python 9 | after importing by using: 10 | 11 | help(ccs) 12 | -------------------------------------------------------------------------------- /gr-foo/docs/doxygen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | ######################################################################## 21 | # Create the doxygen configuration file 22 | ######################################################################## 23 | file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} top_srcdir) 24 | file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} top_builddir) 25 | file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} abs_top_srcdir) 26 | file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} abs_top_builddir) 27 | 28 | set(HAVE_DOT ${DOXYGEN_DOT_FOUND}) 29 | set(enable_html_docs YES) 30 | set(enable_latex_docs NO) 31 | set(enable_xml_docs YES) 32 | 33 | configure_file( 34 | ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in 35 | ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile 36 | @ONLY) 37 | 38 | set(BUILT_DIRS ${CMAKE_CURRENT_BINARY_DIR}/xml ${CMAKE_CURRENT_BINARY_DIR}/html) 39 | 40 | ######################################################################## 41 | # Make and install doxygen docs 42 | ######################################################################## 43 | add_custom_command( 44 | OUTPUT ${BUILT_DIRS} 45 | COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile 46 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 47 | COMMENT "Generating documentation with doxygen" 48 | ) 49 | 50 | add_custom_target(doxygen_target ALL DEPENDS ${BUILT_DIRS}) 51 | 52 | install(DIRECTORY ${BUILT_DIRS} DESTINATION ${GR_PKG_DOC_DIR}) 53 | -------------------------------------------------------------------------------- /gr-foo/docs/doxygen/doxyxml/generated/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Contains generated files produced by generateDS.py. 3 | 4 | These do the real work of parsing the doxygen xml files but the 5 | resultant classes are not very friendly to navigate so the rest of the 6 | doxyxml module processes them further. 7 | """ 8 | -------------------------------------------------------------------------------- /gr-foo/docs/doxygen/doxyxml/generated/index.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | Generated Mon Feb 9 19:08:05 2009 by generateDS.py. 5 | """ 6 | 7 | from xml.dom import minidom 8 | 9 | import os 10 | import sys 11 | import compound 12 | 13 | import indexsuper as supermod 14 | 15 | class DoxygenTypeSub(supermod.DoxygenType): 16 | def __init__(self, version=None, compound=None): 17 | supermod.DoxygenType.__init__(self, version, compound) 18 | 19 | def find_compounds_and_members(self, details): 20 | """ 21 | Returns a list of all compounds and their members which match details 22 | """ 23 | 24 | results = [] 25 | for compound in self.compound: 26 | members = compound.find_members(details) 27 | if members: 28 | results.append([compound, members]) 29 | else: 30 | if details.match(compound): 31 | results.append([compound, []]) 32 | 33 | return results 34 | 35 | supermod.DoxygenType.subclass = DoxygenTypeSub 36 | # end class DoxygenTypeSub 37 | 38 | 39 | class CompoundTypeSub(supermod.CompoundType): 40 | def __init__(self, kind=None, refid=None, name='', member=None): 41 | supermod.CompoundType.__init__(self, kind, refid, name, member) 42 | 43 | def find_members(self, details): 44 | """ 45 | Returns a list of all members which match details 46 | """ 47 | 48 | results = [] 49 | 50 | for member in self.member: 51 | if details.match(member): 52 | results.append(member) 53 | 54 | return results 55 | 56 | supermod.CompoundType.subclass = CompoundTypeSub 57 | # end class CompoundTypeSub 58 | 59 | 60 | class MemberTypeSub(supermod.MemberType): 61 | 62 | def __init__(self, kind=None, refid=None, name=''): 63 | supermod.MemberType.__init__(self, kind, refid, name) 64 | 65 | supermod.MemberType.subclass = MemberTypeSub 66 | # end class MemberTypeSub 67 | 68 | 69 | def parse(inFilename): 70 | 71 | doc = minidom.parse(inFilename) 72 | rootNode = doc.documentElement 73 | rootObj = supermod.DoxygenType.factory() 74 | rootObj.build(rootNode) 75 | 76 | return rootObj 77 | 78 | -------------------------------------------------------------------------------- /gr-foo/docs/doxygen/doxyxml/text.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2010 Free Software Foundation, Inc. 3 | # 4 | # This file is part of GNU Radio 5 | # 6 | # GNU Radio is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3, or (at your option) 9 | # any later version. 10 | # 11 | # GNU Radio is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with GNU Radio; see the file COPYING. If not, write to 18 | # the Free Software Foundation, Inc., 51 Franklin Street, 19 | # Boston, MA 02110-1301, USA. 20 | # 21 | """ 22 | Utilities for extracting text from generated classes. 23 | """ 24 | 25 | def is_string(txt): 26 | if isinstance(txt, str): 27 | return True 28 | try: 29 | if isinstance(txt, unicode): 30 | return True 31 | except NameError: 32 | pass 33 | return False 34 | 35 | def description(obj): 36 | if obj is None: 37 | return None 38 | return description_bit(obj).strip() 39 | 40 | def description_bit(obj): 41 | if hasattr(obj, 'content'): 42 | contents = [description_bit(item) for item in obj.content] 43 | result = ''.join(contents) 44 | elif hasattr(obj, 'content_'): 45 | contents = [description_bit(item) for item in obj.content_] 46 | result = ''.join(contents) 47 | elif hasattr(obj, 'value'): 48 | result = description_bit(obj.value) 49 | elif is_string(obj): 50 | return obj 51 | else: 52 | raise StandardError('Expecting a string or something with content, content_ or value attribute') 53 | # If this bit is a paragraph then add one some line breaks. 54 | if hasattr(obj, 'name') and obj.name == 'para': 55 | result += "\n\n" 56 | return result 57 | -------------------------------------------------------------------------------- /gr-foo/docs/doxygen/other/group_defs.dox: -------------------------------------------------------------------------------- 1 | /*! 2 | * \defgroup block GNU Radio CCS C++ Signal Processing Blocks 3 | * \brief All C++ blocks that can be used from the CCS GNU Radio 4 | * module are listed here or in the subcategories below. 5 | * 6 | */ 7 | 8 | -------------------------------------------------------------------------------- /gr-foo/docs/doxygen/other/main_page.dox: -------------------------------------------------------------------------------- 1 | /*! \mainpage 2 | 3 | Welcome to the GNU Radio CCS Block 4 | 5 | This is the intro page for the Doxygen manual generated for the CCS 6 | block (docs/doxygen/other/main_page.dox). Edit it to add more detailed 7 | documentation about the new GNU Radio modules contained in this 8 | project. 9 | 10 | */ 11 | -------------------------------------------------------------------------------- /gr-foo/grc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | file(GLOB xml_files "*.xml") 21 | 22 | install(FILES ${xml_files} DESTINATION share/gnuradio/grc/blocks ) 23 | -------------------------------------------------------------------------------- /gr-foo/grc/foo_burst_tagger.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Burst Tagger 4 | foo_burst_tagger 5 | [Foo] 6 | import pmt 7 | import foo 8 | foo.burst_tagger($tag_name, $mult) 9 | 10 | 11 | Tag Name 12 | tag_name 13 | pmt.intern("burst_len") 14 | raw 15 | 16 | 17 | 18 | Multiplier 19 | mult 20 | 1 21 | int 22 | 23 | 24 | $mult > 0 25 | 26 | 27 | in 28 | complex 29 | 30 | 31 | 32 | out 33 | complex 34 | 35 | 36 | -------------------------------------------------------------------------------- /gr-foo/grc/foo_packet_dropper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Packet Dropper 4 | foo_packet_dropper 5 | [Foo] 6 | import foo 7 | foo.packet_dropper($drop_rate, $seed) 8 | 9 | 10 | Packet drop rate 11 | drop_rate 12 | 0.5 13 | real 14 | 15 | 16 | 17 | Random seed 18 | seed 19 | 42 20 | int 21 | 22 | 23 | 24 | in 25 | message 26 | 27 | 28 | 29 | out 30 | message 31 | 32 | 33 | -------------------------------------------------------------------------------- /gr-foo/grc/foo_packet_pad.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Packet Pad 5 | foo_packet_pad 6 | [Foo] 7 | import foo 8 | foo.packet_pad($debug, $delay, $delay_sec, $pad_front, $pad_tail) 9 | 10 | 11 | Debug 12 | debug 13 | False 14 | bool 15 | 16 | 20 | 24 | 25 | 26 | 27 | Delay 28 | delay 29 | False 30 | bool 31 | 32 | 36 | 40 | 41 | 42 | 43 | Delay Sec 44 | delay_sec 45 | 0.001 46 | real 47 | 48 | 49 | 50 | Pad Front 51 | pad_front 52 | 0 53 | int 54 | 55 | 56 | 57 | Pad Tail 58 | pad_tail 59 | 0 60 | int 61 | 62 | 63 | $pad_front >= 0 64 | $pad_tail >= 0 65 | $delay_sec > 0 66 | 67 | 68 | in 69 | complex 70 | 1 71 | 72 | 73 | 74 | out 75 | complex 76 | 1 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /gr-foo/grc/foo_packet_pad2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Packet Pad2 5 | foo_packet_pad2 6 | [Foo] 7 | import foo 8 | foo.packet_pad2($debug, $delay, $delay_sec, $pad_front, $pad_tail) 9 | 10 | 11 | Debug 12 | debug 13 | False 14 | bool 15 | 16 | 20 | 24 | 25 | 26 | 27 | Delay 28 | delay 29 | False 30 | bool 31 | 32 | 36 | 40 | 41 | 42 | 43 | Delay Sec 44 | delay_sec 45 | 0.001 46 | real 47 | 48 | 49 | 50 | Pad Front 51 | pad_front 52 | 0 53 | int 54 | 55 | 56 | 57 | Pad Tail 58 | pad_tail 59 | 0 60 | int 61 | 62 | 63 | $pad_front >= 0 64 | $pad_tail >= 0 65 | $delay_sec > 0 66 | 67 | 68 | in 69 | complex 70 | 1 71 | 72 | 73 | 74 | out 75 | complex 76 | 1 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /gr-foo/grc/foo_periodic_msg_source.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Periodic Message Source 5 | foo_periodic_msg_source 6 | [Foo] 7 | import foo 8 | import pmt 9 | foo.periodic_msg_source($msg, $interval, $num, $quit, $debug) 10 | 11 | Message PMT 12 | msg 13 | pmt.intern("Hello World!") 14 | raw 15 | 16 | 17 | Period (ms) 18 | interval 19 | 1000 20 | int 21 | 22 | 23 | Quit 24 | quit 25 | True 26 | bool 27 | 31 | 35 | 36 | 37 | Debug 38 | debug 39 | False 40 | bool 41 | 45 | 49 | 50 | 51 | Num Messages 52 | num 53 | -1 54 | int 55 | 56 | 57 | out 58 | message 59 | 1 60 | 61 | 62 | -------------------------------------------------------------------------------- /gr-foo/grc/foo_random_periodic_msg_source.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Random Periodic Message Source 5 | foo_random_periodic_msg_source 6 | [Foo] 7 | import foo 8 | import pmt 9 | foo.random_periodic_msg_source($msg_len, $interval, $num, $quit, $debug, $seed) 10 | 11 | Message Length 12 | msg_len 13 | 64 14 | int 15 | 16 | 17 | Period (ms) 18 | interval 19 | 1000 20 | int 21 | 22 | 23 | Quit 24 | quit 25 | True 26 | bool 27 | 31 | 35 | 36 | 37 | Debug 38 | debug 39 | False 40 | bool 41 | 45 | 49 | 50 | 51 | Num Messages 52 | num 53 | 1 54 | int 55 | 56 | 57 | Random Seed 58 | seed 59 | 1 60 | int 61 | 62 | 63 | out 64 | message 65 | 1 66 | 67 | 68 | -------------------------------------------------------------------------------- /gr-foo/grc/foo_rtt_measure.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | RTT measure 4 | foo_rtt_measure 5 | [Foo] 6 | import foo 7 | foo.rtt_measure($interval) 8 | 9 | 10 | Send interval 11 | interval 12 | 500 13 | int 14 | 15 | 16 | 17 | in 18 | message 19 | 20 | 21 | 22 | dout 23 | byte 24 | 25 | 26 | 27 | out 28 | message 29 | 30 | 31 | -------------------------------------------------------------------------------- /gr-foo/grc/foo_wireshark_connector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Wireshark Connector 4 | foo_wireshark_connector 5 | [Foo] 6 | import foo 7 | foo.wireshark_connector($tech, $debug) 8 | 9 | 10 | Technology 11 | tech 12 | 127 13 | enum 14 | 18 | 22 | 23 | 24 | 25 | Debug 26 | debug 27 | False 28 | bool 29 | 30 | 34 | 38 | 39 | 40 | 41 | in 42 | message 43 | 44 | 45 | out 46 | byte 47 | 1 48 | 49 | 50 | -------------------------------------------------------------------------------- /gr-foo/include/foo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011,2012 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | ######################################################################## 21 | # Install public header files 22 | ######################################################################## 23 | install(FILES 24 | api.h 25 | burst_tagger.h 26 | packet_dropper.h 27 | packet_pad.h 28 | packet_pad2.h 29 | periodic_msg_source.h 30 | random_periodic_msg_source.h 31 | rtt_measure.h 32 | wireshark_connector.h 33 | DESTINATION include/foo 34 | ) 35 | -------------------------------------------------------------------------------- /gr-foo/include/foo/api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * GNU Radio is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * GNU Radio is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with GNU Radio; see the file COPYING. If not, write to 18 | * the Free Software Foundation, Inc., 51 Franklin Street, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef INCLUDED_FOO_API_H 23 | #define INCLUDED_FOO_API_H 24 | 25 | #include 26 | 27 | #ifdef gnuradio_foo_EXPORTS 28 | # define FOO_API __GR_ATTR_EXPORT 29 | #else 30 | # define FOO_API __GR_ATTR_IMPORT 31 | #endif 32 | 33 | #endif /* INCLUDED_FOO_API_H */ 34 | -------------------------------------------------------------------------------- /gr-foo/include/foo/burst_tagger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Bastian Bloessl. 3 | * 4 | * This is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3, or (at your option) 7 | * any later version. 8 | * 9 | * This software is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this software; see the file COPYING. If not, write to 16 | * the Free Software Foundation, Inc., 51 Franklin Street, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | 21 | #ifndef INCLUDED_FOO_BURST_TAGGER_H 22 | #define INCLUDED_FOO_BURST_TAGGER_H 23 | 24 | #include 25 | #include 26 | 27 | namespace gr { 28 | namespace foo { 29 | 30 | class FOO_API burst_tagger : virtual public gr::sync_block { 31 | public: 32 | typedef boost::shared_ptr sptr; 33 | 34 | static sptr make(pmt::pmt_t tag_name, unsigned int mult); 35 | }; 36 | 37 | } // namespace foo 38 | } // namespace gr 39 | 40 | #endif /* INCLUDED_FOO_BURST_TAGGER_H */ 41 | 42 | -------------------------------------------------------------------------------- /gr-foo/include/foo/packet_dropper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Christoph Leitner 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_FOO_PACKET_DROPPER_H 18 | #define INCLUDED_FOO_PACKET_DROPPER_H 19 | 20 | #include 21 | #include 22 | 23 | namespace gr { 24 | namespace foo { 25 | 26 | class FOO_API packet_dropper : virtual public gr::block 27 | { 28 | public: 29 | typedef boost::shared_ptr sptr; 30 | static sptr make(double drop_rate, unsigned long seed); 31 | }; 32 | } // namespace foo 33 | } // namespace gr 34 | 35 | #endif /* INCLUDED_FOO_PACKET_DROPPER_H */ 36 | -------------------------------------------------------------------------------- /gr-foo/include/foo/packet_pad.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_FOO_PACKET_PAD_H 18 | #define INCLUDED_FOO_PACKET_PAD_H 19 | 20 | #include 21 | #include 22 | 23 | namespace gr { 24 | namespace foo { 25 | 26 | class FOO_API packet_pad : virtual public gr::block 27 | { 28 | public: 29 | 30 | typedef boost::shared_ptr sptr; 31 | static sptr make(bool debug = false, bool delay=false, double delay_sec=0.01, unsigned int pad_front = 0, unsigned int pad_tail = 0); 32 | 33 | }; 34 | 35 | } // namespace foo 36 | } // namespace gr 37 | 38 | #endif /* INCLUDED_FOO_PACKET_PAD_H */ 39 | -------------------------------------------------------------------------------- /gr-foo/include/foo/packet_pad2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_FOO_PACKET_PAD2_H 18 | #define INCLUDED_FOO_PACKET_PAD2_H 19 | 20 | #include 21 | #include 22 | 23 | namespace gr { 24 | namespace foo { 25 | 26 | class FOO_API packet_pad2 : virtual public gr::tagged_stream_block 27 | { 28 | public: 29 | 30 | typedef boost::shared_ptr sptr; 31 | static sptr make(bool debug = false, bool delay=false, double delay_sec=0.01, unsigned int pad_front = 0, unsigned int pad_tail = 0); 32 | 33 | }; 34 | 35 | } // namespace foo 36 | } // namespace gr 37 | 38 | #endif /* INCLUDED_FOO_PACKET_PAD2_H */ 39 | -------------------------------------------------------------------------------- /gr-foo/include/foo/periodic_msg_source.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_FOO_PERIODIC_MSG_SOURCE_H 18 | #define INCLUDED_FOO_PERIODIC_MSG_SOURCE_H 19 | 20 | #include 21 | #include 22 | 23 | namespace gr { 24 | namespace foo { 25 | 26 | class FOO_API periodic_msg_source : virtual public gr::block 27 | { 28 | public: 29 | 30 | typedef boost::shared_ptr sptr; 31 | static sptr make(pmt::pmt_t msg, long interval, int num_msg = -1, 32 | bool quit = true, bool debug = false); 33 | 34 | virtual void set_nmsg(int nmsg) = 0; 35 | virtual int get_nmsg() = 0; 36 | 37 | virtual void set_delay(long delay) = 0; 38 | virtual long get_delay() = 0; 39 | 40 | virtual void start_tx() = 0; 41 | virtual void stop_tx() = 0; 42 | virtual bool is_running() = 0; 43 | }; 44 | 45 | } // namespace foo 46 | } // namespace gr 47 | 48 | #endif /* INCLUDED_FOO_PERIODIC_MSG_SOURCE */ 49 | -------------------------------------------------------------------------------- /gr-foo/include/foo/random_periodic_msg_source.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Bastian Bloessl 3 | * 2016 Paul Garver 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | #ifndef INCLUDED_FOO_RANDOM_PERIODIC_MSG_SOURCE_H 19 | #define INCLUDED_FOO_RANDOM_PERIODIC_MSG_SOURCE_H 20 | 21 | #include 22 | #include 23 | 24 | namespace gr { 25 | namespace foo { 26 | 27 | class FOO_API random_periodic_msg_source : virtual public gr::block 28 | { 29 | public: 30 | 31 | typedef boost::shared_ptr sptr; 32 | static sptr make(int msg_len, long interval, int num_msg = 1, 33 | bool quit = true, bool debug = false, int seed = 0); 34 | 35 | virtual void set_nmsg(int nmsg) = 0; 36 | virtual int get_nmsg() = 0; 37 | 38 | virtual void set_delay(long delay) = 0; 39 | virtual long get_delay() = 0; 40 | 41 | virtual void start_tx() = 0; 42 | virtual void stop_tx() = 0; 43 | virtual bool is_running() = 0; 44 | }; 45 | 46 | } // namespace foo 47 | } // namespace gr 48 | 49 | #endif /* INCLUDED_FOO_RANDOM_PERIODIC_MSG_SOURCE */ 50 | -------------------------------------------------------------------------------- /gr-foo/include/foo/rtt_measure.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Christoph Leitner 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef INCLUDED_FOO_RTT_MEASURE_H 19 | #define INCLUDED_FOO_RTT_MEASURE_H 20 | 21 | #include 22 | #include 23 | 24 | namespace gr { 25 | namespace foo { 26 | 27 | class FOO_API rtt_measure : virtual public gr::block 28 | { 29 | public: 30 | typedef boost::shared_ptr sptr; 31 | static sptr make(unsigned long interval); 32 | }; 33 | } // namespace foo 34 | } // namespace gr 35 | 36 | 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /gr-foo/include/foo/wireshark_connector.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_FOO_WIRESHARK_CONNECTOR_H 18 | #define INCLUDED_FOO_WIRESHARK_CONNECTOR_H 19 | 20 | #include 21 | #include 22 | 23 | namespace gr { 24 | namespace foo { 25 | 26 | enum LinkType { 27 | WIFI = 127, 28 | ZIGBEE = 195 29 | }; 30 | 31 | class FOO_API wireshark_connector : virtual public gr::block 32 | { 33 | public: 34 | 35 | typedef boost::shared_ptr sptr; 36 | static sptr make(LinkType type, bool debug= false); 37 | }; 38 | 39 | } // namespace foo 40 | } // namespace gr 41 | 42 | #endif /* INCLUDED_FOO_WIRESHARK_CONNECTOR_H */ 43 | -------------------------------------------------------------------------------- /gr-foo/lib/burst_tagger_impl.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2013 Bastian Bloessl . 4 | * 5 | * This is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 3, or (at your option) 8 | * any later version. 9 | * 10 | * This software is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this software; see the file COPYING. If not, write to 17 | * the Free Software Foundation, Inc., 51 Franklin Street, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef INCLUDED_FOO_BURST_TAGGER_IMPL_H 22 | #define INCLUDED_FOO_BURST_TAGGER_IMPL_H 23 | 24 | #include 25 | 26 | namespace gr { 27 | namespace foo { 28 | 29 | class burst_tagger_impl : public burst_tagger { 30 | private: 31 | void add_eob(uint64_t item); 32 | void add_sob(uint64_t item); 33 | 34 | pmt::pmt_t d_tag_name; 35 | int d_copy; 36 | unsigned int d_mult; 37 | 38 | public: 39 | burst_tagger_impl(pmt::pmt_t tag_name, 40 | unsigned int mult); 41 | ~burst_tagger_impl(); 42 | 43 | int work(int noutput_items, 44 | gr_vector_const_void_star &input_items, 45 | gr_vector_void_star &output_items); 46 | }; 47 | 48 | } // namespace foo 49 | } // namespace gr 50 | 51 | #endif /* INCLUDED_FOO_BURST_TAGGER_IMPL_H */ 52 | 53 | -------------------------------------------------------------------------------- /gr-foo/lib/packet_dropper_impl.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Christoph Leitner 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #include "packet_dropper_impl.h" 19 | #include 20 | 21 | using namespace gr::foo; 22 | 23 | packet_dropper_impl::packet_dropper_impl(double drop_rate, unsigned long seed) 24 | : block("packet_dropper", 25 | gr::io_signature::make(0, 0, 0), 26 | gr::io_signature::make(0, 0, 0)), 27 | d_drop_rate(drop_rate), 28 | d_generator(seed), 29 | d_distribution(0.0, 1.0) 30 | { 31 | if(d_drop_rate >= 1){ 32 | throw std::out_of_range("drop rate has to be < 1"); 33 | } 34 | message_port_register_in(pmt::mp("in")); 35 | set_msg_handler(pmt::mp("in"), boost::bind(&packet_dropper_impl::msg_handler, this, _1)); 36 | message_port_register_out(pmt::mp("out")); 37 | } 38 | 39 | void 40 | packet_dropper_impl::msg_handler(pmt::pmt_t msg) 41 | { 42 | if(d_distribution(d_generator) <= d_drop_rate){ 43 | return; 44 | } 45 | message_port_pub(pmt::mp("out"), msg); 46 | } 47 | 48 | packet_dropper::sptr 49 | packet_dropper::make(double drop_rate, unsigned long seed) 50 | { 51 | return gnuradio::get_initial_sptr(new packet_dropper_impl(drop_rate, seed)); 52 | } 53 | 54 | -------------------------------------------------------------------------------- /gr-foo/lib/packet_dropper_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Christoph Leitner 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef INCLUDED_FOO_PACKET_DROPPER_IMPL_H 19 | #define INCLUDED_FOO_PACKET_DROPPER_IMPL_H 20 | 21 | #include 22 | #include 23 | 24 | namespace gr { 25 | namespace foo { 26 | class packet_dropper_impl : public packet_dropper { 27 | private: 28 | double d_drop_rate; 29 | std::default_random_engine d_generator; 30 | std::uniform_real_distribution d_distribution; 31 | void msg_handler(pmt::pmt_t msg); 32 | public: 33 | packet_dropper_impl(double drop_rate, unsigned long seed); 34 | }; 35 | } 36 | } 37 | 38 | #endif /* INCLUDED_FOO_PACKET_DROPPER_IMPL_H */ 39 | -------------------------------------------------------------------------------- /gr-foo/lib/packet_pad_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013 Bastian Bloessl . 3 | * 4 | * This is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3, or (at your option) 7 | * any later version. 8 | * 9 | * This software is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this software; see the file COPYING. If not, write to 16 | * the Free Software Foundation, Inc., 51 Franklin Street, 17 | * Boston, MA 02110-1301, USA. 18 | */ 19 | 20 | #ifndef INCLUDED_FOO_PACKET_PAD_IMPL_H 21 | #define INCLUDED_FOO_PACKET_PAD_IMPL_H 22 | 23 | #include 24 | 25 | namespace gr { 26 | namespace foo { 27 | 28 | class packet_pad_impl : public packet_pad { 29 | private: 30 | void add_eob(uint64_t item); 31 | void add_sob(uint64_t item); 32 | 33 | bool d_debug; 34 | bool d_delay; 35 | double d_delay_sec; 36 | 37 | int d_pad_front; 38 | int d_pad_tail; 39 | 40 | int d_pad; 41 | bool d_eob; 42 | 43 | public: 44 | packet_pad_impl(bool debug, bool delay, double delay_sec, 45 | unsigned int pad_front, unsigned int pad_tail); 46 | 47 | ~packet_pad_impl(); 48 | 49 | int general_work (int noutput_items, 50 | gr_vector_int& ninput_items, 51 | gr_vector_const_void_star& input_items, 52 | gr_vector_void_star& output_items); 53 | void forecast (int noutput_items, 54 | gr_vector_int &ninput_items_required); 55 | }; 56 | 57 | } // namespace foo 58 | } // namespace gr 59 | 60 | #endif /* INCLUDED_FOO_BURST_TAGGER_IMPL_H */ 61 | 62 | -------------------------------------------------------------------------------- /gr-foo/lib/periodic_msg_source_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_FOO_PERIODIC_MSG_SOURCE_IMPL_H 18 | #define INCLUDED_FOO_PERIODIC_MSG_SOURCE_IMPL_H 19 | 20 | #include 21 | 22 | namespace gr { 23 | namespace foo { 24 | 25 | class periodic_msg_source_impl : public periodic_msg_source { 26 | private: 27 | void run(periodic_msg_source_impl *instance); 28 | 29 | int d_nmsg_total; 30 | int d_nmsg_left; 31 | bool d_debug; 32 | bool d_quit; 33 | bool d_finished; 34 | long d_interval; 35 | pmt::pmt_t d_msg; 36 | boost::thread *d_thread; 37 | gr::thread::mutex d_mutex; 38 | 39 | public: 40 | periodic_msg_source_impl(pmt::pmt_t msg, 41 | long interval, int num_msg, 42 | bool quit, bool debug); 43 | virtual ~periodic_msg_source_impl(); 44 | 45 | void set_nmsg(int nmsg); 46 | int get_nmsg(); 47 | 48 | void set_delay(long delay); 49 | long get_delay(); 50 | 51 | void start_tx(); 52 | void stop_tx(); 53 | bool is_running(); 54 | 55 | }; 56 | 57 | } // namespace foo 58 | } // namespace gr 59 | 60 | #endif /* INCLUDED_FOO_PERIODIC_MSG_SOURCE_IMPL_H */ 61 | -------------------------------------------------------------------------------- /gr-foo/lib/random_periodic_msg_source_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Bastian Bloessl 3 | * Copyright (C) 2016 Paul Garver 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | #ifndef INCLUDED_FOO_RANDOM_PERIODIC_MSG_SOURCE_IMPL_H 19 | #define INCLUDED_FOO_RANDOM_PERIODIC_MSG_SOURCE_IMPL_H 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace gr { 26 | namespace foo { 27 | 28 | class random_periodic_msg_source_impl : public random_periodic_msg_source { 29 | private: 30 | void run(random_periodic_msg_source_impl *instance); 31 | int d_msg_len; 32 | int d_nmsg_total; 33 | int d_nmsg_left; 34 | unsigned int d_seed; 35 | bool d_debug; 36 | bool d_quit; 37 | bool d_finished; 38 | long d_interval; 39 | boost::thread *d_thread; 40 | gr::thread::mutex d_mutex; 41 | boost::mt19937 d_rng; 42 | boost::uniform_int<> d_brange; 43 | boost::variate_generator< boost::mt19937, boost::uniform_int<> > d_randbytes; 44 | 45 | public: 46 | random_periodic_msg_source_impl(int msg_len, 47 | long interval, int num_msg, 48 | bool quit, bool debug, int seed); 49 | virtual ~random_periodic_msg_source_impl(); 50 | 51 | void set_nmsg(int nmsg); 52 | int get_nmsg(); 53 | 54 | void set_delay(long delay); 55 | long get_delay(); 56 | 57 | void start_tx(); 58 | void stop_tx(); 59 | pmt::pmt_t generate_msg(); 60 | bool is_running(); 61 | 62 | }; 63 | 64 | } // namespace foo 65 | } // namespace gr 66 | 67 | #endif /* INCLUDED_FOO_RANDOM_PERIODIC_MSG_SOURCE_IMPL_H */ 68 | -------------------------------------------------------------------------------- /gr-foo/lib/rtt_measure_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Christoph Leitner 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef INCLUDED_FOO_RTT_MEASURE_IMPL_H 19 | #define INCLUDED_FOO_RTT_MEASURE_IMPL_H 20 | 21 | #include 22 | #include 23 | namespace gr { 24 | namespace foo { 25 | class rtt_measure_impl : public rtt_measure { 26 | private: 27 | unsigned long d_interval; 28 | std::atomic_bool d_stop; 29 | boost::posix_time::ptime d_start_time; 30 | gr::thread::mutex d_mutex; 31 | gr::thread::thread d_thread; 32 | gr::thread::condition_variable d_msg_received; 33 | public: 34 | rtt_measure_impl(unsigned long interval); 35 | ~rtt_measure_impl(); 36 | void run(); 37 | int general_work(int noutput, gr_vector_int& ninput_items, 38 | gr_vector_const_void_star& input_items, 39 | gr_vector_void_star& output_items ); 40 | boost::posix_time::ptime start_time(); 41 | }; 42 | } 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /gr-foo/python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | ######################################################################## 21 | # Include python install macros 22 | ######################################################################## 23 | include(GrPython) 24 | if(NOT PYTHONINTERP_FOUND) 25 | return() 26 | endif() 27 | 28 | ######################################################################## 29 | # Install python sources 30 | ######################################################################## 31 | GR_PYTHON_INSTALL( 32 | FILES 33 | __init__.py 34 | DESTINATION ${GR_PYTHON_DIR}/foo 35 | ) 36 | 37 | ######################################################################## 38 | # Handle the unit tests 39 | ######################################################################## 40 | include(GrTest) 41 | 42 | set(GR_TEST_TARGET_DEPS gnuradio-foo) 43 | set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/swig) 44 | -------------------------------------------------------------------------------- /gr-foo/python/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2008,2009 Free Software Foundation, Inc. 3 | # 4 | # This application is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; either version 3, or (at your option) 7 | # any later version. 8 | # 9 | # This application is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, write to the Free Software Foundation, Inc., 16 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | # 18 | 19 | # The presence of this file turns this directory into a Python package 20 | 21 | ''' 22 | This is the GNU Radio CCS module. Place your Python package 23 | description here (python/__init__.py). 24 | ''' 25 | 26 | # ---------------------------------------------------------------- 27 | # Temporary workaround for ticket:181 (swig+python problem) 28 | import sys 29 | _RTLD_GLOBAL = 0 30 | try: 31 | from dl import RTLD_GLOBAL as _RTLD_GLOBAL 32 | except ImportError: 33 | try: 34 | from DLFCN import RTLD_GLOBAL as _RTLD_GLOBAL 35 | except ImportError: 36 | pass 37 | 38 | if _RTLD_GLOBAL != 0: 39 | _dlopenflags = sys.getdlopenflags() 40 | sys.setdlopenflags(_dlopenflags|_RTLD_GLOBAL) 41 | # ---------------------------------------------------------------- 42 | 43 | 44 | # import swig generated symbols into the foo namespace 45 | from foo_swig import * 46 | 47 | # import any pure python here 48 | # 49 | 50 | # ---------------------------------------------------------------- 51 | # Tail of workaround 52 | if _RTLD_GLOBAL != 0: 53 | sys.setdlopenflags(_dlopenflags) # Restore original flags 54 | # ---------------------------------------------------------------- 55 | -------------------------------------------------------------------------------- /gr-foo/swig/foo_swig.i: -------------------------------------------------------------------------------- 1 | #define FOO_API 2 | 3 | %include "gnuradio.i" 4 | 5 | //load generated python docstrings 6 | %include "foo_swig_doc.i" 7 | 8 | %{ 9 | #include "foo/burst_tagger.h" 10 | #include "foo/packet_dropper.h" 11 | #include "foo/packet_pad.h" 12 | #include "foo/packet_pad2.h" 13 | #include "foo/periodic_msg_source.h" 14 | #include "foo/random_periodic_msg_source.h" 15 | #include "foo/rtt_measure.h" 16 | #include "foo/wireshark_connector.h" 17 | %} 18 | 19 | 20 | %include "foo/burst_tagger.h" 21 | %include "foo/packet_dropper.h" 22 | %include "foo/packet_pad.h" 23 | %include "foo/packet_pad2.h" 24 | %include "foo/periodic_msg_source.h" 25 | %include "foo/random_periodic_msg_source.h" 26 | %include "foo/rtt_measure.h" 27 | %include "foo/wireshark_connector.h" 28 | 29 | GR_SWIG_BLOCK_MAGIC2(foo, burst_tagger); 30 | GR_SWIG_BLOCK_MAGIC2(foo, packet_dropper); 31 | GR_SWIG_BLOCK_MAGIC2(foo, packet_pad); 32 | GR_SWIG_BLOCK_MAGIC2(foo, packet_pad2); 33 | GR_SWIG_BLOCK_MAGIC2(foo, periodic_msg_source); 34 | GR_SWIG_BLOCK_MAGIC2(foo, random_periodic_msg_source); 35 | GR_SWIG_BLOCK_MAGIC2(foo, rtt_measure); 36 | GR_SWIG_BLOCK_MAGIC2(foo, wireshark_connector); 37 | -------------------------------------------------------------------------------- /gr-ieee802-11/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | 7 | [Makefile] 8 | indent_style = tab 9 | 10 | [**.{cc,h,xml}] 11 | indent_style = tab 12 | indent_size = 4 13 | 14 | -------------------------------------------------------------------------------- /gr-ieee802-11/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | examples/*.py 3 | .cproject 4 | .project 5 | .pydevproject 6 | .settings 7 | *.pyc 8 | **/.DS_Store 9 | .clang_complete 10 | -------------------------------------------------------------------------------- /gr-ieee802-11/MANIFEST.md: -------------------------------------------------------------------------------- 1 | title: gr-ieee802-11 2 | author: 3 | - Bastian Bloessl 4 | copyright_owner: 5 | - Bastian Bloessl 6 | dependencies: 7 | - gnuradio (>= 3.7.4) 8 | repo: https://github.com/bastibl/gr-ieee802-11.git 9 | tags: 10 | - IEEE 802.11 11 | - WiFi 12 | - OFDM 13 | website: http://www.ccs-labs.org/projects/wime/ 14 | brief: IEEE 802.11 a/g/p Transceiver 15 | icon: http://www.ccs-labs.org/projects/wime/wime.png 16 | --- 17 | This an IEEE 802.11 a/g/p transceiver for GNU Radio v3.7. Over the air, I tested it with the Ettus USRP N210 with XCVR2450 and CBX daughterboards. For interoperability tests I use mainly an Atheros (ath5k) WiFi card. The code can also be used for packet error rate simulations. 18 | -------------------------------------------------------------------------------- /gr-ieee802-11/apps/debug.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | valgrind --leak-check=yes --trace-children=yes --log-file=./valgrind.out ../examples/ofdm_sim.py 4 | #valgrind --tool=callgrind --dump-instr=yes --trace-children=yes --log-file=./valgrind.out ../examples/ofdm_sim.py 5 | -------------------------------------------------------------------------------- /gr-ieee802-11/apps/nic.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | FILE="/tmp/ofdm.pcap" 4 | FLOWGRAPH="wifi_transceiver.py" 5 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 6 | 7 | ### create fifo 8 | if [ -e ${FILE} ] 9 | then 10 | echo "${FILE}: file already exists" 11 | if ! [ -p ${FILE} ] 12 | then 13 | echo "ERROR: ${FILE} exists and is not a FIFO" 14 | exit 1 15 | fi 16 | else 17 | echo "creating fifo: ${FILE}" 18 | mkfifo ${FILE} 19 | fi 20 | 21 | 22 | ### create tap interface 23 | if [[ `ifconfig -a | grep tap0 | wc -l` -eq 0 ]] 24 | then 25 | sudo ip tuntap add dev tap0 user ${USER} mode tap 26 | fi 27 | 28 | ### reconfigure it in any case, just to be sure it's up 29 | sudo ifconfig tap0 down 30 | sudo ifconfig tap0 hw ether 12:34:56:78:90:ab 31 | sudo ifconfig tap0 mtu 440 32 | sudo ifconfig tap0 up 33 | sudo ifconfig tap0 192.168.123.1 34 | 35 | sudo route del -net 192.168.123.0/24 36 | sudo route add -net 192.168.123.0/24 mss 400 dev tap0 37 | 38 | sudo tc qdisc del dev tap0 root 39 | sudo tc qdisc add dev tap0 root netem delay 10ms 40 | 41 | sudo arp -s 192.168.123.2 30:14:4a:e6:46:e4 42 | 43 | 44 | ### start transceiver 45 | cd ${DIR} 46 | cd ../examples/ 47 | ./${FLOWGRAPH} & 48 | sleep 1 49 | 50 | 51 | ### start wireshark 52 | wireshark -k -i ${FILE} & 53 | sleep 1 54 | 55 | 56 | ### start netcat 57 | echo "##########################################################################" 58 | echo "### starting netcat. Just type and the lines will be send to the flowgraph" 59 | echo "##########################################################################" 60 | sleep 2 61 | 62 | #echo | nc -u localhost 52001 63 | cat 64 | 65 | 66 | -------------------------------------------------------------------------------- /gr-ieee802-11/apps/rx_demo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Enable Wireshark Connector in wifi_rx flow graph 4 | 5 | FILE="/tmp/wifi.pcap" 6 | FLOWGRAPH="wifi_rx.py" 7 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 8 | 9 | ### create fifo 10 | if [ -e ${FILE} ] 11 | then 12 | echo "${FILE}: file already exists" 13 | if ! [ -p ${FILE} ] 14 | then 15 | echo "ERROR: ${FILE} exists and is not a FIFO" 16 | exit 1 17 | fi 18 | else 19 | echo "creating fifo: ${FILE}" 20 | mkfifo ${FILE} 21 | fi 22 | 23 | 24 | ### create tap interface 25 | if [[ `ifconfig -a | grep tap0 | wc -l` -eq 0 ]] 26 | then 27 | sudo ip tuntap add dev tap0 user ${USER} mode tap 28 | fi 29 | 30 | ### reconfigure it in any case, just to be sure it's up 31 | sudo ifconfig tap0 down 32 | sudo ifconfig tap0 hw ether 12:34:56:78:90:ab 33 | sudo ifconfig tap0 up 34 | sudo ifconfig tap0 192.168.123.1 35 | 36 | 37 | ### start transceiver 38 | cd ${DIR} 39 | cd ../examples/ 40 | ./${FLOWGRAPH} & 41 | sleep 1 42 | 43 | 44 | ### start wireshark 45 | wireshark -k -i ${FILE} & 46 | sleep 1 47 | 48 | 49 | ### start netcat 50 | echo "##########################################################################" 51 | echo "### starting netcat. Just type and the lines will be send to the flowgraph" 52 | echo "##########################################################################" 53 | sleep 2 54 | 55 | #echo | nc -u localhost 52001 56 | cat 57 | 58 | 59 | -------------------------------------------------------------------------------- /gr-ieee802-11/cmake/Modules/FindCppUnit.cmake: -------------------------------------------------------------------------------- 1 | # http://www.cmake.org/pipermail/cmake/2006-October/011446.html 2 | # Modified to use pkg config and use standard var names 3 | 4 | # 5 | # Find the CppUnit includes and library 6 | # 7 | # This module defines 8 | # CPPUNIT_INCLUDE_DIR, where to find tiff.h, etc. 9 | # CPPUNIT_LIBRARIES, the libraries to link against to use CppUnit. 10 | # CPPUNIT_FOUND, If false, do not try to use CppUnit. 11 | 12 | INCLUDE(FindPkgConfig) 13 | PKG_CHECK_MODULES(PC_CPPUNIT "cppunit") 14 | 15 | FIND_PATH(CPPUNIT_INCLUDE_DIRS 16 | NAMES cppunit/TestCase.h 17 | HINTS ${PC_CPPUNIT_INCLUDE_DIR} 18 | ${CMAKE_INSTALL_PREFIX}/include 19 | PATHS 20 | /usr/local/include 21 | /usr/include 22 | ) 23 | 24 | FIND_LIBRARY(CPPUNIT_LIBRARIES 25 | NAMES cppunit 26 | HINTS ${PC_CPPUNIT_LIBDIR} 27 | ${CMAKE_INSTALL_PREFIX}/lib 28 | ${CMAKE_INSTALL_PREFIX}/lib64 29 | PATHS 30 | ${CPPUNIT_INCLUDE_DIRS}/../lib 31 | /usr/local/lib 32 | /usr/lib 33 | ) 34 | 35 | LIST(APPEND CPPUNIT_LIBRARIES ${CMAKE_DL_LIBS}) 36 | 37 | INCLUDE(FindPackageHandleStandardArgs) 38 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS) 39 | MARK_AS_ADVANCED(CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS) 40 | -------------------------------------------------------------------------------- /gr-ieee802-11/cmake/Modules/FindGnuradioRuntime.cmake: -------------------------------------------------------------------------------- 1 | INCLUDE(FindPkgConfig) 2 | PKG_CHECK_MODULES(PC_GNURADIO_RUNTIME gnuradio-runtime) 3 | 4 | if(PC_GNURADIO_RUNTIME_FOUND) 5 | # look for include files 6 | FIND_PATH( 7 | GNURADIO_RUNTIME_INCLUDE_DIRS 8 | NAMES gnuradio/top_block.h 9 | HINTS $ENV{GNURADIO_RUNTIME_DIR}/include 10 | ${PC_GNURADIO_RUNTIME_INCLUDE_DIRS} 11 | ${CMAKE_INSTALL_PREFIX}/include 12 | PATHS /usr/local/include 13 | /usr/include 14 | ) 15 | 16 | # look for libs 17 | FIND_LIBRARY( 18 | GNURADIO_RUNTIME_LIBRARIES 19 | NAMES gnuradio-runtime 20 | HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib 21 | ${PC_GNURADIO_RUNTIME_LIBDIR} 22 | ${CMAKE_INSTALL_PREFIX}/lib/ 23 | ${CMAKE_INSTALL_PREFIX}/lib64/ 24 | PATHS /usr/local/lib 25 | /usr/local/lib64 26 | /usr/lib 27 | /usr/lib64 28 | ) 29 | 30 | set(GNURADIO_RUNTIME_FOUND ${PC_GNURADIO_RUNTIME_FOUND}) 31 | endif(PC_GNURADIO_RUNTIME_FOUND) 32 | 33 | INCLUDE(FindPackageHandleStandardArgs) 34 | # do not check GNURADIO_RUNTIME_INCLUDE_DIRS, is not set when default include path us used. 35 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_RUNTIME DEFAULT_MSG GNURADIO_RUNTIME_LIBRARIES) 36 | MARK_AS_ADVANCED(GNURADIO_RUNTIME_LIBRARIES GNURADIO_RUNTIME_INCLUDE_DIRS) 37 | -------------------------------------------------------------------------------- /gr-ieee802-11/cmake/Modules/FindLog4cpp.cmake: -------------------------------------------------------------------------------- 1 | # - Find Log4cpp 2 | # Find the native LOG4CPP includes and library 3 | # 4 | # LOG4CPP_INCLUDE_DIR - where to find LOG4CPP.h, etc. 5 | # LOG4CPP_LIBRARIES - List of libraries when using LOG4CPP. 6 | # LOG4CPP_FOUND - True if LOG4CPP found. 7 | 8 | 9 | if (LOG4CPP_INCLUDE_DIR) 10 | # Already in cache, be silent 11 | set(LOG4CPP_FIND_QUIETLY TRUE) 12 | endif () 13 | 14 | find_path(LOG4CPP_INCLUDE_DIR log4cpp/Category.hh 15 | /opt/local/include 16 | /usr/local/include 17 | /usr/include 18 | ) 19 | 20 | set(LOG4CPP_NAMES log4cpp) 21 | find_library(LOG4CPP_LIBRARY 22 | NAMES ${LOG4CPP_NAMES} 23 | PATHS /usr/lib /usr/local/lib /opt/local/lib 24 | ) 25 | 26 | 27 | if (LOG4CPP_INCLUDE_DIR AND LOG4CPP_LIBRARY) 28 | set(LOG4CPP_FOUND TRUE) 29 | set(LOG4CPP_LIBRARIES ${LOG4CPP_LIBRARY} CACHE INTERNAL "" FORCE) 30 | set(LOG4CPP_INCLUDE_DIRS ${LOG4CPP_INCLUDE_DIR} CACHE INTERNAL "" FORCE) 31 | else () 32 | set(LOG4CPP_FOUND FALSE CACHE INTERNAL "" FORCE) 33 | set(LOG4CPP_LIBRARY "" CACHE INTERNAL "" FORCE) 34 | set(LOG4CPP_LIBRARIES "" CACHE INTERNAL "" FORCE) 35 | set(LOG4CPP_INCLUDE_DIR "" CACHE INTERNAL "" FORCE) 36 | set(LOG4CPP_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE) 37 | endif () 38 | 39 | if (LOG4CPP_FOUND) 40 | if (NOT LOG4CPP_FIND_QUIETLY) 41 | message(STATUS "Found LOG4CPP: ${LOG4CPP_LIBRARIES}") 42 | endif () 43 | else () 44 | if (LOG4CPP_FIND_REQUIRED) 45 | message(STATUS "Looked for LOG4CPP libraries named ${LOG4CPPS_NAMES}.") 46 | message(FATAL_ERROR "Could NOT find LOG4CPP library") 47 | endif () 48 | endif () 49 | 50 | mark_as_advanced( 51 | LOG4CPP_LIBRARIES 52 | LOG4CPP_INCLUDE_DIRS 53 | ) 54 | -------------------------------------------------------------------------------- /gr-ieee802-11/cmake/Modules/GrPlatform.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | if(DEFINED __INCLUDED_GR_PLATFORM_CMAKE) 21 | return() 22 | endif() 23 | set(__INCLUDED_GR_PLATFORM_CMAKE TRUE) 24 | 25 | ######################################################################## 26 | # Setup additional defines for OS types 27 | ######################################################################## 28 | if(CMAKE_SYSTEM_NAME STREQUAL "Linux") 29 | set(LINUX TRUE) 30 | endif() 31 | 32 | if(NOT CMAKE_CROSSCOMPILING AND LINUX AND EXISTS "/etc/debian_version") 33 | set(DEBIAN TRUE) 34 | endif() 35 | 36 | if(NOT CMAKE_CROSSCOMPILING AND LINUX AND EXISTS "/etc/redhat-release") 37 | set(REDHAT TRUE) 38 | endif() 39 | 40 | if(NOT CMAKE_CROSSCOMPILING AND LINUX AND EXISTS "/etc/slackware-version") 41 | set(SLACKWARE TRUE) 42 | endif() 43 | 44 | ######################################################################## 45 | # when the library suffix should be 64 (applies to redhat linux family) 46 | ######################################################################## 47 | if (REDHAT OR SLACKWARE) 48 | set(LIB64_CONVENTION TRUE) 49 | endif() 50 | 51 | if(NOT DEFINED LIB_SUFFIX AND LIB64_CONVENTION AND CMAKE_SYSTEM_PROCESSOR MATCHES "64$") 52 | set(LIB_SUFFIX 64) 53 | endif() 54 | set(LIB_SUFFIX ${LIB_SUFFIX} CACHE STRING "lib directory suffix") 55 | -------------------------------------------------------------------------------- /gr-ieee802-11/cmake/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | # http://www.vtk.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F 2 | 3 | IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 4 | MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 5 | ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 6 | 7 | FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 8 | STRING(REGEX REPLACE "\n" ";" files "${files}") 9 | FOREACH(file ${files}) 10 | MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 11 | IF(EXISTS "$ENV{DESTDIR}${file}") 12 | EXEC_PROGRAM( 13 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 14 | OUTPUT_VARIABLE rm_out 15 | RETURN_VALUE rm_retval 16 | ) 17 | IF(NOT "${rm_retval}" STREQUAL 0) 18 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 19 | ENDIF(NOT "${rm_retval}" STREQUAL 0) 20 | ELSEIF(IS_SYMLINK "$ENV{DESTDIR}${file}") 21 | EXEC_PROGRAM( 22 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 23 | OUTPUT_VARIABLE rm_out 24 | RETURN_VALUE rm_retval 25 | ) 26 | IF(NOT "${rm_retval}" STREQUAL 0) 27 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 28 | ENDIF(NOT "${rm_retval}" STREQUAL 0) 29 | ELSE(EXISTS "$ENV{DESTDIR}${file}") 30 | MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 31 | ENDIF(EXISTS "$ENV{DESTDIR}${file}") 32 | ENDFOREACH(file) 33 | -------------------------------------------------------------------------------- /gr-ieee802-11/docs/doxygen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | ######################################################################## 21 | # Create the doxygen configuration file 22 | ######################################################################## 23 | file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} top_srcdir) 24 | file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} top_builddir) 25 | file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} abs_top_srcdir) 26 | file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} abs_top_builddir) 27 | 28 | set(HAVE_DOT ${DOXYGEN_DOT_FOUND}) 29 | set(enable_html_docs YES) 30 | set(enable_latex_docs NO) 31 | set(enable_xml_docs YES) 32 | 33 | configure_file( 34 | ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in 35 | ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile 36 | @ONLY) 37 | 38 | set(BUILT_DIRS ${CMAKE_CURRENT_BINARY_DIR}/xml ${CMAKE_CURRENT_BINARY_DIR}/html) 39 | 40 | ######################################################################## 41 | # Make and install doxygen docs 42 | ######################################################################## 43 | add_custom_command( 44 | OUTPUT ${BUILT_DIRS} 45 | COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile 46 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 47 | COMMENT "Generating documentation with doxygen" 48 | ) 49 | 50 | add_custom_target(doxygen_target ALL DEPENDS ${BUILT_DIRS}) 51 | 52 | install(DIRECTORY ${BUILT_DIRS} DESTINATION ${GR_PKG_DOC_DIR}) 53 | -------------------------------------------------------------------------------- /gr-ieee802-11/docs/doxygen/doxyxml/.gitignore: -------------------------------------------------------------------------------- 1 | /Makefile 2 | /Makefile.in 3 | 4 | -------------------------------------------------------------------------------- /gr-ieee802-11/docs/doxygen/doxyxml/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2007,2009,2011 Free Software Foundation, Inc. 3 | # 4 | # This file is part of GNU Radio 5 | # 6 | # GNU Radio is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3, or (at your option) 9 | # any later version. 10 | # 11 | # GNU Radio is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with GNU Radio; see the file COPYING. If not, write to 18 | # the Free Software Foundation, Inc., 51 Franklin Street, 19 | # Boston, MA 02110-1301, USA. 20 | # 21 | 22 | include $(top_srcdir)/Makefile.common 23 | 24 | EXTRA_DIST = \ 25 | example/aadvark.cc \ 26 | example/aadvark.h \ 27 | example/Doxyfile \ 28 | example/xml/aadvark_8cc.xml \ 29 | example/xml/aadvark_8h.xml \ 30 | example/xml/classAadvark.xml \ 31 | example/xml/combine.xslt \ 32 | example/xml/compound.xsd \ 33 | example/xml/index.xml \ 34 | example/xml/index.xsd 35 | 36 | if PYTHON 37 | utilspythondir = $(grpythondir)/doxyxml 38 | 39 | TESTS = \ 40 | run_tests 41 | 42 | nobase_utilspython_PYTHON = \ 43 | __init__.py \ 44 | base.py \ 45 | doxyindex.py \ 46 | text.py \ 47 | generated/__init__.py \ 48 | generated/index.py \ 49 | generated/indexsuper.py \ 50 | generated/compound.py \ 51 | generated/compoundsuper.py 52 | endif -------------------------------------------------------------------------------- /gr-ieee802-11/docs/doxygen/doxyxml/example/aadvark.cc: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2010 Free Software Foundation, Inc. 4 | * 5 | * This file is part of GNU Radio 6 | * 7 | * GNU Radio is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3, or (at your option) 10 | * any later version. 11 | * 12 | * GNU Radio is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with GNU Radio; see the file COPYING. If not, write to 19 | * the Free Software Foundation, Inc., 51 Franklin Street, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | #include 23 | #include "aadvark.h" 24 | 25 | void Aadvark::print() { 26 | std::cout << "aadvark is " << aadvarkness << "/10 aadvarky" << std::endl; 27 | } 28 | 29 | Aadvark::Aadvark(int aaness): aadvarkness(aaness) {} 30 | 31 | bool aadvarky_enough(Aadvark aad) { 32 | if (aad.get_aadvarkness() > 6) 33 | return true; 34 | else 35 | return false; 36 | } 37 | 38 | int Aadvark::get_aadvarkness() { 39 | return aadvarkness; 40 | } 41 | 42 | int main() { 43 | Aadvark arold = Aadvark(6); 44 | arold.print(); 45 | if (aadvarky_enough(arold)) 46 | std::cout << "He is aadvarky enough" << std::endl; 47 | else 48 | std::cout << "He is not aadvarky enough" << std::endl; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /gr-ieee802-11/docs/doxygen/doxyxml/example/aadvark.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2010 Free Software Foundation, Inc. 4 | * 5 | * This file is part of GNU Radio 6 | * 7 | * GNU Radio is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 3, or (at your option) 10 | * any later version. 11 | * 12 | * GNU Radio is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with GNU Radio; see the file COPYING. If not, write to 19 | * the Free Software Foundation, Inc., 51 Franklin Street, 20 | * Boston, MA 02110-1301, USA. 21 | */ 22 | #include 23 | 24 | /*! 25 | * \brief Models the mammal Aadvark. 26 | * 27 | * Sadly the model is incomplete and cannot capture all aspects of an aadvark yet. 28 | * 29 | * This line is uninformative and is only to test line breaks in the comments. 30 | */ 31 | class Aadvark { 32 | public: 33 | //! \brief Outputs the vital aadvark statistics. 34 | void print(); 35 | //! \param aaness The aadvarkness of an aadvark is a measure of how aadvarky it is. 36 | Aadvark(int aaness); 37 | int get_aadvarkness(); 38 | private: 39 | int aadvarkness; 40 | }; 41 | 42 | bool aadvarky_enough(Aadvark aad); 43 | 44 | int main(); 45 | -------------------------------------------------------------------------------- /gr-ieee802-11/docs/doxygen/doxyxml/example/xml/combine.xslt: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /gr-ieee802-11/docs/doxygen/doxyxml/example/xml/index.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Aadvark 4 | aadvarkness 5 | print 6 | Aadvark 7 | get_aadvarkness 8 | 9 | aadvark.cc 10 | aadvarky_enough 11 | main 12 | 13 | aadvark.h 14 | aadvarky_enough 15 | main 16 | 17 | 18 | -------------------------------------------------------------------------------- /gr-ieee802-11/docs/doxygen/doxyxml/generated/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Contains generated files produced by generateDS.py. 3 | 4 | These do the real work of parsing the doxygen xml files but the 5 | resultant classes are not very friendly to navigate so the rest of the 6 | doxyxml module processes them further. 7 | """ 8 | -------------------------------------------------------------------------------- /gr-ieee802-11/docs/doxygen/doxyxml/generated/index.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | Generated Mon Feb 9 19:08:05 2009 by generateDS.py. 5 | """ 6 | 7 | from xml.dom import minidom 8 | 9 | import os 10 | import sys 11 | import compound 12 | 13 | import indexsuper as supermod 14 | 15 | class DoxygenTypeSub(supermod.DoxygenType): 16 | def __init__(self, version=None, compound=None): 17 | supermod.DoxygenType.__init__(self, version, compound) 18 | 19 | def find_compounds_and_members(self, details): 20 | """ 21 | Returns a list of all compounds and their members which match details 22 | """ 23 | 24 | results = [] 25 | for compound in self.compound: 26 | members = compound.find_members(details) 27 | if members: 28 | results.append([compound, members]) 29 | else: 30 | if details.match(compound): 31 | results.append([compound, []]) 32 | 33 | return results 34 | 35 | supermod.DoxygenType.subclass = DoxygenTypeSub 36 | # end class DoxygenTypeSub 37 | 38 | 39 | class CompoundTypeSub(supermod.CompoundType): 40 | def __init__(self, kind=None, refid=None, name='', member=None): 41 | supermod.CompoundType.__init__(self, kind, refid, name, member) 42 | 43 | def find_members(self, details): 44 | """ 45 | Returns a list of all members which match details 46 | """ 47 | 48 | results = [] 49 | 50 | for member in self.member: 51 | if details.match(member): 52 | results.append(member) 53 | 54 | return results 55 | 56 | supermod.CompoundType.subclass = CompoundTypeSub 57 | # end class CompoundTypeSub 58 | 59 | 60 | class MemberTypeSub(supermod.MemberType): 61 | 62 | def __init__(self, kind=None, refid=None, name=''): 63 | supermod.MemberType.__init__(self, kind, refid, name) 64 | 65 | supermod.MemberType.subclass = MemberTypeSub 66 | # end class MemberTypeSub 67 | 68 | 69 | def parse(inFilename): 70 | 71 | doc = minidom.parse(inFilename) 72 | rootNode = doc.documentElement 73 | rootObj = supermod.DoxygenType.factory() 74 | rootObj.build(rootNode) 75 | 76 | return rootObj 77 | 78 | -------------------------------------------------------------------------------- /gr-ieee802-11/docs/doxygen/doxyxml/run_tests.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 1st parameter is absolute path to component source directory 4 | # 2nd parameter is absolute path to component build directory 5 | # 3rd parameter is path to Python QA directory 6 | 7 | # Note: calling master run_tests.sh in gnuradio core is not strictly 8 | # correct, as it will result in a partially bogus PYTHONPATH, but it 9 | # does make the correct paths in the second half so all is well. 10 | 11 | @PYTHON@ @srcdir@/__init__.py 12 | 13 | # @top_builddir@/run_tests.sh \ 14 | # @abs_top_srcdir@/gnuradio-core \ 15 | # @abs_top_builddir@/gnuradio-core \ 16 | # @srcdir@ 17 | -------------------------------------------------------------------------------- /gr-ieee802-11/docs/doxygen/doxyxml/text.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2010 Free Software Foundation, Inc. 3 | # 4 | # This file is part of GNU Radio 5 | # 6 | # GNU Radio is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3, or (at your option) 9 | # any later version. 10 | # 11 | # GNU Radio is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with GNU Radio; see the file COPYING. If not, write to 18 | # the Free Software Foundation, Inc., 51 Franklin Street, 19 | # Boston, MA 02110-1301, USA. 20 | # 21 | """ 22 | Utilities for extracting text from generated classes. 23 | """ 24 | 25 | def is_string(txt): 26 | if isinstance(txt, str): 27 | return True 28 | try: 29 | if isinstance(txt, unicode): 30 | return True 31 | except NameError: 32 | pass 33 | return False 34 | 35 | def description(obj): 36 | if obj is None: 37 | return None 38 | return description_bit(obj).strip() 39 | 40 | def description_bit(obj): 41 | if hasattr(obj, 'content'): 42 | contents = [description_bit(item) for item in obj.content] 43 | result = ''.join(contents) 44 | elif hasattr(obj, 'content_'): 45 | contents = [description_bit(item) for item in obj.content_] 46 | result = ''.join(contents) 47 | elif hasattr(obj, 'value'): 48 | result = description_bit(obj.value) 49 | elif is_string(obj): 50 | return obj 51 | else: 52 | raise StandardError('Expecting a string or something with content, content_ or value attribute') 53 | # If this bit is a paragraph then add one some line breaks. 54 | if hasattr(obj, 'name') and obj.name == 'para': 55 | result += "\n\n" 56 | return result 57 | -------------------------------------------------------------------------------- /gr-ieee802-11/docs/doxygen/other/group_defs.dox: -------------------------------------------------------------------------------- 1 | /*! 2 | * \defgroup block GNU Radio HOWTO C++ Signal Processing Blocks 3 | * \brief All C++ blocks that can be used from the HOWTO GNU Radio 4 | * module are listed here or in the subcategories below. 5 | * 6 | */ 7 | 8 | -------------------------------------------------------------------------------- /gr-ieee802-11/docs/doxygen/other/main_page.dox: -------------------------------------------------------------------------------- 1 | /*! \mainpage 2 | 3 | Welcome to the GNU Radio HOWTO Block 4 | 5 | This is the intro page for the Doxygen manual generated for the HOWTO 6 | block (docs/doxygen/other/main_page.dox). Edit it to add more detailed 7 | documentation about the new GNU Radio modules contained in this 8 | project. 9 | 10 | */ 11 | -------------------------------------------------------------------------------- /gr-ieee802-11/grc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB xml_files "*.xml") 2 | 3 | install(FILES ${xml_files} DESTINATION share/gnuradio/grc/blocks ) 4 | -------------------------------------------------------------------------------- /gr-ieee802-11/grc/ieee802_11_chunks_to_symbols.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Chunks to Symbols 4 | ieee802_11_chunks_to_symbols_xx 5 | [IEEE802.11] 6 | import ieee802_11 7 | ieee802_11.chunks_to_symbols() 8 | 9 | in 10 | byte 11 | 1 12 | 13 | 14 | out 15 | complex 16 | 1 17 | 18 | 19 | -------------------------------------------------------------------------------- /gr-ieee802-11/grc/ieee802_11_decode_mac.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WiFi Decode MAC 5 | ieee802_11_decode_mac 6 | [IEEE802.11] 7 | import ieee802_11 8 | ieee802_11.decode_mac($log, $debug) 9 | 10 | 11 | Log 12 | log 13 | False 14 | bool 15 | 16 | 20 | 24 | 25 | 26 | 27 | Debug 28 | debug 29 | False 30 | bool 31 | 32 | 36 | 40 | 41 | 42 | 43 | in 44 | byte 45 | 48 46 | 47 | 48 | 49 | out 50 | message 51 | 1 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /gr-ieee802-11/grc/ieee802_11_ether_encap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Ethernet Encapsulation 5 | ieee802_11_ether_encap 6 | [IEEE802.11] 7 | import ieee802_11 8 | ieee802_11.ether_encap($debug) 9 | 10 | 11 | Debug 12 | debug 13 | False 14 | bool 15 | 16 | 20 | 24 | 25 | 26 | 27 | from tap 28 | message 29 | 1 30 | 31 | 32 | 33 | from wifi 34 | message 35 | 1 36 | 37 | 38 | 39 | to tap 40 | message 41 | 1 42 | 43 | 44 | 45 | to wifi 46 | message 47 | 1 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /gr-ieee802-11/grc/ieee802_11_mac.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WiFi MAC 5 | ieee802_11_mac 6 | [IEEE802.11] 7 | import ieee802_11 8 | ieee802_11.mac($src_mac, $dst_mac, $bss_mac) 9 | 10 | 11 | SRC MAC 12 | src_mac 13 | [0x23, 0x23, 0x23, 0x23, 0x23, 0x23] 14 | int_vector 15 | 16 | 17 | 18 | DST MAC 19 | dst_mac 20 | [0x42, 0x42, 0x42, 0x42, 0x42, 0x42] 21 | int_vector 22 | 23 | 24 | 25 | BSS MAC 26 | bss_mac 27 | [0xff, 0xff, 0xff, 0xff, 0xff, 0xff] 28 | int_vector 29 | 30 | 31 | len($src_mac) == 6 32 | len($dst_mac) == 6 33 | len($bss_mac) == 6 34 | all([x >= 0 and 255 >= x for x in $src_mac]) 35 | all([x >= 0 and 255 >= x for x in $dst_mac]) 36 | all([x >= 0 and 255 >= x for x in $bss_mac]) 37 | 38 | 39 | app in 40 | message 41 | 1 42 | 43 | 44 | 45 | phy in 46 | message 47 | 1 48 | 49 | 50 | 51 | app out 52 | message 53 | 1 54 | 55 | 56 | 57 | phy out 58 | message 59 | 1 60 | 61 | 62 | -------------------------------------------------------------------------------- /gr-ieee802-11/grc/ieee802_11_mapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WiFi Mapper 5 | ieee802_11_mapper 6 | [IEEE802.11] 7 | import ieee802_11 8 | ieee802_11.mapper($encoding, $debug) 9 | set_encoding($encoding) 10 | 11 | 12 | Encoding 13 | encoding 14 | ieee802_11.BPSK_1_2 15 | int 16 | 17 | 21 | 25 | 29 | 33 | 37 | 41 | 45 | 49 | 50 | 51 | 52 | Debug 53 | debug 54 | False 55 | bool 56 | 57 | 61 | 65 | 66 | 67 | $encoding in range(8) 68 | 69 | 70 | in 71 | message 72 | 73 | 74 | 75 | out 76 | byte 77 | 1 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /gr-ieee802-11/grc/ieee802_11_moving_average_xx.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Moving Average 4 | ieee802_11_moving_average_xx 5 | [IEEE802.11] 6 | import ieee802_11 7 | ieee802_11.moving_average_$(type.fcn)($length) 8 | set_length($length) 9 | 10 | Type 11 | type 12 | enum 13 | 19 | 25 | 26 | 27 | 28 | Length 29 | length 30 | 48 31 | int 32 | 33 | 34 | 35 | in 36 | $type 37 | 38 | 39 | 40 | out 41 | $type 42 | 43 | 44 | -------------------------------------------------------------------------------- /gr-ieee802-11/grc/ieee802_11_parse_mac.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WiFi Parse MAC 5 | ieee802_11_parse_mac 6 | [IEEE802.11] 7 | import ieee802_11 8 | ieee802_11.parse_mac($log, $debug) 9 | 10 | 11 | Log 12 | log 13 | False 14 | bool 15 | 16 | 20 | 24 | 25 | 26 | 27 | Debug 28 | debug 29 | False 30 | bool 31 | 32 | 36 | 40 | 41 | 42 | 43 | in 44 | message 45 | 46 | 47 | 48 | fer 49 | message 50 | 1 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /gr-ieee802-11/grc/ieee802_11_sync_long.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WiFi Sync Long 5 | ieee802_11_sync_long 6 | [IEEE802.11] 7 | import ieee802_11 8 | ieee802_11.sync_long($sync_length, $log, $debug) 9 | 10 | 11 | Log 12 | log 13 | False 14 | bool 15 | 16 | 20 | 24 | 25 | 26 | 27 | Debug 28 | debug 29 | False 30 | bool 31 | 32 | 36 | 40 | 41 | 42 | 43 | Sync Length 44 | sync_length 45 | 240 46 | int 47 | 48 | 49 | $sync_length > 0 50 | 51 | 52 | in 53 | complex 54 | 1 55 | 56 | 57 | 58 | in delayed 59 | complex 60 | 1 61 | 62 | 63 | 64 | out 65 | complex 66 | 1 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /gr-ieee802-11/grc/ieee802_11_sync_short.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WiFi Sync Short 5 | ieee802_11_sync_short 6 | [IEEE802.11] 7 | import ieee802_11 8 | ieee802_11.sync_short($threshold, $min_plateau, $log, $debug) 9 | 10 | 11 | Log 12 | log 13 | False 14 | bool 15 | 16 | 20 | 24 | 25 | 26 | 27 | Debug 28 | debug 29 | False 30 | bool 31 | 32 | 36 | 40 | 41 | 42 | 43 | Threshold 44 | threshold 45 | 0.8 46 | real 47 | 48 | 49 | 50 | Min Plateau 51 | min_plateau 52 | 2 53 | int 54 | 55 | 56 | $threshold > 0 57 | $min_plateau > 0 58 | 59 | 60 | in 61 | complex 62 | 1 63 | 64 | 65 | 66 | abs 67 | complex 68 | 1 69 | 70 | 71 | 72 | cor 73 | float 74 | 1 75 | 76 | 77 | 78 | out 79 | complex 80 | 1 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /gr-ieee802-11/include/ieee802-11/api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_IEEE802_11_API_H 18 | #define INCLUDED_IEEE802_11_API_H 19 | 20 | #include 21 | 22 | #ifdef gnuradio_ieee802_11_EXPORTS 23 | # define IEEE802_11_API __GR_ATTR_EXPORT 24 | #else 25 | # define IEEE802_11_API __GR_ATTR_IMPORT 26 | #endif 27 | 28 | #endif /* INCLUDED_IEEE802_11_API_H */ 29 | -------------------------------------------------------------------------------- /gr-ieee802-11/include/ieee802-11/chunks_to_symbols.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_IEEE802_11_CHUNKS_TO_SYMBOLS_H 18 | #define INCLUDED_IEEE802_11_CHUNKS_TO_SYMBOLS_H 19 | 20 | #include 21 | #include 22 | 23 | namespace gr { 24 | namespace ieee802_11 { 25 | 26 | class IEEE802_11_API chunks_to_symbols : virtual public tagged_stream_block 27 | { 28 | public: 29 | typedef boost::shared_ptr sptr; 30 | static sptr make(); 31 | }; 32 | 33 | } /* namespace ieee802_11 */ 34 | } /* namespace gr */ 35 | 36 | #endif /* INCLUDED_IEEE802_11_CHUNKS_TO_SYMBOLS_H */ 37 | -------------------------------------------------------------------------------- /gr-ieee802-11/include/ieee802-11/constellations.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef INCLUDED_IEEE802_11_CONSTELLATIONS_H 19 | #define INCLUDED_IEEE802_11_CONSTELLATIONS_H 20 | 21 | #include 22 | #include 23 | 24 | namespace gr { 25 | namespace ieee802_11 { 26 | 27 | class IEEE802_11_API constellation_bpsk : virtual public digital::constellation 28 | { 29 | public: 30 | typedef boost::shared_ptr sptr; 31 | static sptr make(); 32 | 33 | protected: 34 | constellation_bpsk(); 35 | }; 36 | 37 | class IEEE802_11_API constellation_qpsk : virtual public digital::constellation 38 | { 39 | public: 40 | typedef boost::shared_ptr sptr; 41 | static sptr make(); 42 | 43 | protected: 44 | constellation_qpsk(); 45 | }; 46 | 47 | class IEEE802_11_API constellation_16qam : virtual public digital::constellation 48 | { 49 | public: 50 | typedef boost::shared_ptr sptr; 51 | static sptr make(); 52 | 53 | protected: 54 | constellation_16qam(); 55 | }; 56 | 57 | class IEEE802_11_API constellation_64qam : virtual public digital::constellation 58 | { 59 | public: 60 | typedef boost::shared_ptr sptr; 61 | static sptr make(); 62 | 63 | protected: 64 | constellation_64qam(); 65 | }; 66 | 67 | } // namespace ieee802_11 68 | } // namespace gr 69 | 70 | #endif /* INCLUDED_IEEE802_11_CONSTELLATIONS_H */ 71 | 72 | -------------------------------------------------------------------------------- /gr-ieee802-11/include/ieee802-11/decode_mac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013, 2016 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_IEEE802_11_DECODE_MAC_H 18 | #define INCLUDED_IEEE802_11_DECODE_MAC_H 19 | 20 | #include 21 | #include 22 | 23 | namespace gr { 24 | namespace ieee802_11 { 25 | 26 | class IEEE802_11_API decode_mac : virtual public block 27 | { 28 | public: 29 | 30 | typedef boost::shared_ptr sptr; 31 | static sptr make(bool log = false, bool debug = false); 32 | 33 | }; 34 | 35 | } // namespace ieee802_11 36 | } // namespace gr 37 | 38 | #endif /* INCLUDED_IEEE802_11_DECODE_MAC_H */ 39 | 40 | 41 | -------------------------------------------------------------------------------- /gr-ieee802-11/include/ieee802-11/ether_encap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_IEEE802_11_ETHER_ENCAP_H 18 | #define INCLUDED_IEEE802_11_ETHER_ENCAP_H 19 | 20 | #include 21 | #include 22 | 23 | namespace gr { 24 | namespace ieee802_11 { 25 | 26 | class IEEE802_11_API ether_encap : virtual public block 27 | { 28 | public: 29 | 30 | typedef boost::shared_ptr sptr; 31 | static sptr make(bool debug); 32 | 33 | }; 34 | 35 | } // namespace ieee802_11 36 | } // namespace gr 37 | 38 | #endif /* INCLUDED_IEEE802_11_ETHER_ENCAP_H */ 39 | -------------------------------------------------------------------------------- /gr-ieee802-11/include/ieee802-11/frame_equalizer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | * 17 | */ 18 | 19 | 20 | #ifndef INCLUDED_IEEE802_11_FRAME_EQUALIZER_H 21 | #define INCLUDED_IEEE802_11_FRAME_EQUALIZER_H 22 | 23 | #include 24 | #include 25 | 26 | enum Equalizer { 27 | LS = 0, 28 | LMS = 1, 29 | COMB = 2, 30 | STA = 3, 31 | }; 32 | 33 | namespace gr { 34 | namespace ieee802_11 { 35 | 36 | class IEEE802_11_API frame_equalizer : virtual public gr::block 37 | { 38 | 39 | public: 40 | typedef boost::shared_ptr sptr; 41 | static sptr make(Equalizer algo, double freq, double bw, 42 | bool log, bool debug); 43 | virtual void set_algorithm(Equalizer algo) = 0; 44 | virtual void set_bandwidth(double bw) = 0; 45 | virtual void set_frequency(double freq) = 0; 46 | }; 47 | 48 | } // namespace ieee802_11 49 | } // namespace gr 50 | 51 | #endif /* INCLUDED_IEEE802_11_FRAME_EQUALIZER_H */ 52 | -------------------------------------------------------------------------------- /gr-ieee802-11/include/ieee802-11/mac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013, 2016 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_IEEE802_11_MAC_H 18 | #define INCLUDED_IEEE802_11_MAC_H 19 | 20 | #include 21 | #include 22 | 23 | namespace gr { 24 | namespace ieee802_11 { 25 | 26 | class IEEE802_11_API mac : virtual public block 27 | { 28 | public: 29 | 30 | typedef boost::shared_ptr sptr; 31 | static sptr make(std::vector src_mac, 32 | std::vector dst_mac, 33 | std::vector bss_mac); 34 | }; 35 | 36 | } // namespace ieee802_11 37 | } // namespace gr 38 | 39 | #endif /* INCLUDED_IEEE802_11_MAC_H */ 40 | -------------------------------------------------------------------------------- /gr-ieee802-11/include/ieee802-11/mapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013, 2016 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_IEEE802_11_MAPPER_H 18 | #define INCLUDED_IEEE802_11_MAPPER_H 19 | 20 | #include 21 | #include 22 | 23 | enum Encoding { 24 | BPSK_1_2 = 0, 25 | BPSK_3_4 = 1, 26 | QPSK_1_2 = 2, 27 | QPSK_3_4 = 3, 28 | QAM16_1_2 = 4, 29 | QAM16_3_4 = 5, 30 | QAM64_2_3 = 6, 31 | QAM64_3_4 = 7, 32 | }; 33 | 34 | namespace gr { 35 | namespace ieee802_11 { 36 | 37 | class IEEE802_11_API mapper : virtual public block 38 | { 39 | public: 40 | 41 | typedef boost::shared_ptr sptr; 42 | static sptr make(Encoding mcs, bool debug = false); 43 | virtual void set_encoding(Encoding mcs) = 0; 44 | }; 45 | 46 | } // namespace ieee802_11 47 | } // namespace gr 48 | 49 | #endif /* INCLUDED_IEEE802_11_MAPPER_H */ 50 | -------------------------------------------------------------------------------- /gr-ieee802-11/include/ieee802-11/moving_average_XX.h.t: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef @GUARD_NAME@ 18 | #define @GUARD_NAME@ 19 | 20 | #include 21 | #include 22 | 23 | namespace gr { 24 | namespace ieee802_11 { 25 | 26 | class IEEE802_11_API @NAME@ : virtual public sync_block 27 | { 28 | public: 29 | typedef boost::shared_ptr<@NAME@> sptr; 30 | static sptr make(int length); 31 | 32 | virtual int length() const = 0; 33 | virtual void set_length(int length) = 0; 34 | 35 | }; 36 | 37 | } /* namespace blocks */ 38 | } /* namespace gr */ 39 | 40 | #endif /* @GUARD_NAME@ */ 41 | -------------------------------------------------------------------------------- /gr-ieee802-11/include/ieee802-11/parse_mac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013, 2016 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_IEEE802_11_PARSE_MAC_H 18 | #define INCLUDED_IEEE802_11_PARSE_MAC_H 19 | 20 | #include 21 | #include 22 | 23 | namespace gr { 24 | namespace ieee802_11 { 25 | 26 | class IEEE802_11_API parse_mac : virtual public block 27 | { 28 | public: 29 | 30 | typedef boost::shared_ptr sptr; 31 | static sptr make(bool log = false, bool debug = false); 32 | 33 | }; 34 | 35 | } // namespace ieee802_11 36 | } // namespace gr 37 | 38 | #endif /* INCLUDED_IEEE802_11_PARSE_MAC_H */ 39 | -------------------------------------------------------------------------------- /gr-ieee802-11/include/ieee802-11/signal_field.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013, 2016 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef INCLUDED_IEEE802_11_SIGNAL_FIELD_H 19 | #define INCLUDED_IEEE802_11_SIGNAL_FIELD_H 20 | 21 | #include 22 | #include 23 | 24 | namespace gr { 25 | namespace ieee802_11 { 26 | 27 | class IEEE802_11_API signal_field : virtual public digital::packet_header_default 28 | { 29 | public: 30 | typedef boost::shared_ptr sptr; 31 | static sptr make(); 32 | 33 | protected: 34 | signal_field(); 35 | }; 36 | 37 | } // namespace ieee802_11 38 | } // namespace gr 39 | 40 | #endif /* INCLUDED_IEEE802_11_SIGNAL_FIELD_H */ 41 | 42 | -------------------------------------------------------------------------------- /gr-ieee802-11/include/ieee802-11/sync_long.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013, 2016 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_IEEE802_11_SYNC_LONG_H 18 | #define INCLUDED_IEEE802_11_SYNC_LONG_H 19 | 20 | #include 21 | #include 22 | 23 | namespace gr { 24 | namespace ieee802_11 { 25 | 26 | class IEEE802_11_API sync_long : virtual public block 27 | { 28 | public: 29 | 30 | typedef boost::shared_ptr sptr; 31 | static sptr make(unsigned int sync_length, 32 | bool log = false, bool debug = false); 33 | 34 | }; 35 | 36 | } // namespace ieee802_11 37 | } // namespace gr 38 | 39 | #endif /* INCLUDED_IEEE802_11_SYNC_LONG_H */ 40 | -------------------------------------------------------------------------------- /gr-ieee802-11/include/ieee802-11/sync_short.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013, 2016 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_IEEE802_11_SYNC_SHORT_H 18 | #define INCLUDED_IEEE802_11_SYNC_SHORT_H 19 | 20 | #include 21 | #include 22 | 23 | namespace gr { 24 | namespace ieee802_11 { 25 | 26 | class IEEE802_11_API sync_short : virtual public block 27 | { 28 | public: 29 | 30 | typedef boost::shared_ptr sptr; 31 | static sptr make(double threshold, unsigned int min_plateau, bool log = false, bool debug = false); 32 | 33 | }; 34 | 35 | } // namespace ieee802_11 36 | } // namespace gr 37 | 38 | #endif /* INCLUDED_IEEE802_11_SYNC_SHORT_H */ 39 | -------------------------------------------------------------------------------- /gr-ieee802-11/lib/chunks_to_symbols_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_IEEE802_11_CHUNKS_TO_SYMBOLS_IMPL_H 18 | #define INCLUDED_IEEE802_11_CHUNKS_TO_SYMBOLS_IMPL_H 19 | 20 | #include 21 | #include 22 | 23 | namespace gr { 24 | namespace ieee802_11 { 25 | 26 | class chunks_to_symbols_impl : public chunks_to_symbols 27 | { 28 | public: 29 | chunks_to_symbols_impl(); 30 | ~chunks_to_symbols_impl(); 31 | 32 | int work(int noutput_items, 33 | gr_vector_int &ninput_itmes, 34 | gr_vector_const_void_star &input_items, 35 | gr_vector_void_star &output_items); 36 | 37 | private: 38 | boost::shared_ptr d_mapping; 39 | constellation_bpsk::sptr d_bpsk; 40 | constellation_qpsk::sptr d_qpsk; 41 | constellation_16qam::sptr d_16qam; 42 | constellation_64qam::sptr d_64qam; 43 | }; 44 | 45 | } /* namespace ieee802_11 */ 46 | } /* namespace gr */ 47 | 48 | #endif /* INCLUDED_IEEE802_11_CHUNKS_TO_SYMBOLS_IMPL_H */ 49 | -------------------------------------------------------------------------------- /gr-ieee802-11/lib/constellations_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_IEEE802_11_CONSTELLATIONS_IMPL_H 18 | #define INCLUDED_IEEE802_11_CONSTELLATIONS_IMPL_H 19 | 20 | #include 21 | 22 | namespace gr { 23 | namespace ieee802_11 { 24 | 25 | class constellation_bpsk_impl : public constellation_bpsk 26 | { 27 | public: 28 | constellation_bpsk_impl(); 29 | ~constellation_bpsk_impl(); 30 | 31 | unsigned int decision_maker(const gr_complex *sample); 32 | }; 33 | 34 | 35 | class constellation_qpsk_impl : public constellation_qpsk 36 | { 37 | public: 38 | constellation_qpsk_impl(); 39 | ~constellation_qpsk_impl(); 40 | 41 | unsigned int decision_maker(const gr_complex *sample); 42 | }; 43 | 44 | 45 | 46 | class constellation_16qam_impl : public constellation_16qam 47 | { 48 | public: 49 | constellation_16qam_impl(); 50 | ~constellation_16qam_impl(); 51 | 52 | unsigned int decision_maker(const gr_complex *sample); 53 | }; 54 | 55 | 56 | 57 | 58 | class constellation_64qam_impl : public constellation_64qam 59 | { 60 | public: 61 | constellation_64qam_impl(); 62 | ~constellation_64qam_impl(); 63 | 64 | unsigned int decision_maker(const gr_complex *sample); 65 | }; 66 | 67 | 68 | } // namespace ieee802_11 69 | } // namespace gr 70 | 71 | #endif /* INCLUDED_IEEE802_11_CONSTELLATIONS_IMPL_H */ 72 | -------------------------------------------------------------------------------- /gr-ieee802-11/lib/equalizer/base.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #include "base.h" 19 | #include 20 | #include 21 | 22 | using namespace gr::ieee802_11::equalizer; 23 | 24 | const gr_complex base::LONG[] = { 25 | 0, 0, 0, 0, 0, 0, 1, 1, -1, -1, 26 | 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, 27 | 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, 28 | 1, 1, 0, 1, -1, -1, 1, 1, -1, 1, 29 | -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, 30 | -1, 1, -1, 1, -1, 1, 1, 1, 1, 0, 31 | 0, 0, 0, 0 32 | }; 33 | 34 | const gr_complex base::POLARITY[127] = { 35 | 1, 1, 1, 1,-1,-1,-1, 1,-1,-1,-1,-1, 1, 1,-1, 1, 36 | -1,-1, 1, 1,-1, 1, 1,-1, 1, 1, 1, 1, 1, 1,-1, 1, 37 | 1, 1,-1, 1, 1,-1,-1, 1, 1, 1,-1, 1,-1,-1,-1, 1, 38 | -1, 1,-1,-1, 1,-1,-1, 1, 1, 1, 1, 1,-1,-1, 1, 1, 39 | -1,-1, 1,-1, 1,-1, 1, 1,-1,-1,-1, 1, 1,-1,-1,-1, 40 | -1, 1,-1,-1, 1,-1, 1, 1, 1, 1,-1, 1,-1, 1,-1, 1, 41 | -1,-1,-1,-1,-1, 1,-1, 1, 1,-1, 1,-1, 1, 1, 1,-1, 42 | -1, 1,-1,-1,-1, 1, 1, 1,-1,-1,-1,-1,-1,-1,-1 }; 43 | -------------------------------------------------------------------------------- /gr-ieee802-11/lib/equalizer/base.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef INCLUDED_IEEE802_11_EQUALIZER_BASE_H 19 | #define INCLUDED_IEEE802_11_EQUALIZER_BASE_H 20 | 21 | #include 22 | #include 23 | 24 | namespace gr { 25 | namespace ieee802_11 { 26 | namespace equalizer { 27 | 28 | class base { 29 | public: 30 | virtual ~base() {}; 31 | virtual void equalize(gr_complex *in, int n, gr_complex *symbols, uint8_t *bits, boost::shared_ptr mod) = 0; 32 | virtual double get_snr() = 0; 33 | 34 | static const gr_complex POLARITY[127]; 35 | 36 | protected: 37 | static const gr_complex LONG[64]; 38 | }; 39 | 40 | } /* namespace channel_estimation */ 41 | } /* namespace ieee802_11 */ 42 | } /* namespace gr */ 43 | 44 | #endif /* INCLUDED_IEEE802_11_EQUALIZER_BASE_H */ 45 | -------------------------------------------------------------------------------- /gr-ieee802-11/lib/equalizer/comb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef INCLUDED_IEEE802_11_EQUALIZER_COMB_H 19 | #define INCLUDED_IEEE802_11_EQUALIZER_COMB_H 20 | 21 | #include "base.h" 22 | 23 | namespace gr { 24 | namespace ieee802_11 { 25 | namespace equalizer { 26 | 27 | class comb: public base { 28 | public: 29 | virtual void equalize(gr_complex *in, int n, gr_complex *symbols, uint8_t *bits, boost::shared_ptr mod); 30 | double get_snr(); 31 | 32 | private: 33 | gr_complex d_H[64]; 34 | 35 | 36 | const double alpha = 0.2; 37 | }; 38 | 39 | } /* namespace channel_estimation */ 40 | } /* namespace ieee802_11 */ 41 | } /* namespace gr */ 42 | 43 | #endif /* INCLUDED_IEEE802_11_EQUALIZER_COMB_H */ 44 | 45 | -------------------------------------------------------------------------------- /gr-ieee802-11/lib/equalizer/lms.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #include "lms.h" 19 | #include 20 | #include 21 | 22 | using namespace gr::ieee802_11::equalizer; 23 | 24 | void lms::equalize(gr_complex *in, int n, gr_complex *symbols, uint8_t *bits, boost::shared_ptr mod) { 25 | 26 | if(n == 0) { 27 | std::memcpy(d_H, in, 64 * sizeof(gr_complex)); 28 | 29 | } else if(n == 1) { 30 | double signal = 0; 31 | double noise = 0; 32 | for(int i = 0; i < 64; i++) { 33 | if((i == 32) || (i < 6) || ( i > 58)) { 34 | continue; 35 | } 36 | noise += std::pow(std::abs(d_H[i] - in[i]), 2); 37 | signal += std::pow(std::abs(d_H[i] + in[i]), 2); 38 | d_H[i] += in[i]; 39 | d_H[i] /= LONG[i] * gr_complex(2, 0); 40 | } 41 | 42 | d_snr = 10 * std::log10(signal / noise / 2); 43 | 44 | } else { 45 | int c = 0; 46 | for(int i = 0; i < 64; i++) { 47 | if( (i == 11) || (i == 25) || (i == 32) || (i == 39) || (i == 53) || (i < 6) || ( i > 58)) { 48 | continue; 49 | } else { 50 | symbols[c] = in[i] / d_H[i]; 51 | bits[c] = mod->decision_maker(&symbols[c]); 52 | gr_complex point; 53 | mod->map_to_points(bits[c], &point); 54 | d_H[i] = gr_complex(1-alpha,0) * d_H[i] + gr_complex(alpha,0) * in[i] / point; 55 | c++; 56 | } 57 | } 58 | } 59 | } 60 | 61 | double 62 | lms::get_snr() { 63 | return d_snr; 64 | } 65 | -------------------------------------------------------------------------------- /gr-ieee802-11/lib/equalizer/lms.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef INCLUDED_IEEE802_11_EQUALIZER_LMS_H 19 | #define INCLUDED_IEEE802_11_EQUALIZER_LMS_H 20 | 21 | #include "base.h" 22 | #include 23 | 24 | namespace gr { 25 | namespace ieee802_11 { 26 | namespace equalizer { 27 | 28 | class lms: public base { 29 | public: 30 | virtual void equalize(gr_complex *in, int n, gr_complex *symbols, uint8_t *bits, boost::shared_ptr mod); 31 | private: 32 | double get_snr(); 33 | 34 | 35 | gr_complex d_H[64]; 36 | double d_snr; 37 | const double alpha = 0.5; 38 | }; 39 | 40 | } /* namespace channel_estimation */ 41 | } /* namespace ieee802_11 */ 42 | } /* namespace gr */ 43 | 44 | #endif /* INCLUDED_IEEE802_11_EQUALIZER_LMS_H */ 45 | -------------------------------------------------------------------------------- /gr-ieee802-11/lib/equalizer/ls.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #include "ls.h" 19 | #include 20 | #include 21 | 22 | using namespace gr::ieee802_11::equalizer; 23 | 24 | void ls::equalize(gr_complex *in, int n, gr_complex *symbols, uint8_t *bits, boost::shared_ptr mod) { 25 | 26 | if(n == 0) { 27 | std::memcpy(d_H, in, 64 * sizeof(gr_complex)); 28 | 29 | } else if(n == 1) { 30 | double signal = 0; 31 | double noise = 0; 32 | for(int i = 0; i < 64; i++) { 33 | if((i == 32) || (i < 6) || ( i > 58)) { 34 | continue; 35 | } 36 | noise += std::pow(std::abs(d_H[i] - in[i]), 2); 37 | signal += std::pow(std::abs(d_H[i] + in[i]), 2); 38 | d_H[i] += in[i]; 39 | d_H[i] /= LONG[i] * gr_complex(2, 0); 40 | } 41 | 42 | d_snr = 10 * std::log10(signal / noise / 2); 43 | 44 | } else { 45 | 46 | int c = 0; 47 | for(int i = 0; i < 64; i++) { 48 | if( (i == 11) || (i == 25) || (i == 32) || (i == 39) || (i == 53) || (i < 6) || ( i > 58)) { 49 | continue; 50 | } else { 51 | symbols[c] = in[i] / d_H[i]; 52 | bits[c] = mod->decision_maker(&symbols[c]); 53 | c++; 54 | } 55 | } 56 | } 57 | } 58 | 59 | double ls::get_snr() { 60 | return d_snr; 61 | } 62 | -------------------------------------------------------------------------------- /gr-ieee802-11/lib/equalizer/ls.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef INCLUDED_IEEE802_11_EQUALIZER_LS_H 19 | #define INCLUDED_IEEE802_11_EQUALIZER_LS_H 20 | 21 | #include "base.h" 22 | #include 23 | 24 | namespace gr { 25 | namespace ieee802_11 { 26 | namespace equalizer { 27 | 28 | class ls: public base { 29 | public: 30 | virtual void equalize(gr_complex *in, int n, gr_complex *symbols, uint8_t *bits, boost::shared_ptr mod); 31 | virtual double get_snr(); 32 | private: 33 | gr_complex d_H[64]; 34 | double d_snr; 35 | }; 36 | 37 | } /* namespace channel_estimation */ 38 | } /* namespace ieee802_11 */ 39 | } /* namespace gr */ 40 | 41 | #endif /* INCLUDED_IEEE802_11_EQUALIZER_LS_H */ 42 | 43 | -------------------------------------------------------------------------------- /gr-ieee802-11/lib/equalizer/sta.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef INCLUDED_IEEE802_11_EQUALIZER_STA_H 19 | #define INCLUDED_IEEE802_11_EQUALIZER_STA_H 20 | 21 | #include "base.h" 22 | #include 23 | 24 | namespace gr { 25 | namespace ieee802_11 { 26 | namespace equalizer { 27 | 28 | class sta: public base { 29 | public: 30 | virtual void equalize(gr_complex *in, int n, gr_complex *symbols, uint8_t *bits, boost::shared_ptr mod); 31 | double get_snr(); 32 | 33 | private: 34 | gr_complex d_H[64]; 35 | double d_snr; 36 | 37 | const double alpha = 0.5; 38 | const int beta = 2; 39 | }; 40 | 41 | } /* namespace channel_estimation */ 42 | } /* namespace ieee802_11 */ 43 | } /* namespace gr */ 44 | 45 | #endif /* INCLUDED_IEEE802_11_EQUALIZER_STA_H */ 46 | -------------------------------------------------------------------------------- /gr-ieee802-11/lib/ether_encap_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_IEEE802_11_ETHER_ENCAP_IMPL_H 18 | #define INCLUDED_IEEE802_11_ETHER_ENCAP_IMPL_H 19 | 20 | #include 21 | 22 | namespace gr { 23 | namespace ieee802_11 { 24 | 25 | struct ethernet_header { 26 | uint8_t dest[6]; 27 | uint8_t src[6]; 28 | uint16_t type; 29 | }__attribute__((packed)); 30 | 31 | class ether_encap_impl : public ether_encap { 32 | 33 | public: 34 | ether_encap_impl(bool debug); 35 | 36 | private: 37 | void from_tap(pmt::pmt_t msg); 38 | void from_wifi(pmt::pmt_t msg); 39 | 40 | bool d_debug; 41 | uint16_t d_last_seq; 42 | }; 43 | 44 | } // namespace ieee802_11 45 | } // namespace gr 46 | 47 | #endif /* INCLUDED_IEEE802_11_ETHER_ENCAP_IMPL_H */ 48 | 49 | -------------------------------------------------------------------------------- /gr-ieee802-11/lib/moving_average_XX_impl.cc.t: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #include "@NAME_IMPL@.h" 18 | #include 19 | 20 | namespace gr { 21 | namespace ieee802_11 { 22 | 23 | @NAME_IMPL@::@NAME_IMPL@(int length) : 24 | sync_block("@NAME@", 25 | io_signature::make(1, 1, sizeof(@I_TYPE@)), 26 | io_signature::make(1, 1, sizeof(@O_TYPE@))), 27 | d_length(length), 28 | d_new_length(length), 29 | d_updated(false) { 30 | set_history(length); 31 | } 32 | 33 | void 34 | @NAME_IMPL@::set_length(int length) { 35 | d_new_length = length; 36 | d_updated = true; 37 | } 38 | 39 | int 40 | @NAME_IMPL@::work(int noutput_items, gr_vector_const_void_star 41 | &input_items, gr_vector_void_star &output_items) { 42 | 43 | if(d_updated) { 44 | d_length = d_new_length; 45 | set_history(d_length); 46 | d_updated = false; 47 | return 0; // history requirements might have changed 48 | } 49 | 50 | const @I_TYPE@ *in = (const @I_TYPE@ *)input_items[0]; 51 | @O_TYPE@ *out = (@O_TYPE@ *)output_items[0]; 52 | 53 | @I_TYPE@ sum = 0; 54 | for(int i = 0; i < d_length-1; i++) { 55 | sum += in[i]; 56 | } 57 | 58 | for(int i = 0; i < noutput_items; i++) { 59 | sum += in[i + d_length - 1]; 60 | out[i] = sum; 61 | sum -= in[i]; 62 | } 63 | 64 | return noutput_items; 65 | } 66 | 67 | @NAME@::sptr 68 | @NAME@::make(int length) { 69 | return gnuradio::get_initial_sptr(new @NAME_IMPL@(length)); 70 | } 71 | 72 | 73 | } /* namespace blocks */ 74 | } /* namespace gr */ 75 | -------------------------------------------------------------------------------- /gr-ieee802-11/lib/moving_average_XX_impl.h.t: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef @GUARD_NAME_IMPL@ 18 | #define @GUARD_NAME_IMPL@ 19 | 20 | #include 21 | 22 | namespace gr { 23 | namespace ieee802_11 { 24 | 25 | class @NAME_IMPL@ : public @NAME@ 26 | { 27 | private: 28 | int d_length; 29 | int d_new_length; 30 | bool d_updated; 31 | 32 | public: 33 | @NAME_IMPL@(int length); 34 | 35 | int length() const { return d_new_length; } 36 | void set_length(int length); 37 | 38 | int work(int noutput_items, 39 | gr_vector_const_void_star &input_items, 40 | gr_vector_void_star &output_items); 41 | 42 | }; 43 | 44 | } /* namespace blocks */ 45 | } /* namespace gr */ 46 | 47 | #endif /* @GUARD_NAME_IMPL@ */ 48 | -------------------------------------------------------------------------------- /gr-ieee802-11/lib/signal_field_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef INCLUDED_IEEE802_11_SIGNAL_FIELD_IMPL_H 19 | #define INCLUDED_IEEE802_11_SIGNAL_FIELD_IMPL_H 20 | 21 | #include 22 | #include "utils.h" 23 | 24 | namespace gr { 25 | namespace ieee802_11 { 26 | 27 | class signal_field_impl : public signal_field 28 | { 29 | public: 30 | signal_field_impl(); 31 | ~signal_field_impl(); 32 | 33 | bool header_formatter(long packet_len, unsigned char *out, 34 | const std::vector &tags); 35 | 36 | bool header_parser(const unsigned char *header, 37 | std::vector &tags); 38 | private: 39 | int get_bit(int b, int i); 40 | void generate_signal_field(char *out, frame_param &frame, ofdm_param &ofdm); 41 | }; 42 | 43 | } // namespace ieee802_11 44 | } // namespace gr 45 | 46 | #endif /* INCLUDED_IEEE802_11_SIGNAL_FIELD_IMPL_H */ 47 | 48 | -------------------------------------------------------------------------------- /gr-ieee802-11/lib/viterbi_decoder/viterbi_decoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_IEEE802_11_VITERBI_DECODER_H 18 | #define INCLUDED_IEEE802_11_VITERBI_DECODER_H 19 | 20 | #ifdef IEEE80211_MSSE2 21 | #include "viterbi_decoder_x86.h" 22 | #else 23 | #include "viterbi_decoder_generic.h" 24 | #endif 25 | 26 | #endif /* INCLUDED_IEEE802_11_VITERBI_DECODER_H */ 27 | -------------------------------------------------------------------------------- /gr-ieee802-11/lib/viterbi_decoder/viterbi_decoder_x86.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Bastian Bloessl 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | #ifndef INCLUDED_IEEE802_11_VITERBI_DECODER_X86_H 18 | #define INCLUDED_IEEE802_11_VITERBI_DECODER_X86_H 19 | 20 | #include 21 | #include "base.h" 22 | 23 | namespace gr { 24 | namespace ieee802_11 { 25 | 26 | /* This Viterbi decoder was taken from the gr-dvbt module of 27 | * GNU Radio. It is an SSE2 version of the Viterbi Decoder 28 | * created by Phil Karn. The SSE2 version was made by Bogdan 29 | * Diaconescu. For more info see: gr-dvbt/lib/d_viterbi.h 30 | */ 31 | class viterbi_decoder : public base 32 | { 33 | public: 34 | 35 | virtual uint8_t* decode(ofdm_param *ofdm, frame_param *frame, uint8_t *in); 36 | 37 | private: 38 | 39 | union branchtab27 { 40 | unsigned char c[32]; 41 | __m128i v[2]; 42 | } d_branchtab27_sse2[2]; 43 | 44 | __m128i d_metric0[4] __attribute__ ((aligned(16))); 45 | __m128i d_metric1[4] __attribute__ ((aligned(16))); 46 | __m128i d_path0[4] __attribute__ ((aligned(16))); 47 | __m128i d_path1[4] __attribute__ ((aligned(16))); 48 | 49 | virtual void reset(); 50 | 51 | void viterbi_chunks_init_sse2(); 52 | void viterbi_butterfly2_sse2(unsigned char *symbols, 53 | __m128i m0[], __m128i m1[], __m128i p0[], __m128i p1[]); 54 | unsigned char viterbi_get_output_sse2(__m128i *mm0, 55 | __m128i *pp0, int ntraceback, unsigned char *outbuf); 56 | }; 57 | 58 | } // namespace ieee802_11 59 | } // namespace gr 60 | 61 | #endif /* INCLUDED_IEEE802_11_VITERBI_DECODER_X86_H */ 62 | -------------------------------------------------------------------------------- /gr-ieee802-11/python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2013 Bastian Bloessl 3 | # 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | 18 | ######################################################################## 19 | # Include python install macros 20 | ######################################################################## 21 | include(GrPython) 22 | if(NOT PYTHONINTERP_FOUND) 23 | return() 24 | endif() 25 | 26 | ######################################################################## 27 | # Install python sources 28 | ######################################################################## 29 | GR_PYTHON_INSTALL( 30 | FILES 31 | __init__.py 32 | utils.py 33 | DESTINATION ${GR_PYTHON_DIR}/ieee802_11 34 | ) 35 | 36 | ######################################################################## 37 | # Handle the unit tests 38 | ######################################################################## 39 | include(GrTest) 40 | 41 | set(GR_TEST_TARGET_DEPS gnuradio-ieee802-11) 42 | set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/swig) 43 | -------------------------------------------------------------------------------- /gr-ieee802-11/python/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2013 Bastian Bloessl 3 | # 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | 18 | # ---------------------------------------------------------------- 19 | # Temporary workaround for ticket:181 (swig+python problem) 20 | import sys 21 | _RTLD_GLOBAL = 0 22 | try: 23 | from dl import RTLD_GLOBAL as _RTLD_GLOBAL 24 | except ImportError: 25 | try: 26 | from DLFCN import RTLD_GLOBAL as _RTLD_GLOBAL 27 | except ImportError: 28 | pass 29 | 30 | if _RTLD_GLOBAL != 0: 31 | _dlopenflags = sys.getdlopenflags() 32 | sys.setdlopenflags(_dlopenflags|_RTLD_GLOBAL) 33 | # ---------------------------------------------------------------- 34 | 35 | 36 | # import swig generated symbols into the test namespace 37 | from ieee802_11_swig import * 38 | from utils import * 39 | 40 | # import any pure python here 41 | # 42 | 43 | # ---------------------------------------------------------------- 44 | # Tail of workaround 45 | if _RTLD_GLOBAL != 0: 46 | sys.setdlopenflags(_dlopenflags) # Restore original flags 47 | # ---------------------------------------------------------------- 48 | 49 | -------------------------------------------------------------------------------- /gr-ieee802-11/python/build_utils_codes.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2004 Free Software Foundation, Inc. 3 | # 4 | # This file is part of GNU Radio 5 | # 6 | # GNU Radio is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3, or (at your option) 9 | # any later version. 10 | # 11 | # GNU Radio is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with GNU Radio; see the file COPYING. If not, write to 18 | # the Free Software Foundation, Inc., 51 Franklin Street, 19 | # Boston, MA 02110-1301, USA. 20 | # 21 | 22 | def i_code (code3): 23 | return code3[0] 24 | 25 | def o_code (code3): 26 | if len (code3) >= 2: 27 | return code3[1] 28 | else: 29 | return code3[0] 30 | 31 | def tap_code (code3): 32 | if len (code3) >= 3: 33 | return code3[2] 34 | else: 35 | return code3[0] 36 | 37 | def i_type (code3): 38 | return char_to_type[i_code (code3)] 39 | 40 | def o_type (code3): 41 | return char_to_type[o_code (code3)] 42 | 43 | def tap_type (code3): 44 | return char_to_type[tap_code (code3)] 45 | 46 | 47 | char_to_type = {} 48 | char_to_type['s'] = 'short' 49 | char_to_type['i'] = 'int' 50 | char_to_type['f'] = 'float' 51 | char_to_type['c'] = 'gr_complex' 52 | char_to_type['b'] = 'unsigned char' 53 | -------------------------------------------------------------------------------- /gr-ieee802-11/python/utils.py: -------------------------------------------------------------------------------- 1 | 2 | def encoding_to_parameters(encoding): 3 | 4 | encodings = [ 5 | {"bpsc": 1, "cbps": 48, "dbps": 24}, 6 | {"bpsc": 1, "cbps": 48, "dbps": 36}, 7 | {"bpsc": 2, "cbps": 96, "dbps": 48}, 8 | {"bpsc": 2, "cbps": 96, "dbps": 72}, 9 | {"bpsc": 4, "cbps": 192, "dbps": 96}, 10 | {"bpsc": 4, "cbps": 192, "dbps": 144}, 11 | {"bpsc": 6, "cbps": 288, "dbps": 192}, 12 | {"bpsc": 6, "cbps": 288, "dbps": 216} 13 | ] 14 | 15 | enc = encodings[encoding] 16 | 17 | return enc["bpsc"], enc["cbps"], enc["dbps"] 18 | 19 | 20 | def payload_to_symbols(payload, encoding): 21 | 22 | bpsc, cbps, dbps = encoding_to_parameters(encoding) 23 | 24 | # 24 header + 4 crc + payload 25 | data_byte = 24 + 4 + payload 26 | symbols = int(round((16 + data_byte * 8 + 6) / float(dbps) + 0.5)) 27 | 28 | return symbols + 5 29 | 30 | 31 | def mac_payload_to_payload(payload): 32 | return payload - 28 33 | 34 | 35 | def payload_to_mac_payload(payload): 36 | return payload + 28 37 | 38 | 39 | def payload_to_samples(payload, encoding): 40 | return payload_to_symbols(payload, encoding) * 80 + 1 41 | 42 | 43 | def symbols_to_payload(symbols, encoding): 44 | 45 | bpsc, cbps, dbps = encoding_to_parameters(encoding) 46 | 47 | 48 | bytes = (((symbols - 5) * dbps) - 16 - 6) / 8 49 | 50 | assert(bytes > 28) 51 | 52 | return bytes - 24 - 4 53 | -------------------------------------------------------------------------------- /gr-ieee802-11/simulations/awgn/.gitignore: -------------------------------------------------------------------------------- 1 | results/ 2 | sim.py 3 | -------------------------------------------------------------------------------- /gr-ieee802-11/simulations/awgn/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/bash 2 | 3 | MESSAGES=100 4 | 5 | PCAPFILES=$(shell python -c 'import itertools; import numpy as np; print(" ".join(["results/sim_%d_%d_%.1f_.pcap" % x for x in itertools.product(range(10), range(8), np.arange(0, 30,.5))]))') 6 | 7 | all: pdr.pdf 8 | 9 | pdr.pdf: plot.py results/all.csv 10 | python ./plot.py 11 | 12 | sim.py: sim.grc 13 | grcc -d . sim.grc 14 | 15 | results/all.csv: $(PCAPFILES) 16 | ./parse.sh 17 | 18 | %.pcap: sim.py 19 | @echo $@ 20 | mkdir -p results 21 | export GR_CONF_DEFAULT_MAX_MESSAGES=123 22 | $(eval REPETITION=$(shell python -c "print \"$@\".split(\"_\")[1]")) 23 | $(eval ENCODING=$(shell python -c "print \"$@\".split(\"_\")[2]")) 24 | $(eval SNR=$(shell python -c "print \"$@\".split(\"_\")[3]")) 25 | @echo REPETITION=$(REPETITION) 26 | @echo ENCODING=$(ENCODING) 27 | @echo SNR=$(SNR) 28 | ./sim.py --messages=$(MESSAGES) --encoding=$(ENCODING) --snr=$(SNR) --repetition=$(REPETITION) 29 | #gdb -ex run -ex quit --args python ./sim.py --messages=$(MESSAGES) --encoding=$(ENCODING) --snr=$(SNR) --repetition=$(REPETITION) 30 | 31 | -------------------------------------------------------------------------------- /gr-ieee802-11/simulations/awgn/parse.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | files=`ls results/*.pcap` 4 | outfile=results/all.csv 5 | rm -f ${outfile} 6 | 7 | echo "repetition;encoding;snr;received" 8 | echo "repetition;encoding;snr;received" > ${outfile} 9 | 10 | for f in ${files} 11 | do 12 | repetition=`python -c "print \"${f}\".split(\"_\")[1]"` 13 | encoding=`python -c "print \"${f}\".split(\"_\")[2]"` 14 | snr=`python -c "print \"${f}\".split(\"_\")[3]"` 15 | echo "file ${f} repetition ${repetition} encoding ${encoding} snr ${snr}" 16 | rcvd=`tshark -r ${f} | wc -l | tr -d " "` 17 | echo "${repetition};${encoding};${snr};${rcvd}" 18 | echo "${repetition};${encoding};${snr};${rcvd}" >> ${outfile} 19 | done 20 | -------------------------------------------------------------------------------- /gr-ieee802-11/simulations/awgn/pdr.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/dsrc/f4c2a92a0b03d7ef87bb3b6e88d28c44e5c8e678/gr-ieee802-11/simulations/awgn/pdr.pdf -------------------------------------------------------------------------------- /gr-ieee802-11/simulations/awgn/plot.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | import matplotlib as mpl 4 | import matplotlib.pyplot as plt 5 | 6 | pdr = pd.read_csv('./results/all.csv', sep=';') 7 | 8 | pdr['encoding'] = pdr.encoding.astype("category", categories=range(8), ordered=True) 9 | 10 | pdr.encoding.cat.categories = [ 11 | "BPSK 1/2", "BPSK 3/4", 12 | "QPSK 1/2", "QPSK 3/4", 13 | "16-QAM 1/2", "16-QAM 3/4", 14 | "64-QAM 2/3", "64-QAM 3/4"] 15 | 16 | a = pdr.groupby(['encoding', 'snr']) 17 | 18 | b = a.agg({'received': np.mean}).reset_index() 19 | c = b.pivot(index='snr', columns='encoding', values='received') 20 | c.plot() 21 | plt.savefig('pdr.pdf') 22 | 23 | -------------------------------------------------------------------------------- /gr-ieee802-11/simulations/interference/.gitignore: -------------------------------------------------------------------------------- 1 | results/ 2 | -------------------------------------------------------------------------------- /gr-ieee802-11/simulations/interference/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/bash 2 | MESSAGES=100 3 | 4 | PCAPFILES=$(shell python -c 'import itertools; import numpy as np; print(" ".join(["results/sim_%d_%.1f_%s_.pcap" % x for x in itertools.product(range(20), np.arange(0,12,0.5), ["ofdm", "noise"])]))') 5 | 6 | all: pdr.pdf 7 | 8 | pdr.pdf: plot.py results/all.csv 9 | python ./plot.py 10 | 11 | results/all.csv: $(PCAPFILES) 12 | ./parse.sh 13 | 14 | %.pcap: sim.py 15 | mkdir -p results 16 | export GR_CONF_DEFAULT_MAX_MESSAGES=2000 17 | @echo $@ 18 | $(eval REPETITION=$(shell python -c "print \"$@\".split(\"_\")[1]")) 19 | $(eval SNR=$(shell python -c "print \"$@\".split(\"_\")[2]")) 20 | $(eval INTERFERENCE=$(shell python -c "print \"$@\".split(\"_\")[3]")) 21 | @echo REPETITION=$(REPETITION) 22 | @echo SNR=$(SNR) 23 | @echo INTERFERENCE=$(INTERFERENCE) 24 | ./sim.py --repetition=$(REPETITION) --snr=$(SNR) --messages=$(MESSAGES) --interference=$(INTERFERENCE) 25 | 26 | -------------------------------------------------------------------------------- /gr-ieee802-11/simulations/interference/parse.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | files=`ls results/*.pcap` 4 | outfile=results/all.csv 5 | rm -f ${outfile} 6 | 7 | echo "repetition;interference;snr;received" 8 | echo "repetition;interference;snr;received" > ${outfile} 9 | 10 | for f in ${files} 11 | do 12 | repetition=`python -c "print \"${f}\".split(\"_\")[1]"` 13 | snr=`python -c "print \"${f}\".split(\"_\")[2]"` 14 | interference=`python -c "print \"${f}\".split(\"_\")[3]"` 15 | echo "file ${f} repetition ${repetition} interference ${interference} snr ${snr}" 16 | rcvd=`tshark -r ${f} -Y "wlan.sa == 23:23:23:23:23:23" | wc -l | tr -d " "` 17 | echo "${repetition};${interference};${snr};${rcvd}" 18 | echo "${repetition};${interference};${snr};${rcvd}" >> ${outfile} 19 | done 20 | -------------------------------------------------------------------------------- /gr-ieee802-11/simulations/interference/pdr.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/dsrc/f4c2a92a0b03d7ef87bb3b6e88d28c44e5c8e678/gr-ieee802-11/simulations/interference/pdr.pdf -------------------------------------------------------------------------------- /gr-ieee802-11/simulations/interference/plot.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | import matplotlib as mpl 4 | import matplotlib.pyplot as plt 5 | 6 | pdr = pd.read_csv('./results/all.csv', sep=';') 7 | 8 | a = pdr.groupby(['interference', 'snr']) 9 | 10 | b = a.agg({'received': np.mean}).reset_index() 11 | c = b.pivot(index='snr', columns='interference', values='received') 12 | c.plot() 13 | plt.savefig('pdr.pdf') 14 | -------------------------------------------------------------------------------- /gr-ieee802-11/simulations/sensitivity/.gitignore: -------------------------------------------------------------------------------- 1 | results/ 2 | sim.py 3 | -------------------------------------------------------------------------------- /gr-ieee802-11/simulations/sensitivity/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=/bin/bash 2 | MESSAGES=100 3 | ENCODING=0 4 | 5 | PCAPFILES=$(shell python -c 'import itertools; import numpy as np; print(" ".join(["results/sim_%d_%.2f_%.1f_.pcap" % x for x in itertools.product(range(10), np.arange(.4, .7,.02), np.arange(-3, 10, .5))]))') 6 | 7 | all: pdr.pdf 8 | 9 | pdr.pdf: plot.py results/all.csv 10 | python ./plot.py 11 | 12 | sim.py: sim.grc 13 | grcc -d . sim.grc 14 | 15 | results/all.csv: $(PCAPFILES) 16 | ./parse.sh 17 | 18 | %.pcap: sim.py 19 | mkdir -p results 20 | export GR_CONF_DEFAULT_MAX_MESSAGES=123 21 | @echo $@ 22 | $(eval REPETITION=$(shell python -c "print \"$@\".split(\"_\")[1]")) 23 | $(eval SENSITIVITY=$(shell python -c "print \"$@\".split(\"_\")[2]")) 24 | $(eval SNR=$(shell python -c "print \"$@\".split(\"_\")[3]")) 25 | @echo REPETITION=$(REPETITION) 26 | @echo SENSITIVITY=$(SENSITiVITY) 27 | @echo SNR=$(SNR) 28 | ./sim.py --messages=$(MESSAGES) --encoding=$(ENCODING) --sensitivity=$(SENSITIVITY) --snr=$(SNR) --repetition=$(REPETITION) 29 | # gdb -ex run -ex quit --args python ./sim.py --messages=$(MESSAGES) --encoding=$(ENCODING) --sensitivity=$(SENSITIVITY) --snr=$(SNR) --repetition=$(REPETITION) 30 | 31 | -------------------------------------------------------------------------------- /gr-ieee802-11/simulations/sensitivity/parse.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | files=`ls results/*.pcap` 4 | outfile=results/all.csv 5 | rm -f ${outfile} 6 | 7 | echo "repetition;sensitivity;snr;received" 8 | echo "repetition;sensitivity;snr;received" > ${outfile} 9 | 10 | for f in ${files} 11 | do 12 | repetition=`python -c "print \"${f}\".split(\"_\")[1]"` 13 | sensitivity=`python -c "print \"${f}\".split(\"_\")[2]"` 14 | snr=`python -c "print \"${f}\".split(\"_\")[3]"` 15 | echo "file ${f} repetition ${repetition} sensitivity ${sensitivity} snr ${snr}" 16 | rcvd=`tshark -r ${f} | wc -l | tr -d " "` 17 | echo "${repetition};${sensitivity};${snr};${rcvd}" 18 | echo "${repetition};${sensitivity};${snr};${rcvd}" >> ${outfile} 19 | done 20 | -------------------------------------------------------------------------------- /gr-ieee802-11/simulations/sensitivity/pdr.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/dsrc/f4c2a92a0b03d7ef87bb3b6e88d28c44e5c8e678/gr-ieee802-11/simulations/sensitivity/pdr.pdf -------------------------------------------------------------------------------- /gr-ieee802-11/simulations/sensitivity/plot.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | import matplotlib as mpl 4 | import matplotlib.pyplot as plt 5 | 6 | pdr = pd.read_csv('./results/all.csv', sep=';') 7 | 8 | a = pdr.groupby(['sensitivity', 'snr']) 9 | 10 | b = a.agg({'received': np.mean}).reset_index() 11 | c = b.pivot(index='snr', columns='sensitivity', values='received') 12 | c.plot() 13 | plt.savefig('pdr.pdf') 14 | 15 | -------------------------------------------------------------------------------- /gr-ieee802-11/utils/16-qam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/dsrc/f4c2a92a0b03d7ef87bb3b6e88d28c44e5c8e678/gr-ieee802-11/utils/16-qam.png -------------------------------------------------------------------------------- /gr-ieee802-11/utils/64-qam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IBM/dsrc/f4c2a92a0b03d7ef87bb3b6e88d28c44e5c8e678/gr-ieee802-11/utils/64-qam.png -------------------------------------------------------------------------------- /gr-ieee802-11/utils/channels.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | channels = [ 4 | ### 11g 5 | 6 | 1, 2412e6, "11g", 7 | 2, 2417e6, "11g", 8 | 3, 2422e6, "11g", 9 | 4, 2427e6, "11g", 10 | 5, 2432e6, "11g", 11 | 6, 2437e6, "11g", 12 | 7, 2442e6, "11g", 13 | 8, 2447e6, "11g", 14 | 9, 2452e6, "11g", 15 | 10, 2457e6, "11g", 16 | 11, 2462e6, "11g", 17 | 12, 2467e6, "11g", 18 | 13, 2472e6, "11g", 19 | 14, 2484e6, "11g", 20 | 21 | ### 11a 22 | 23 | 34, 5170e6, "11a", 24 | 36, 5180e6, "11a", 25 | 38, 5190e6, "11a", 26 | 40, 5200e6, "11a", 27 | 42, 5210e6, "11a", 28 | 44, 5220e6, "11a", 29 | 46, 5230e6, "11a", 30 | 48, 5240e6, "11a", 31 | 32 | 50, 5250e6, "11a", 33 | 52, 5260e6, "11a", 34 | 54, 5270e6, "11a", 35 | 56, 5280e6, "11a", 36 | 58, 5290e6, "11a", 37 | 60, 5300e6, "11a", 38 | 62, 5310e6, "11a", 39 | 64, 5320e6, "11a", 40 | 41 | 100, 5500e6, "11a", 42 | 102, 5510e6, "11a", 43 | 104, 5520e6, "11a", 44 | 106, 5530e6, "11a", 45 | 108, 5540e6, "11a", 46 | 110, 5550e6, "11a", 47 | 112, 5560e6, "11a", 48 | 114, 5570e6, "11a", 49 | 116, 5580e6, "11a", 50 | 118, 5590e6, "11a", 51 | 120, 5600e6, "11a", 52 | 122, 5610e6, "11a", 53 | 124, 5620e6, "11a", 54 | 126, 5630e6, "11a", 55 | 128, 5640e6, "11a", 56 | 132, 5660e6, "11a", 57 | 134, 5670e6, "11a", 58 | 136, 5680e6, "11a", 59 | 138, 5690e6, "11a", 60 | 140, 5700e6, "11a", 61 | 142, 5710e6, "11a", 62 | 144, 5720e6, "11a", 63 | 64 | 149, 5745e6, "11a (SRD)", 65 | 151, 5755e6, "11a (SRD)", 66 | 153, 5765e6, "11a (SRD)", 67 | 155, 5775e6, "11a (SRD)", 68 | 157, 5785e6, "11a (SRD)", 69 | 159, 5795e6, "11a (SRD)", 70 | 161, 5805e6, "11a (SRD)", 71 | 165, 5825e6, "11a (SRD)", 72 | 73 | 74 | ### 11p 75 | 172, 5860e6, "11p", 76 | 174, 5870e6, "11p", 77 | 176, 5880e6, "11p", 78 | 178, 5890e6, "11p", 79 | 180, 5900e6, "11p", 80 | 182, 5910e6, "11p", 81 | 184, 5920e6, "11p" 82 | ] 83 | 84 | labels = [] 85 | freqs = [] 86 | for i in range(0, len(channels), 3): 87 | labels.append(repr(channels[i]).rjust(3) + " | " + repr(channels[i+1]/1e6) + " | " + channels[i+2]) 88 | freqs.append(channels[i+1]) 89 | 90 | 91 | print labels 92 | print freqs 93 | -------------------------------------------------------------------------------- /gr-ieee802-11/utils/create_long.R: -------------------------------------------------------------------------------- 1 | 2 | fft.shift <- function(sym) { 3 | 4 | sym <- matrix(sym, ncol=64) 5 | 6 | # the explicit dimensions are required 7 | # if sym contains only one row 8 | m1 <- matrix(sym[,33:64], ncol=32) 9 | m2 <- matrix(sym[, 1:32], ncol=32) 10 | 11 | return(cbind(m1, m2)) 12 | } 13 | 14 | ### symbols as defined in the standard 15 | sym <- c(1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 0, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1) 16 | freq <- c(rep(0, 6), sym, rep(0, 5)) 17 | 18 | pre <- fft(fft.shift(freq), inverse=T) / sqrt(52) 19 | pre <- Conj(pre) 20 | pre <- rev(pre) 21 | 22 | 23 | for(i in seq(1, 64, 4)) { 24 | cat("\t\tgr_complex(", sprintf("% .4f", Re(pre[ i])), ", ", sprintf("% .4f", Im(pre[ i])), "), ", sep="") 25 | cat( "gr_complex(", sprintf("% .4f", Re(pre[i+1])), ", ", sprintf("% .4f", Im(pre[i+1])), "), ", sep="") 26 | cat( "gr_complex(", sprintf("% .4f", Re(pre[i+2])), ", ", sprintf("% .4f", Im(pre[i+2])), "), ", sep="") 27 | cat( "gr_complex(", sprintf("% .4f", Re(pre[i+3])), ", ", sprintf("% .4f", Im(pre[i+3])), "),\n", sep="") 28 | } 29 | -------------------------------------------------------------------------------- /gr-ieee802-11/utils/managed.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | IFACE=wlan0 4 | 5 | ### check for command line arguments 6 | if [[ $# -eq 1 ]] 7 | then 8 | IFACE=$1 9 | 10 | elif [[ $# != "0" ]] 11 | then 12 | echo "too much command line arguments!" 13 | exit 14 | fi 15 | 16 | echo "setting interface >>${IFACE}<< to managed mode" 17 | 18 | sudo ifconfig ${IFACE} down 19 | sudo iwconfig ${IFACE} mode managed 20 | sudo ifconfig ${IFACE} up 21 | sudo service network-manager start 22 | -------------------------------------------------------------------------------- /gr-ieee802-11/utils/monitor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | IFACE=wlan0 4 | CHANNEL=3 5 | 6 | ### check for command line arguments 7 | if [[ $# -eq 2 ]] 8 | then 9 | CHANNEL=$1 10 | IFACE=$2 11 | 12 | elif [[ $# -eq 1 ]] 13 | then 14 | CHANNEL=$1 15 | 16 | elif [[ $# != "0" ]] 17 | then 18 | echo "too much command line arguments!" 19 | exit 20 | fi 21 | 22 | 23 | echo "setting interface >>${IFACE}<< to monitor channel >>${CHANNEL}<<" 24 | 25 | sudo service network-manager stop 26 | sudo ifconfig ${IFACE} down 27 | sudo iwconfig ${IFACE} mode monitor 28 | sudo ifconfig ${IFACE} up 29 | sudo iwconfig ${IFACE} channel ${CHANNEL} 30 | -------------------------------------------------------------------------------- /gr-ieee802-11/utils/packetspammer/Makefile: -------------------------------------------------------------------------------- 1 | packetspammer: packetspammer.c 2 | gcc -Wall packetspammer.c -o packetspammer -lpcap 3 | 4 | clean: 5 | rm -f packetspammer 6 | -------------------------------------------------------------------------------- /gr-ieee802-11/utils/pilots.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | 4 | polarity = [ 5 | 1, 1, 1, 1,-1,-1,-1, 1,-1,-1,-1,-1, 1, 1,-1, 1, 6 | -1,-1, 1, 1,-1, 1, 1,-1, 1, 1, 1, 1, 1, 1,-1, 1, 7 | 1, 1,-1, 1, 1,-1,-1, 1, 1, 1,-1, 1,-1,-1,-1, 1, 8 | -1, 1,-1,-1, 1,-1,-1, 1, 1, 1, 1, 1,-1,-1, 1, 1, 9 | -1,-1, 1,-1, 1,-1, 1, 1,-1,-1,-1, 1, 1,-1,-1,-1, 10 | -1, 1,-1,-1, 1,-1, 1, 1, 1, 1,-1, 1,-1, 1,-1, 1, 11 | -1,-1,-1,-1,-1, 1,-1, 1, 1,-1, 1,-1, 1, 1, 1,-1, 12 | -1, 1,-1,-1,-1, 1, 1, 1,-1,-1,-1,-1,-1,-1,-1] 13 | 14 | 15 | print "polarity" 16 | print tuple((x, x, x, -x) for x in polarity) 17 | 18 | 19 | print "pattern" 20 | print tuple((-21, -7, 7, 21) for x in range(127)) 21 | -------------------------------------------------------------------------------- /gr-ieee802-11/utils/power.R: -------------------------------------------------------------------------------- 1 | library(TTR) 2 | library(ggplot2) 3 | 4 | ### test file 5 | in.file <- file('/tmp/ofdm.bin', 'rb') 6 | 7 | sig <- readBin(in.file, double(), n=10000, size=4, endian='little') 8 | 9 | sig <- sig[seq(1, length(sig), 2)] + 1i * sig[seq(2, length(sig), 2)] 10 | 11 | pow <- abs(sig)^2 12 | 13 | plot(SMA(pow, 1600), type='l') 14 | -------------------------------------------------------------------------------- /gr-ieee802-11/utils/sync_words.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | 4 | short = tuple([(52**.5/24**.5) * x for x in [0, 0, 0, 0, 0, 0, 0, 0, 1+1j, 0, 0, 0, -1-1j, 0, 0, 0, 1+1j, 0, 0, 0, -1-1j, 0, 0, 0, -1-1j, 0, 0, 0, 1+1j, 0, 0, 0, 0, 0, 0, 0, -1-1j, 0, 0, 0, -1-1j, 0, 0, 0, 1+1j, 0, 0, 0, 1+1j, 0, 0, 0, 1+1j, 0, 0, 0, 1+1j, 0, 0, 0, 0, 0, 0, 0]]) 5 | 6 | long_norm = tuple([0, 0, 0, 0, 0, 0, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 0, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, -1, 1, 1, 1, 1, 0, 0, 0, 0, 0]) 7 | 8 | 9 | mul = tuple([1, -1j, -1, 1j] * 16) 10 | long_rot = tuple([x * y for x, y in zip(long_norm, mul)]) 11 | 12 | 13 | sync = tuple([short, short, long_rot, long_norm]) 14 | 15 | 16 | assert(len(short) == 64) 17 | assert(len(long_norm) == 64) 18 | assert(len(long_rot) == 64) 19 | assert(len(sync) == 4) 20 | 21 | print "power short: " + str(sum([abs(x)**2 for x in short])) 22 | print "power long: " + str(sum([abs(x)**2 for x in long_norm])) 23 | 24 | print "sync sequence" 25 | print sync 26 | print "len sync: " + str(len(sync)) 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /gr-ros_interface/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | examples/*.py 3 | .cproject 4 | .project 5 | .pydevproject 6 | .settings 7 | *.pyc 8 | **/.DS_Store 9 | .clang_complete 10 | -------------------------------------------------------------------------------- /gr-ros_interface/MANIFEST.md: -------------------------------------------------------------------------------- 1 | title: The ROS_INTERFACE OOT Module 2 | brief: Short description of gr-ros_interface 3 | tags: # Tags are arbitrary, but look at CGRAN what other authors are using 4 | - sdr 5 | author: 6 | - Author Name 7 | copyright_owner: 8 | - Copyright Owner 1 9 | license: 10 | #repo: # Put the URL of the repository here, or leave blank for default 11 | #website: # If you have a separate project website, put it here 12 | #icon: # Put a URL to a square image here that will be used as an icon on CGRAN 13 | --- 14 | A longer, multi-line description of gr-ros_interface. 15 | You may use some *basic* Markdown here. 16 | If left empty, it will try to find a README file instead. 17 | -------------------------------------------------------------------------------- /gr-ros_interface/apps/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | include(GrPython) 21 | 22 | GR_PYTHON_INSTALL( 23 | PROGRAMS 24 | DESTINATION bin 25 | ) 26 | -------------------------------------------------------------------------------- /gr-ros_interface/cmake/Modules/FindCppUnit.cmake: -------------------------------------------------------------------------------- 1 | # http://www.cmake.org/pipermail/cmake/2006-October/011446.html 2 | # Modified to use pkg config and use standard var names 3 | 4 | # 5 | # Find the CppUnit includes and library 6 | # 7 | # This module defines 8 | # CPPUNIT_INCLUDE_DIR, where to find tiff.h, etc. 9 | # CPPUNIT_LIBRARIES, the libraries to link against to use CppUnit. 10 | # CPPUNIT_FOUND, If false, do not try to use CppUnit. 11 | 12 | INCLUDE(FindPkgConfig) 13 | PKG_CHECK_MODULES(PC_CPPUNIT "cppunit") 14 | 15 | FIND_PATH(CPPUNIT_INCLUDE_DIRS 16 | NAMES cppunit/TestCase.h 17 | HINTS ${PC_CPPUNIT_INCLUDE_DIR} 18 | ${CMAKE_INSTALL_PREFIX}/include 19 | PATHS 20 | /usr/local/include 21 | /usr/include 22 | ) 23 | 24 | FIND_LIBRARY(CPPUNIT_LIBRARIES 25 | NAMES cppunit 26 | HINTS ${PC_CPPUNIT_LIBDIR} 27 | ${CMAKE_INSTALL_PREFIX}/lib 28 | ${CMAKE_INSTALL_PREFIX}/lib64 29 | PATHS 30 | ${CPPUNIT_INCLUDE_DIRS}/../lib 31 | /usr/local/lib 32 | /usr/lib 33 | ) 34 | 35 | LIST(APPEND CPPUNIT_LIBRARIES ${CMAKE_DL_LIBS}) 36 | 37 | INCLUDE(FindPackageHandleStandardArgs) 38 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS) 39 | MARK_AS_ADVANCED(CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS) 40 | -------------------------------------------------------------------------------- /gr-ros_interface/cmake/Modules/FindGnuradioRuntime.cmake: -------------------------------------------------------------------------------- 1 | INCLUDE(FindPkgConfig) 2 | PKG_CHECK_MODULES(PC_GNURADIO_RUNTIME gnuradio-runtime) 3 | 4 | if(PC_GNURADIO_RUNTIME_FOUND) 5 | # look for include files 6 | FIND_PATH( 7 | GNURADIO_RUNTIME_INCLUDE_DIRS 8 | NAMES gnuradio/top_block.h 9 | HINTS $ENV{GNURADIO_RUNTIME_DIR}/include 10 | ${PC_GNURADIO_RUNTIME_INCLUDE_DIRS} 11 | ${CMAKE_INSTALL_PREFIX}/include 12 | PATHS /usr/local/include 13 | /usr/include 14 | ) 15 | 16 | # look for libs 17 | FIND_LIBRARY( 18 | GNURADIO_RUNTIME_LIBRARIES 19 | NAMES gnuradio-runtime 20 | HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib 21 | ${PC_GNURADIO_RUNTIME_LIBDIR} 22 | ${CMAKE_INSTALL_PREFIX}/lib/ 23 | ${CMAKE_INSTALL_PREFIX}/lib64/ 24 | PATHS /usr/local/lib 25 | /usr/local/lib64 26 | /usr/lib 27 | /usr/lib64 28 | ) 29 | 30 | set(GNURADIO_RUNTIME_FOUND ${PC_GNURADIO_RUNTIME_FOUND}) 31 | endif(PC_GNURADIO_RUNTIME_FOUND) 32 | 33 | INCLUDE(FindPackageHandleStandardArgs) 34 | # do not check GNURADIO_RUNTIME_INCLUDE_DIRS, is not set when default include path us used. 35 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_RUNTIME DEFAULT_MSG GNURADIO_RUNTIME_LIBRARIES) 36 | MARK_AS_ADVANCED(GNURADIO_RUNTIME_LIBRARIES GNURADIO_RUNTIME_INCLUDE_DIRS) 37 | -------------------------------------------------------------------------------- /gr-ros_interface/cmake/Modules/FindLZ4.cmake: -------------------------------------------------------------------------------- 1 | # Try to find liblz4 2 | # 3 | # Once done, this will define 4 | # 5 | # LZ4_FOUND 6 | # LZ4_INCLUDE_DIR 7 | # LZ4_LIBRARY 8 | # LZ4_VERSION_STRING 9 | # LZ4_VERSION_MAJOR 10 | # LZ4_VERSION_MINOR 11 | # LZ4_VERSION_RELEASE 12 | 13 | find_path(LZ4_INCLUDE_DIR NAMES lz4.h) 14 | 15 | if(LZ4_INCLUDE_DIR AND EXISTS "${LZ4_INCLUDE_DIR}/lz4.h") 16 | foreach(ver "MAJOR" "MINOR" "RELEASE") 17 | file(STRINGS "${LZ4_INCLUDE_DIR}/lz4.h" LZ4_VER_${ver}_LINE 18 | REGEX "^#define[ \t]+LZ4_VERSION_${ver}[ \t]+[0-9]+[ \t]+.*$") 19 | string(REGEX REPLACE "^#define[ \t]+LZ4_VERSION_${ver}[ \t]+([0-9]+)[ \t]+.*$" 20 | "\\1" LZ4_VERSION_${ver} "${LZ4_VER_${ver}_LINE}") 21 | unset(${LZ4_VER_${ver}_LINE}) 22 | endforeach() 23 | set(LZ4_VERSION_STRING 24 | "${LZ4_VERSION_MAJOR}.${LZ4_VERSION_MINOR}.${LZ4_VERSION_RELEASE}") 25 | endif() 26 | 27 | find_library(LZ4_LIBRARY NAMES lz4) 28 | 29 | include(FindPackageHandleStandardArgs) 30 | find_package_handle_standard_args(LZ4 31 | REQUIRED_VARS LZ4_LIBRARY LZ4_INCLUDE_DIR 32 | VERSION_VAR LZ4_VERSION_STRING) 33 | 34 | mark_as_advanced(LZ4_INCLUDE_DIR LZ4_LIBRARY) 35 | 36 | if(LZ4_FOUND AND NOT (TARGET LZ4::LZ4)) 37 | add_library(LZ4::LZ4 UNKNOWN IMPORTED) 38 | set_target_properties(LZ4::LZ4 PROPERTIES 39 | INTERFACE_INCLUDE_DIRECTORIES "${LZ4_INCLUDE_DIR}" 40 | IMPORTED_LINK_INTERFACE_LANGUAGES "C" 41 | IMPORTED_LOCATION "${LZ4_LIBRARY}" 42 | VERSION "${LZ4_VERSION_STRING}") 43 | endif() 44 | -------------------------------------------------------------------------------- /gr-ros_interface/cmake/Modules/GrPlatform.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | if(DEFINED __INCLUDED_GR_PLATFORM_CMAKE) 21 | return() 22 | endif() 23 | set(__INCLUDED_GR_PLATFORM_CMAKE TRUE) 24 | 25 | ######################################################################## 26 | # Setup additional defines for OS types 27 | ######################################################################## 28 | if(CMAKE_SYSTEM_NAME STREQUAL "Linux") 29 | set(LINUX TRUE) 30 | endif() 31 | 32 | if(NOT CMAKE_CROSSCOMPILING AND LINUX AND EXISTS "/etc/debian_version") 33 | set(DEBIAN TRUE) 34 | endif() 35 | 36 | if(NOT CMAKE_CROSSCOMPILING AND LINUX AND EXISTS "/etc/redhat-release") 37 | set(REDHAT TRUE) 38 | endif() 39 | 40 | if(NOT CMAKE_CROSSCOMPILING AND LINUX AND EXISTS "/etc/slackware-version") 41 | set(SLACKWARE TRUE) 42 | endif() 43 | 44 | ######################################################################## 45 | # when the library suffix should be 64 (applies to redhat linux family) 46 | ######################################################################## 47 | if (REDHAT OR SLACKWARE) 48 | set(LIB64_CONVENTION TRUE) 49 | endif() 50 | 51 | if(NOT DEFINED LIB_SUFFIX AND LIB64_CONVENTION AND CMAKE_SYSTEM_PROCESSOR MATCHES "64$") 52 | set(LIB_SUFFIX 64) 53 | endif() 54 | set(LIB_SUFFIX ${LIB_SUFFIX} CACHE STRING "lib directory suffix") 55 | -------------------------------------------------------------------------------- /gr-ros_interface/cmake/Modules/ros_interfaceConfig.cmake: -------------------------------------------------------------------------------- 1 | INCLUDE(FindPkgConfig) 2 | PKG_CHECK_MODULES(PC_ROS_INTERFACE ros_interface) 3 | 4 | FIND_PATH( 5 | ROS_INTERFACE_INCLUDE_DIRS 6 | NAMES ros_interface/api.h 7 | HINTS $ENV{ROS_INTERFACE_DIR}/include 8 | ${PC_ROS_INTERFACE_INCLUDEDIR} 9 | PATHS ${CMAKE_INSTALL_PREFIX}/include 10 | /usr/local/include 11 | /usr/include 12 | ) 13 | 14 | FIND_LIBRARY( 15 | ROS_INTERFACE_LIBRARIES 16 | NAMES gnuradio-ros_interface 17 | HINTS $ENV{ROS_INTERFACE_DIR}/lib 18 | ${PC_ROS_INTERFACE_LIBDIR} 19 | PATHS ${CMAKE_INSTALL_PREFIX}/lib 20 | ${CMAKE_INSTALL_PREFIX}/lib64 21 | /usr/local/lib 22 | /usr/local/lib64 23 | /usr/lib 24 | /usr/lib64 25 | ) 26 | 27 | INCLUDE(FindPackageHandleStandardArgs) 28 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(ROS_INTERFACE DEFAULT_MSG ROS_INTERFACE_LIBRARIES ROS_INTERFACE_INCLUDE_DIRS) 29 | MARK_AS_ADVANCED(ROS_INTERFACE_LIBRARIES ROS_INTERFACE_INCLUDE_DIRS) 30 | 31 | -------------------------------------------------------------------------------- /gr-ros_interface/cmake/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | # http://www.vtk.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F 2 | 3 | IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 4 | MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 5 | ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 6 | 7 | FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 8 | STRING(REGEX REPLACE "\n" ";" files "${files}") 9 | FOREACH(file ${files}) 10 | MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 11 | IF(EXISTS "$ENV{DESTDIR}${file}") 12 | EXEC_PROGRAM( 13 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 14 | OUTPUT_VARIABLE rm_out 15 | RETURN_VALUE rm_retval 16 | ) 17 | IF(NOT "${rm_retval}" STREQUAL 0) 18 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 19 | ENDIF(NOT "${rm_retval}" STREQUAL 0) 20 | ELSEIF(IS_SYMLINK "$ENV{DESTDIR}${file}") 21 | EXEC_PROGRAM( 22 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 23 | OUTPUT_VARIABLE rm_out 24 | RETURN_VALUE rm_retval 25 | ) 26 | IF(NOT "${rm_retval}" STREQUAL 0) 27 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 28 | ENDIF(NOT "${rm_retval}" STREQUAL 0) 29 | ELSE(EXISTS "$ENV{DESTDIR}${file}") 30 | MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 31 | ENDIF(EXISTS "$ENV{DESTDIR}${file}") 32 | ENDFOREACH(file) 33 | -------------------------------------------------------------------------------- /gr-ros_interface/docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | ######################################################################## 21 | # Setup dependencies 22 | ######################################################################## 23 | find_package(Doxygen) 24 | 25 | ######################################################################## 26 | # Begin conditional configuration 27 | ######################################################################## 28 | if(ENABLE_DOXYGEN) 29 | 30 | ######################################################################## 31 | # Add subdirectories 32 | ######################################################################## 33 | add_subdirectory(doxygen) 34 | 35 | endif(ENABLE_DOXYGEN) 36 | -------------------------------------------------------------------------------- /gr-ros_interface/docs/README.ros_interface: -------------------------------------------------------------------------------- 1 | This is the ros_interface-write-a-block package meant as a guide to building 2 | out-of-tree packages. To use the ros_interface blocks, the Python namespaces 3 | is in 'ros_interface', which is imported as: 4 | 5 | import ros_interface 6 | 7 | See the Doxygen documentation for details about the blocks available 8 | in this package. A quick listing of the details can be found in Python 9 | after importing by using: 10 | 11 | help(ros_interface) 12 | -------------------------------------------------------------------------------- /gr-ros_interface/docs/doxygen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | ######################################################################## 21 | # Create the doxygen configuration file 22 | ######################################################################## 23 | file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} top_srcdir) 24 | file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} top_builddir) 25 | file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} abs_top_srcdir) 26 | file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} abs_top_builddir) 27 | 28 | set(HAVE_DOT ${DOXYGEN_DOT_FOUND}) 29 | set(enable_html_docs YES) 30 | set(enable_latex_docs NO) 31 | set(enable_xml_docs YES) 32 | 33 | configure_file( 34 | ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in 35 | ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile 36 | @ONLY) 37 | 38 | set(BUILT_DIRS ${CMAKE_CURRENT_BINARY_DIR}/xml ${CMAKE_CURRENT_BINARY_DIR}/html) 39 | 40 | ######################################################################## 41 | # Make and install doxygen docs 42 | ######################################################################## 43 | add_custom_command( 44 | OUTPUT ${BUILT_DIRS} 45 | COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile 46 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 47 | COMMENT "Generating documentation with doxygen" 48 | ) 49 | 50 | add_custom_target(doxygen_target ALL DEPENDS ${BUILT_DIRS}) 51 | 52 | install(DIRECTORY ${BUILT_DIRS} DESTINATION ${GR_PKG_DOC_DIR}) 53 | -------------------------------------------------------------------------------- /gr-ros_interface/docs/doxygen/doxyxml/generated/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Contains generated files produced by generateDS.py. 3 | 4 | These do the real work of parsing the doxygen xml files but the 5 | resultant classes are not very friendly to navigate so the rest of the 6 | doxyxml module processes them further. 7 | """ 8 | -------------------------------------------------------------------------------- /gr-ros_interface/docs/doxygen/doxyxml/generated/index.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | Generated Mon Feb 9 19:08:05 2009 by generateDS.py. 5 | """ 6 | 7 | from xml.dom import minidom 8 | 9 | import os 10 | import sys 11 | import compound 12 | 13 | import indexsuper as supermod 14 | 15 | class DoxygenTypeSub(supermod.DoxygenType): 16 | def __init__(self, version=None, compound=None): 17 | supermod.DoxygenType.__init__(self, version, compound) 18 | 19 | def find_compounds_and_members(self, details): 20 | """ 21 | Returns a list of all compounds and their members which match details 22 | """ 23 | 24 | results = [] 25 | for compound in self.compound: 26 | members = compound.find_members(details) 27 | if members: 28 | results.append([compound, members]) 29 | else: 30 | if details.match(compound): 31 | results.append([compound, []]) 32 | 33 | return results 34 | 35 | supermod.DoxygenType.subclass = DoxygenTypeSub 36 | # end class DoxygenTypeSub 37 | 38 | 39 | class CompoundTypeSub(supermod.CompoundType): 40 | def __init__(self, kind=None, refid=None, name='', member=None): 41 | supermod.CompoundType.__init__(self, kind, refid, name, member) 42 | 43 | def find_members(self, details): 44 | """ 45 | Returns a list of all members which match details 46 | """ 47 | 48 | results = [] 49 | 50 | for member in self.member: 51 | if details.match(member): 52 | results.append(member) 53 | 54 | return results 55 | 56 | supermod.CompoundType.subclass = CompoundTypeSub 57 | # end class CompoundTypeSub 58 | 59 | 60 | class MemberTypeSub(supermod.MemberType): 61 | 62 | def __init__(self, kind=None, refid=None, name=''): 63 | supermod.MemberType.__init__(self, kind, refid, name) 64 | 65 | supermod.MemberType.subclass = MemberTypeSub 66 | # end class MemberTypeSub 67 | 68 | 69 | def parse(inFilename): 70 | 71 | doc = minidom.parse(inFilename) 72 | rootNode = doc.documentElement 73 | rootObj = supermod.DoxygenType.factory() 74 | rootObj.build(rootNode) 75 | 76 | return rootObj 77 | 78 | -------------------------------------------------------------------------------- /gr-ros_interface/docs/doxygen/doxyxml/text.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2010 Free Software Foundation, Inc. 3 | # 4 | # This file is part of GNU Radio 5 | # 6 | # GNU Radio is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 3, or (at your option) 9 | # any later version. 10 | # 11 | # GNU Radio is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with GNU Radio; see the file COPYING. If not, write to 18 | # the Free Software Foundation, Inc., 51 Franklin Street, 19 | # Boston, MA 02110-1301, USA. 20 | # 21 | """ 22 | Utilities for extracting text from generated classes. 23 | """ 24 | 25 | def is_string(txt): 26 | if isinstance(txt, str): 27 | return True 28 | try: 29 | if isinstance(txt, unicode): 30 | return True 31 | except NameError: 32 | pass 33 | return False 34 | 35 | def description(obj): 36 | if obj is None: 37 | return None 38 | return description_bit(obj).strip() 39 | 40 | def description_bit(obj): 41 | if hasattr(obj, 'content'): 42 | contents = [description_bit(item) for item in obj.content] 43 | result = ''.join(contents) 44 | elif hasattr(obj, 'content_'): 45 | contents = [description_bit(item) for item in obj.content_] 46 | result = ''.join(contents) 47 | elif hasattr(obj, 'value'): 48 | result = description_bit(obj.value) 49 | elif is_string(obj): 50 | return obj 51 | else: 52 | raise StandardError('Expecting a string or something with content, content_ or value attribute') 53 | # If this bit is a paragraph then add one some line breaks. 54 | if hasattr(obj, 'name') and obj.name == 'para': 55 | result += "\n\n" 56 | return result 57 | -------------------------------------------------------------------------------- /gr-ros_interface/docs/doxygen/other/group_defs.dox: -------------------------------------------------------------------------------- 1 | /*! 2 | * \defgroup block GNU Radio ROS_INTERFACE C++ Signal Processing Blocks 3 | * \brief All C++ blocks that can be used from the ROS_INTERFACE GNU Radio 4 | * module are listed here or in the subcategories below. 5 | * 6 | */ 7 | 8 | -------------------------------------------------------------------------------- /gr-ros_interface/docs/doxygen/other/main_page.dox: -------------------------------------------------------------------------------- 1 | /*! \mainpage 2 | 3 | Welcome to the GNU Radio ROS_INTERFACE Block 4 | 5 | This is the intro page for the Doxygen manual generated for the ROS_INTERFACE 6 | block (docs/doxygen/other/main_page.dox). Edit it to add more detailed 7 | documentation about the new GNU Radio modules contained in this 8 | project. 9 | 10 | */ 11 | -------------------------------------------------------------------------------- /gr-ros_interface/examples/README: -------------------------------------------------------------------------------- 1 | It is considered good practice to add examples in here to demonstrate the 2 | functionality of your OOT module. Python scripts, GRC flow graphs or other 3 | code can go here. 4 | 5 | -------------------------------------------------------------------------------- /gr-ros_interface/grc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | install(FILES 21 | ros_interface_ros_interface.xml 22 | ros_interface_message_strobe_custom.xml 23 | ros_interface_rate_debug.xml DESTINATION share/gnuradio/grc/blocks 24 | ) 25 | -------------------------------------------------------------------------------- /gr-ros_interface/grc/ros_interface_message_strobe_custom.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | Message Strobe Custom 9 | ros_interface_message_strobe_custom 10 | ROS Interface 11 | import ros_interface 12 | import pmt 13 | ros_interface.message_strobe_custom($msg, $period, $msg_count) 14 | set_msg($msg) 15 | set_period($period) 16 | set_msg_count($msg_count) 17 | 18 | Message PMT 19 | msg 20 | pmt.intern("TEST") 21 | raw 22 | 23 | 24 | Period (ms) 25 | period 26 | 1000 27 | real 28 | 29 | 30 | Message Count 31 | msg_count 32 | 1000 33 | int 34 | 35 | 36 | set_msg 37 | message 38 | 1 39 | 40 | 41 | strobe 42 | message 43 | 1 44 | 45 | 46 | -------------------------------------------------------------------------------- /gr-ros_interface/grc/ros_interface_rate_debug.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Rate Debug 4 | ros_interface_rate_debug 5 | ROS Interface 6 | import ros_interface 7 | ros_interface.rate_debug() 8 | 9 | 10 | in 11 | message 12 | 13 | 14 | -------------------------------------------------------------------------------- /gr-ros_interface/grc/ros_interface_ros_interface.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ROS Interface 4 | ros_interface_ros_interface 5 | ROS Interface 6 | import ros_interface 7 | ros_interface.ros_interface() 8 | 9 | 10 | pdus 11 | message 12 | 13 | 14 | 15 | pdus 16 | message 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /gr-ros_interface/include/ros_interface/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011,2012 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | ######################################################################## 21 | # Install public header files 22 | ######################################################################## 23 | install(FILES 24 | api.h 25 | ros_interface.h 26 | message_strobe_custom.h 27 | rate_debug.h DESTINATION include/ros_interface 28 | ) 29 | -------------------------------------------------------------------------------- /gr-ros_interface/include/ros_interface/api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * GNU Radio is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 3, or (at your option) 9 | * any later version. 10 | * 11 | * GNU Radio is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with GNU Radio; see the file COPYING. If not, write to 18 | * the Free Software Foundation, Inc., 51 Franklin Street, 19 | * Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #ifndef INCLUDED_ROS_INTERFACE_API_H 23 | #define INCLUDED_ROS_INTERFACE_API_H 24 | 25 | #include 26 | 27 | #ifdef gnuradio_ros_interface_EXPORTS 28 | # define ROS_INTERFACE_API __GR_ATTR_EXPORT 29 | #else 30 | # define ROS_INTERFACE_API __GR_ATTR_IMPORT 31 | #endif 32 | 33 | #endif /* INCLUDED_ROS_INTERFACE_API_H */ 34 | -------------------------------------------------------------------------------- /gr-ros_interface/include/ros_interface/rate_debug.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2019 <+YOU OR YOUR COMPANY+>. 4 | * 5 | * This is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 3, or (at your option) 8 | * any later version. 9 | * 10 | * This software is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this software; see the file COPYING. If not, write to 17 | * the Free Software Foundation, Inc., 51 Franklin Street, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | 22 | #ifndef INCLUDED_ROS_INTERFACE_RATE_DEBUG_H 23 | #define INCLUDED_ROS_INTERFACE_RATE_DEBUG_H 24 | 25 | #include 26 | #include 27 | 28 | namespace gr { 29 | namespace ros_interface { 30 | 31 | /*! 32 | * \brief <+description of block+> 33 | * \ingroup ros_interface 34 | * 35 | */ 36 | class ROS_INTERFACE_API rate_debug : virtual public gr::block 37 | { 38 | public: 39 | typedef boost::shared_ptr sptr; 40 | 41 | /*! 42 | * \brief Return a shared_ptr to a new instance of ros_interface::rate_debug. 43 | * 44 | * To avoid accidental use of raw pointers, ros_interface::rate_debug's 45 | * constructor is in a private implementation 46 | * class. ros_interface::rate_debug::make is the public interface for 47 | * creating new instances. 48 | */ 49 | static sptr make(); 50 | }; 51 | 52 | } // namespace ros_interface 53 | } // namespace gr 54 | 55 | #endif /* INCLUDED_ROS_INTERFACE_RATE_DEBUG_H */ 56 | 57 | -------------------------------------------------------------------------------- /gr-ros_interface/include/ros_interface/ros_interface.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 IBM 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef INCLUDED_ROS_INTERFACE_ROS_INTERFACE_H 19 | #define INCLUDED_ROS_INTERFACE_ROS_INTERFACE_H 20 | 21 | #include 22 | #include 23 | 24 | namespace gr { 25 | namespace ros_interface { 26 | 27 | /*! 28 | * \brief <+description of block+> 29 | * \ingroup ros_interface 30 | * 31 | */ 32 | class ROS_INTERFACE_API ros_interface : virtual public gr::block 33 | { 34 | public: 35 | typedef boost::shared_ptr sptr; 36 | 37 | /*! 38 | * \brief Return a shared_ptr to a new instance of ros_interface::ros_interface. 39 | * 40 | * To avoid accidental use of raw pointers, ros_interface::ros_interface's 41 | * constructor is in a private implementation 42 | * class. ros_interface::ros_interface::make is the public interface for 43 | * creating new instances. 44 | */ 45 | static sptr make(); 46 | }; 47 | 48 | } // namespace ros_interface 49 | } // namespace gr 50 | 51 | #endif /* INCLUDED_ROS_INTERFACE_ROS_INTERFACE_H */ 52 | 53 | -------------------------------------------------------------------------------- /gr-ros_interface/lib/rate_debug_impl.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2019 <+YOU OR YOUR COMPANY+>. 4 | * 5 | * This is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 3, or (at your option) 8 | * any later version. 9 | * 10 | * This software is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this software; see the file COPYING. If not, write to 17 | * the Free Software Foundation, Inc., 51 Franklin Street, 18 | * Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #ifndef INCLUDED_ROS_INTERFACE_RATE_DEBUG_IMPL_H 22 | #define INCLUDED_ROS_INTERFACE_RATE_DEBUG_IMPL_H 23 | 24 | #include 25 | #include // for high_resolution_clock 26 | 27 | namespace gr { 28 | namespace ros_interface { 29 | 30 | class rate_debug_impl : public rate_debug 31 | { 32 | private: 33 | unsigned long int d_rcv_msgs; 34 | unsigned long int d_rcv_bytes; 35 | std::chrono::high_resolution_clock::time_point d_begin; 36 | 37 | public: 38 | rate_debug_impl(); 39 | ~rate_debug_impl(); 40 | void update_rate(pmt::pmt_t msg); 41 | }; 42 | 43 | } // namespace ros_interface 44 | } // namespace gr 45 | 46 | #endif /* INCLUDED_ROS_INTERFACE_RATE_DEBUG_IMPL_H */ 47 | 48 | -------------------------------------------------------------------------------- /gr-ros_interface/lib/ros_interface_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 IBM 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef INCLUDED_ROS_INTERFACE_ROS_INTERFACE_IMPL_H 19 | #define INCLUDED_ROS_INTERFACE_ROS_INTERFACE_IMPL_H 20 | 21 | #include 22 | #include 23 | #include "ros/ros.h" 24 | #include "ERAMsg.h" // TODO: fix this header inclusion 25 | 26 | namespace gr { 27 | namespace ros_interface { 28 | 29 | class ros_interface_impl : public ros_interface 30 | { 31 | private: 32 | unsigned int _sent_msgs; 33 | unsigned int _received_msgs; 34 | ros::NodeHandle _n; 35 | ros::Subscriber _loc_map_sub; 36 | ros::Publisher _rem_map_pub; 37 | ros::AsyncSpinner _spinner; 38 | 39 | public: 40 | ros_interface_impl(); 41 | ~ros_interface_impl(); 42 | 43 | int general_work(int noutput_items, 44 | gr_vector_int &ninput_items, 45 | gr_vector_const_void_star &input_items, 46 | gr_vector_void_star &output_items); 47 | 48 | void handle_ros_topic(const era_gazebo::ERAMsg msg); 49 | void handle_msg(pmt::pmt_t pdu); 50 | }; 51 | 52 | } // namespace ros_interface 53 | } // namespace gr 54 | 55 | #endif /* INCLUDED_ROS_INTERFACE_ROS_INTERFACE_IMPL_H */ 56 | 57 | -------------------------------------------------------------------------------- /gr-ros_interface/python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # GNU Radio is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # GNU Radio is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with GNU Radio; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | 20 | ######################################################################## 21 | # Include python install macros 22 | ######################################################################## 23 | include(GrPython) 24 | if(NOT PYTHONINTERP_FOUND) 25 | return() 26 | endif() 27 | 28 | ######################################################################## 29 | # Install python sources 30 | ######################################################################## 31 | GR_PYTHON_INSTALL( 32 | FILES 33 | __init__.py 34 | DESTINATION ${GR_PYTHON_DIR}/ros_interface 35 | ) 36 | 37 | ######################################################################## 38 | # Handle the unit tests 39 | ######################################################################## 40 | include(GrTest) 41 | 42 | set(GR_TEST_TARGET_DEPS gnuradio-ros_interface) 43 | set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/swig) 44 | -------------------------------------------------------------------------------- /gr-ros_interface/python/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2008,2009 Free Software Foundation, Inc. 3 | # 4 | # This application is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; either version 3, or (at your option) 7 | # any later version. 8 | # 9 | # This application is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, write to the Free Software Foundation, Inc., 16 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | # 18 | 19 | # The presence of this file turns this directory into a Python package 20 | 21 | ''' 22 | This is the GNU Radio ROS_INTERFACE module. Place your Python package 23 | description here (python/__init__.py). 24 | ''' 25 | 26 | # import swig generated symbols into the ros_interface namespace 27 | try: 28 | # this might fail if the module is python-only 29 | from ros_interface_swig import * 30 | except ImportError: 31 | pass 32 | 33 | # import any pure python here 34 | # 35 | -------------------------------------------------------------------------------- /gr-ros_interface/swig/ros_interface_swig.i: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | 3 | #define ROS_INTERFACE_API 4 | 5 | %include "gnuradio.i" // the common stuff 6 | 7 | //load generated python docstrings 8 | %include "ros_interface_swig_doc.i" 9 | 10 | %{ 11 | #include "ros_interface/ros_interface.h" 12 | #include "ros_interface/message_strobe_custom.h" 13 | #include "ros_interface/rate_debug.h" 14 | %} 15 | 16 | 17 | %include "ros_interface/ros_interface.h" 18 | GR_SWIG_BLOCK_MAGIC2(ros_interface, ros_interface); 19 | %include "ros_interface/message_strobe_custom.h" 20 | GR_SWIG_BLOCK_MAGIC2(ros_interface, message_strobe_custom); 21 | %include "ros_interface/rate_debug.h" 22 | GR_SWIG_BLOCK_MAGIC2(ros_interface, rate_debug); 23 | -------------------------------------------------------------------------------- /utils/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | examples/*.py 3 | .cproject 4 | .project 5 | .pydevproject 6 | .settings 7 | *.pyc 8 | **/.DS_Store 9 | .clang_complete 10 | volk_config* 11 | -------------------------------------------------------------------------------- /utils/build_generic_volk_config.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2018 IBM 4 | # 5 | # This is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 3, or (at your option) 8 | # any later version. 9 | # 10 | # This software is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this software; see the file COPYING. If not, write to 17 | # the Free Software Foundation, Inc., 51 Franklin Street, 18 | # Boston, MA 02110-1301, USA. 19 | # 20 | 21 | from __future__ import print_function 22 | import sys 23 | 24 | if (len(sys.argv) - 1) != 2: 25 | print('Usage: ' + sys.argv[0] + ' source_volk_config dest_volk_config') 26 | sys.exit(1) 27 | 28 | f = open(sys.argv[1], "r") 29 | lines = f.readlines() 30 | f.close() 31 | 32 | for i in range(len(lines)): 33 | line = lines[i] 34 | if line.startswith("#"): 35 | continue 36 | fields = line.split(' ') 37 | lines[i] = fields[0] + ' generic generic\n' # I needed to replicate 'generic' twice to make it work. 38 | 39 | f = open(sys.argv[2], "w") 40 | f.write("".join(lines)) 41 | f.close() 42 | --------------------------------------------------------------------------------