├── .gitignore ├── CMakeLists.txt ├── COPYING ├── MANIFEST.md ├── README ├── apps ├── CMakeLists.txt ├── dvbs2_rxip.grc └── dvbs2_txip.grc ├── cmake ├── Modules │ ├── CMakeParseArgumentsCopy.cmake │ ├── FindPcap.cmake │ ├── dvbgseConfig.cmake │ └── targetConfig.cmake.in └── cmake_uninstall.cmake.in ├── docs ├── CMakeLists.txt ├── README.dvbgse └── doxygen │ ├── CMakeLists.txt │ ├── Doxyfile.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 │ ├── pydoc_macros.h │ └── update_pydoc.py ├── examples └── README ├── grc ├── CMakeLists.txt ├── dvbgse_bbheader_sink.block.yml └── dvbgse_bbheader_source.block.yml ├── include └── dvbgse │ ├── CMakeLists.txt │ ├── api.h │ ├── bbheader_sink.h │ ├── bbheader_source.h │ └── dvb_config.h ├── lib ├── CMakeLists.txt ├── bbheader_sink_impl.cc ├── bbheader_sink_impl.h ├── bbheader_source_impl.cc └── bbheader_source_impl.h └── python ├── CMakeLists.txt ├── __init__.py ├── bindings ├── CMakeLists.txt ├── README.md ├── bbheader_sink_python.cc ├── bbheader_source_python.cc ├── bind_oot_file.py ├── docstrings │ ├── README.md │ ├── bbheader_sink_pydoc_template.h │ ├── bbheader_source_pydoc_template.h │ └── dvb_config_pydoc_template.h ├── dvb_config_python.cc ├── header_utils.py └── python_bindings.cc ├── qa_bbheader_sink.py └── qa_bbheader_source.py /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.pyc 3 | *.pyo 4 | build*/ 5 | examples/grc/*.py 6 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011-2020 Free Software Foundation, Inc. 2 | # 3 | # This file was generated by gr_modtool, a tool from the GNU Radio framework 4 | # This file is a part of gr-dvbgse 5 | # 6 | # SPDX-License-Identifier: GPL-3.0-or-later 7 | # 8 | 9 | ######################################################################## 10 | # Project setup 11 | ######################################################################## 12 | cmake_minimum_required(VERSION 3.8) 13 | project(gr-dvbgse CXX C) 14 | enable_testing() 15 | 16 | # Install to PyBOMBS target prefix if defined 17 | if(DEFINED ENV{PYBOMBS_PREFIX}) 18 | set(CMAKE_INSTALL_PREFIX $ENV{PYBOMBS_PREFIX}) 19 | message(STATUS "PyBOMBS installed GNU Radio. Setting CMAKE_INSTALL_PREFIX to $ENV{PYBOMBS_PREFIX}") 20 | endif() 21 | 22 | # Select the release build type by default to get optimization flags 23 | if(NOT CMAKE_BUILD_TYPE) 24 | set(CMAKE_BUILD_TYPE "Release") 25 | message(STATUS "Build type not specified: defaulting to release.") 26 | endif(NOT CMAKE_BUILD_TYPE) 27 | set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") 28 | 29 | # Make sure our local CMake Modules path comes first 30 | list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules) 31 | 32 | # Set the version information here 33 | set(VERSION_MAJOR 1) 34 | set(VERSION_API 0) 35 | set(VERSION_ABI 0) 36 | set(VERSION_PATCH git) 37 | 38 | cmake_policy(SET CMP0011 NEW) 39 | 40 | # Enable generation of compile_commands.json for code completion engines 41 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 42 | 43 | ######################################################################## 44 | # Compiler specific setup 45 | ######################################################################## 46 | if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR 47 | CMAKE_CXX_COMPILER_ID STREQUAL "GNU") 48 | AND NOT WIN32) 49 | #http://gcc.gnu.org/wiki/Visibility 50 | add_definitions(-fvisibility=hidden) 51 | endif() 52 | 53 | IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") 54 | SET(CMAKE_CXX_STANDARD 14) 55 | ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") 56 | SET(CMAKE_CXX_STANDARD 14) 57 | ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") 58 | SET(CMAKE_CXX_STANDARD 14) 59 | ELSE() 60 | message(WARNING "C++ standard could not be set because compiler is not GNU, Clang or MSVC.") 61 | ENDIF() 62 | 63 | IF(CMAKE_C_COMPILER_ID STREQUAL "GNU") 64 | SET(CMAKE_C_STANDARD 11) 65 | ELSEIF(CMAKE_C_COMPILER_ID MATCHES "Clang") 66 | SET(CMAKE_C_STANDARD 11) 67 | ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "MSVC") 68 | SET(CMAKE_C_STANDARD 11) 69 | ELSE() 70 | message(WARNING "C standard could not be set because compiler is not GNU, Clang or MSVC.") 71 | ENDIF() 72 | 73 | ######################################################################## 74 | # Install directories 75 | ######################################################################## 76 | include(FindPkgConfig) 77 | find_package(Gnuradio "3.9" REQUIRED) 78 | include(GrVersion) 79 | 80 | include(GrPlatform) #define LIB_SUFFIX 81 | 82 | if(NOT CMAKE_MODULES_DIR) 83 | set(CMAKE_MODULES_DIR lib${LIB_SUFFIX}/cmake) 84 | endif(NOT CMAKE_MODULES_DIR) 85 | 86 | set(GR_INCLUDE_DIR include/dvbgse) 87 | set(GR_CMAKE_DIR ${CMAKE_MODULES_DIR}/dvbgse) 88 | set(GR_PKG_DATA_DIR ${GR_DATA_DIR}/${CMAKE_PROJECT_NAME}) 89 | set(GR_PKG_DOC_DIR ${GR_DOC_DIR}/${CMAKE_PROJECT_NAME}) 90 | set(GR_PKG_CONF_DIR ${GR_CONF_DIR}/${CMAKE_PROJECT_NAME}/conf.d) 91 | set(GR_PKG_LIBEXEC_DIR ${GR_LIBEXEC_DIR}/${CMAKE_PROJECT_NAME}) 92 | 93 | ######################################################################## 94 | # On Apple only, set install name and use rpath correctly, if not already set 95 | ######################################################################## 96 | if(APPLE) 97 | if(NOT CMAKE_INSTALL_NAME_DIR) 98 | set(CMAKE_INSTALL_NAME_DIR 99 | ${CMAKE_INSTALL_PREFIX}/${GR_LIBRARY_DIR} CACHE 100 | PATH "Library Install Name Destination Directory" FORCE) 101 | endif(NOT CMAKE_INSTALL_NAME_DIR) 102 | if(NOT CMAKE_INSTALL_RPATH) 103 | set(CMAKE_INSTALL_RPATH 104 | ${CMAKE_INSTALL_PREFIX}/${GR_LIBRARY_DIR} CACHE 105 | PATH "Library Install RPath" FORCE) 106 | endif(NOT CMAKE_INSTALL_RPATH) 107 | if(NOT CMAKE_BUILD_WITH_INSTALL_RPATH) 108 | set(CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE 109 | BOOL "Do Build Using Library Install RPath" FORCE) 110 | endif(NOT CMAKE_BUILD_WITH_INSTALL_RPATH) 111 | endif(APPLE) 112 | 113 | ######################################################################## 114 | # Find gnuradio build dependencies 115 | ######################################################################## 116 | find_package(Doxygen) 117 | find_package(Pcap) 118 | 119 | if(NOT PCAP_FOUND) 120 | message(FATAL_ERROR "Pcap required to compile dvbgse") 121 | endif() 122 | 123 | ######################################################################## 124 | # PyBind11 Related 125 | ######################################################################## 126 | 127 | find_package(pybind11 REQUIRED) 128 | execute_process( 129 | COMMAND "${PYTHON_EXECUTABLE}" -c 130 | "try:\n import numpy\n import os\n inc_path = numpy.get_include()\n if os.path.exists(os.path.join(inc_path, 'numpy', 'arrayobject.h')):\n print(inc_path, end='')\nexcept:\n pass" 131 | OUTPUT_VARIABLE PYTHON_NUMPY_INCLUDE_DIR) 132 | # format path in CMake-style for consistency with other path variables 133 | # (a consistent style helps conda builds by using the same path separators) 134 | file(TO_CMAKE_PATH "${PYTHON_NUMPY_INCLUDE_DIR}" PYTHON_NUMPY_INCLUDE_DIR) 135 | 136 | ######################################################################## 137 | # Setup doxygen option 138 | ######################################################################## 139 | if(DOXYGEN_FOUND) 140 | option(ENABLE_DOXYGEN "Build docs using Doxygen" ON) 141 | else(DOXYGEN_FOUND) 142 | option(ENABLE_DOXYGEN "Build docs using Doxygen" OFF) 143 | endif(DOXYGEN_FOUND) 144 | 145 | ######################################################################## 146 | # Create uninstall target 147 | ######################################################################## 148 | configure_file( 149 | ${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in 150 | ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake 151 | @ONLY) 152 | 153 | add_custom_target(uninstall 154 | ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake 155 | ) 156 | 157 | ######################################################################## 158 | # Add subdirectories 159 | ######################################################################## 160 | add_subdirectory(include/dvbgse) 161 | add_subdirectory(lib) 162 | add_subdirectory(apps) 163 | add_subdirectory(docs) 164 | # NOTE: manually update below to use GRC to generate C++ flowgraphs w/o python 165 | if(ENABLE_PYTHON) 166 | message(STATUS "PYTHON and GRC components are enabled") 167 | add_subdirectory(python) 168 | add_subdirectory(grc) 169 | else(ENABLE_PYTHON) 170 | message(STATUS "PYTHON and GRC components are disabled") 171 | endif(ENABLE_PYTHON) 172 | 173 | ######################################################################## 174 | # Install cmake search helper for this library 175 | ######################################################################## 176 | 177 | install(FILES cmake/Modules/dvbgseConfig.cmake 178 | DESTINATION ${CMAKE_MODULES_DIR}/dvbgse 179 | ) 180 | -------------------------------------------------------------------------------- /MANIFEST.md: -------------------------------------------------------------------------------- 1 | title: gr-dvbgse 2 | brief: A block to transfer IP packets over DVB-S2 and DVB-T2 baseband frames. 3 | tags: 4 | - IP over DVB 5 | author: 6 | - Author Ron Economos 7 | copyright_owner: 8 | - Ron Economos 9 | license: GPL version 3 or later. 10 | repo: https://github.com/drmpeg/gr-dvbgse 11 | #website: 12 | #icon: 13 | --- 14 | The goal of this project is to build a GNU Radio block that implements 15 | the ETSI TS 102 606-1 V1.2.1 Generic Stream Encapsulation standard: 16 | 17 | 18 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | # Copyright 2016,2019 Ron Economos 2 | # 3 | # This file is part of gr-dvbgse 4 | # 5 | # gr-dvbgse 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 | # gr-dvbgse 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 gr-dvbgse; 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 | gr-dvbgse 21 | ====== 22 | 23 | Author: Ron Economos 24 | Email: 25 | 26 | The goal of this project is to build GNU Radio blocks that implement 27 | the ETSI TS 102 606-1 V1.2.1 Generic Stream Encapsulation standard: 28 | 29 | http://www.etsi.org/deliver/etsi_ts/102600_102699/10260601/01.02.01_60/ts_10260601v010201p.pdf 30 | 31 | Requirements: 32 | 33 | A DVB-S2 receiver that supports the DVB-GSE protocol. This module was 34 | tested with an Ayecka SR1 DVB-S2 receiver. Note that a special order SR1 35 | is required. The stock SR1 only does MPE protocol. The DVB-S2 receiver 36 | is connected to the DVB-S2 transmitter with a coaxial cable and 40 dB 37 | attenuator for loopback testing. 38 | 39 | http://www.ayecka.com/products-SR1.php 40 | 41 | Usage: 42 | 43 | Because the Pcap library is used to capture raw packets, the capabilities 44 | of the Python interpreter need to be increased. This only needs to be 45 | done once. Note that the specific version of Python 3 on your computer 46 | needs to be specified (for example, python3.8 for Ubuntu 20.04). 47 | 48 | sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/bin/python3.x 49 | 50 | CAUTION: This allows any Python program to open network interfaces. 51 | 52 | The current implementation of the block uses a TAP network interface 53 | named tap0. 54 | 55 | To add a TAP interface (with ip(8) commands): 56 | 57 | sudo ip tuntap add dev tap0 mode tap 58 | 59 | sudo ip link set dev tap0 address 02:00:48:55:4c:4b 60 | 61 | sudo ip addr add 44.0.0.1/24 broadcast 44.0.0.255 dev tap0 62 | 63 | sudo ip link set tap0 up 64 | 65 | sudo ip link set tap0 arp off 66 | 67 | To forward packets received in the tap0 IP address range 68 | to the default network interface (replace eth0 with your 69 | default device name): 70 | 71 | sudo sysctl -w net.ipv4.conf.all.rp_filter=0 72 | 73 | sudo sysctl -w net.ipv4.conf.eth0.rp_filter=0 74 | 75 | Note: This is required for the ping reply test feature 76 | described below: 77 | 78 | To delete the TAP interface: 79 | 80 | sudo ip tuntap del dev tap0 mode tap 81 | 82 | Testing features: 83 | 84 | In order to test this block with just a single transmitter and 85 | receiver, two optional testing modes are available. 86 | 87 | The first is a ping reply feature. In this mode, the block modifies 88 | incoming ping requests into ping replies and swaps the source 89 | and destination IP addresses. This allows a normal ping command 90 | to complete. Ping packets are very useful for testing since the 91 | size and rate can be adjusted. Also, packet latency can be easily 92 | measured. 93 | 94 | The second feature is IP address spoofing for UDP packets. In this 95 | mode the block modifies the source and destination IP address of 96 | UDP packets to selected values. This allows for a loopback test 97 | of video/audio over RTP using VLC. The destination IP address is 98 | set to the host that the VLC RTP decoder is running on. Video is 99 | useful for testing since dropped packets will cause bit-stream 100 | errors (that VLC will report if you start it on the command line). 101 | 102 | Here's what my video loopback flow looks like: 103 | 104 | VLC RTP streaming to 44.0.0.3 -> tap0 interface -> DVB-GSE block -> 105 | GNU Radio DVB-S2 transmitter -> Ettus B210 -> 40 dB attenuator -> 106 | Ayecka SR1 receiver -> eth0 -> VLC RTP decoder from host address. 107 | 108 | Both of the features should be shut off for normal full-duplex 109 | operation. 110 | 111 | Update 03/20/2019: A DVB-GSE sink block has been added for support 112 | of a future DVB-S2 receiver in GNU Radio. The sink block can be 113 | tested with the flow graph dvbs2_rxip.grc in the /apps directory. 114 | This flow graph depends on the DVB-S2 receiver block in gr-dvbs2rx. 115 | 116 | https://github.com/drmpeg/gr-dvbs2rx 117 | 118 | The test flow requires two TAP interfaces to be configured: 119 | 120 | sudo ip tuntap add dev tap0 mode tap 121 | sudo ip link set dev tap0 address 02:00:48:55:4c:55 122 | sudo ip addr add 44.0.0.1/24 broadcast 44.0.0.255 dev tap0 123 | sudo ip link set tap0 up 124 | sudo ip link set tap0 arp off 125 | 126 | sudo ip tuntap add dev tap1 mode tap 127 | sudo ip link set dev tap1 address 02:00:48:55:4c:55 128 | sudo ip addr add 44.0.1.1/24 broadcast 44.0.1.255 dev tap1 129 | sudo ip link set tap1 up 130 | sudo ip link set tap1 arp off 131 | 132 | sudo sysctl -w net.ipv4.conf.all.rp_filter=0 133 | sudo sysctl -w net.ipv4.conf.tap1.rp_filter=0 134 | 135 | Traffic can be generated with ping packets. 136 | 137 | ping 44.0.0.2 138 | 139 | Throughput can be tested with a ping flood. Adjust the size parameter 140 | (-s 3300) to control the rate. The printed dots should be relatively 141 | stable, If the dots increase slowly (or quickly) you're going faster 142 | than the simulated link can handle (and the size parameter should be 143 | reduced). -s 3300 corresponds to a rate of about 4 Mbps. 144 | 145 | sudo ping 44.0.0.2 -f -i 0.001 -c 5000 -s 3300 146 | 147 | Dependencies: 148 | 149 | libpcap-dev 150 | 151 | Build instructions: 152 | 153 | mkdir build 154 | cd build 155 | cmake ../ 156 | make 157 | sudo make install 158 | sudo ldconfig 159 | 160 | Contributions are welcome! 161 | 162 | -------------------------------------------------------------------------------- /apps/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file was generated by gr_modtool, a tool from the GNU Radio framework 4 | # This file is a part of gr-dvbgse 5 | # 6 | # SPDX-License-Identifier: GPL-3.0-or-later 7 | # 8 | 9 | include(GrPython) 10 | 11 | GR_PYTHON_INSTALL( 12 | PROGRAMS 13 | DESTINATION bin 14 | ) 15 | -------------------------------------------------------------------------------- /apps/dvbs2_rxip.grc: -------------------------------------------------------------------------------- 1 | options: 2 | parameters: 3 | author: '' 4 | category: Custom 5 | cmake_opt: '' 6 | comment: '' 7 | copyright: '' 8 | description: '' 9 | gen_cmake: 'On' 10 | gen_linking: dynamic 11 | generate_options: qt_gui 12 | hier_block_src_path: '.:' 13 | id: dvbs2_rxip 14 | max_nouts: '0' 15 | output_language: python 16 | placement: (0,0) 17 | qt_qss_theme: '' 18 | realtime_scheduling: '' 19 | run: 'True' 20 | run_command: '{python} -u {filename}' 21 | run_options: prompt 22 | sizing_mode: fixed 23 | thread_safe_setters: '' 24 | title: '' 25 | window_size: 1280, 1024 26 | states: 27 | bus_sink: false 28 | bus_source: false 29 | bus_structure: null 30 | coordinate: [8, 12] 31 | rotation: 0 32 | state: enabled 33 | 34 | blocks: 35 | - name: noise_power 36 | id: variable_qtgui_range 37 | parameters: 38 | comment: '' 39 | gui_hint: '' 40 | label: '' 41 | min_len: '200' 42 | orient: Qt.Horizontal 43 | rangeType: float 44 | start: '0' 45 | step: '0.005' 46 | stop: '1.2' 47 | value: '0.2' 48 | widget: counter_slider 49 | states: 50 | bus_sink: false 51 | bus_source: false 52 | bus_structure: null 53 | coordinate: [8, 208] 54 | rotation: 0 55 | state: enabled 56 | - name: samp_rate 57 | id: variable 58 | parameters: 59 | comment: '' 60 | value: symbol_rate * 2 61 | states: 62 | bus_sink: false 63 | bus_source: false 64 | bus_structure: null 65 | coordinate: [8, 76] 66 | rotation: 0 67 | state: enabled 68 | - name: symbol_rate 69 | id: variable 70 | parameters: 71 | comment: '' 72 | value: '6000000' 73 | states: 74 | bus_sink: false 75 | bus_source: false 76 | bus_structure: null 77 | coordinate: [8, 140] 78 | rotation: 0 79 | state: enabled 80 | - name: analog_fastnoise_source_x_0 81 | id: analog_fastnoise_source_x 82 | parameters: 83 | affinity: '' 84 | alias: '' 85 | amp: noise_power 86 | comment: '' 87 | maxoutbuf: '0' 88 | minoutbuf: '0' 89 | noise_type: analog.GR_GAUSSIAN 90 | samples: '8192' 91 | seed: '0' 92 | type: complex 93 | states: 94 | bus_sink: false 95 | bus_source: false 96 | bus_structure: null 97 | coordinate: [224, 164.0] 98 | rotation: 0 99 | state: enabled 100 | - name: blocks_add_xx_0 101 | id: blocks_add_xx 102 | parameters: 103 | affinity: '' 104 | alias: '' 105 | comment: '' 106 | maxoutbuf: '0' 107 | minoutbuf: '0' 108 | num_inputs: '2' 109 | type: complex 110 | vlen: '1' 111 | states: 112 | bus_sink: false 113 | bus_source: false 114 | bus_structure: null 115 | coordinate: [528, 256.0] 116 | rotation: 0 117 | state: enabled 118 | - name: blocks_file_sink_0 119 | id: blocks_file_sink 120 | parameters: 121 | affinity: '' 122 | alias: '' 123 | append: 'False' 124 | comment: '' 125 | file: decoded.bin 126 | type: byte 127 | unbuffered: 'False' 128 | vlen: '1' 129 | states: 130 | bus_sink: false 131 | bus_source: false 132 | bus_structure: null 133 | coordinate: [1024, 524.0] 134 | rotation: 0 135 | state: disabled 136 | - name: blocks_pack_k_bits_bb_0 137 | id: blocks_pack_k_bits_bb 138 | parameters: 139 | affinity: '' 140 | alias: '' 141 | comment: '' 142 | k: '8' 143 | maxoutbuf: '0' 144 | minoutbuf: '0' 145 | states: 146 | bus_sink: false 147 | bus_source: false 148 | bus_structure: null 149 | coordinate: [808, 540.0] 150 | rotation: 0 151 | state: disabled 152 | - name: blocks_throttle_0_0 153 | id: blocks_throttle 154 | parameters: 155 | affinity: '' 156 | alias: '' 157 | comment: '' 158 | ignoretag: 'True' 159 | maxoutbuf: '0' 160 | minoutbuf: '0' 161 | samples_per_second: samp_rate 162 | type: complex 163 | vlen: '1' 164 | states: 165 | bus_sink: false 166 | bus_source: false 167 | bus_structure: null 168 | coordinate: [768, 268.0] 169 | rotation: 0 170 | state: enabled 171 | - name: dtv_dvb_bbscrambler_bb_0 172 | id: dtv_dvb_bbscrambler_bb 173 | parameters: 174 | affinity: '' 175 | alias: '' 176 | comment: '' 177 | framesize1: FECFRAME_NORMAL 178 | framesize2: FECFRAME_SHORT 179 | maxoutbuf: '0' 180 | minoutbuf: '0' 181 | rate1: C1_2 182 | rate2: C1_3 183 | rate3: C2_3 184 | rate4: C1_5_MEDIUM 185 | rate5: C1_4 186 | standard: STANDARD_DVBS2 187 | states: 188 | bus_sink: false 189 | bus_source: false 190 | bus_structure: null 191 | coordinate: [528, 44.0] 192 | rotation: 0 193 | state: enabled 194 | - name: dtv_dvb_bch_bb_0 195 | id: dtv_dvb_bch_bb 196 | parameters: 197 | affinity: '' 198 | alias: '' 199 | comment: '' 200 | framesize1: FECFRAME_NORMAL 201 | framesize2: FECFRAME_SHORT 202 | maxoutbuf: '0' 203 | minoutbuf: '0' 204 | rate1: C1_2 205 | rate2: C1_3 206 | rate3: C2_3 207 | rate4: C1_5_MEDIUM 208 | rate5: C1_4 209 | standard: STANDARD_DVBS2 210 | states: 211 | bus_sink: false 212 | bus_source: false 213 | bus_structure: null 214 | coordinate: [776, 44.0] 215 | rotation: 0 216 | state: enabled 217 | - name: dtv_dvb_ldpc_bb_0 218 | id: dtv_dvb_ldpc_bb 219 | parameters: 220 | affinity: '' 221 | alias: '' 222 | comment: '' 223 | constellation: MOD_OTHER 224 | framesize1: FECFRAME_NORMAL 225 | framesize2: FECFRAME_SHORT 226 | maxoutbuf: '0' 227 | minoutbuf: '0' 228 | rate1: C1_2 229 | rate2: C1_3 230 | rate3: C2_3 231 | rate4: C1_5_MEDIUM 232 | rate5: C1_4 233 | standard: STANDARD_DVBS2 234 | states: 235 | bus_sink: false 236 | bus_source: false 237 | bus_structure: null 238 | coordinate: [1064, 36.0] 239 | rotation: 0 240 | state: enabled 241 | - name: dtv_dvbs2_interleaver_bb_0 242 | id: dtv_dvbs2_interleaver_bb 243 | parameters: 244 | affinity: '' 245 | alias: '' 246 | comment: '' 247 | constellation: MOD_8PSK 248 | framesize: FECFRAME_SHORT 249 | maxoutbuf: '0' 250 | minoutbuf: '0' 251 | rate1: C2_3 252 | rate2: C1_5_MEDIUM 253 | rate3: C1_4 254 | states: 255 | bus_sink: false 256 | bus_source: false 257 | bus_structure: null 258 | coordinate: [1064, 132.0] 259 | rotation: 180 260 | state: enabled 261 | - name: dtv_dvbs2_modulator_bc_0 262 | id: dtv_dvbs2_modulator_bc 263 | parameters: 264 | affinity: '' 265 | alias: '' 266 | comment: '' 267 | constellation: MOD_8PSK 268 | framesize: FECFRAME_SHORT 269 | interpolation: INTERPOLATION_OFF 270 | maxoutbuf: '0' 271 | minoutbuf: '0' 272 | rate1: C2_3 273 | rate2: C1_5_MEDIUM 274 | rate3: C1_4 275 | states: 276 | bus_sink: false 277 | bus_source: false 278 | bus_structure: null 279 | coordinate: [224, 308.0] 280 | rotation: 0 281 | state: enabled 282 | - name: dvbgse_bbheader_sink_0 283 | id: dvbgse_bbheader_sink 284 | parameters: 285 | affinity: '' 286 | alias: '' 287 | comment: '' 288 | framesize1: FECFRAME_NORMAL 289 | framesize2: FECFRAME_SHORT 290 | rate1: C1_2 291 | rate2: C1_3 292 | rate3: C2_3 293 | rate4: C1_5_MEDIUM 294 | rate5: C1_4 295 | standard: STANDARD_DVBS2 296 | states: 297 | bus_sink: false 298 | bus_source: false 299 | bus_structure: null 300 | coordinate: [1024, 428.0] 301 | rotation: 0 302 | state: enabled 303 | - name: dvbgse_bbheader_source_0 304 | id: dvbgse_bbheader_source 305 | parameters: 306 | affinity: '' 307 | alias: '' 308 | comment: '' 309 | dst_address: '' 310 | fecblocks: '168' 311 | framesize1: FECFRAME_NORMAL 312 | framesize2: FECFRAME_SHORT 313 | inband: INBAND_OFF 314 | ipaddr_spoof: IPADDR_SPOOF_OFF 315 | maxoutbuf: '0' 316 | minoutbuf: '0' 317 | ping_reply: PING_REPLY_ON 318 | rate1: C1_2 319 | rate2: C1_3 320 | rate3: C2_3 321 | rate4: C1_5_MEDIUM 322 | rate5: C1_4 323 | rolloff: RO_0_20 324 | src_address: '' 325 | standard: STANDARD_DVBS2 326 | tsrate: '4000000' 327 | states: 328 | bus_sink: false 329 | bus_source: false 330 | bus_structure: null 331 | coordinate: [208, 20.0] 332 | rotation: 0 333 | state: enabled 334 | - name: dvbs2rx_bbdescrambler_bb_0 335 | id: dvbs2rx_bbdescrambler_bb 336 | parameters: 337 | affinity: '' 338 | alias: '' 339 | comment: '' 340 | framesize1: FECFRAME_NORMAL 341 | framesize2: FECFRAME_SHORT 342 | maxoutbuf: '0' 343 | minoutbuf: '0' 344 | rate1: C1_2 345 | rate2: C1_3 346 | rate3: C2_3 347 | rate4: C1_5_MEDIUM 348 | rate5: C1_4 349 | standard: STANDARD_DVBS2 350 | states: 351 | bus_sink: false 352 | bus_source: false 353 | bus_structure: null 354 | coordinate: [528, 428.0] 355 | rotation: 0 356 | state: enabled 357 | - name: dvbs2rx_bch_decoder_bb_0 358 | id: dvbs2rx_bch_decoder_bb 359 | parameters: 360 | affinity: '' 361 | alias: '' 362 | comment: '' 363 | framesize1: FECFRAME_NORMAL 364 | framesize2: FECFRAME_SHORT 365 | maxoutbuf: '0' 366 | minoutbuf: '0' 367 | outputmode: OM_MESSAGE 368 | rate1: C1_2 369 | rate2: C1_3 370 | rate3: C2_3 371 | rate4: C1_5_MEDIUM 372 | rate5: C1_4 373 | standard: STANDARD_DVBS2 374 | states: 375 | bus_sink: false 376 | bus_source: false 377 | bus_structure: null 378 | coordinate: [224, 420.0] 379 | rotation: 0 380 | state: enabled 381 | - name: dvbs2rx_ldpc_decoder_cb_0 382 | id: dvbs2rx_ldpc_decoder_cb 383 | parameters: 384 | affinity: '' 385 | alias: '' 386 | comment: '' 387 | constellation1: MOD_QPSK 388 | constellation2: MOD_8PSK 389 | framesize1: FECFRAME_NORMAL 390 | framesize2: FECFRAME_SHORT 391 | infomode: INFO_OFF 392 | maxoutbuf: '0' 393 | minoutbuf: '0' 394 | outputmode: OM_MESSAGE 395 | rate1: C1_2 396 | rate2: C1_3 397 | rate3: C2_3 398 | rate4: C1_5_MEDIUM 399 | rate5: C1_4 400 | standard: STANDARD_DVBS2 401 | states: 402 | bus_sink: false 403 | bus_source: false 404 | bus_structure: null 405 | coordinate: [1048, 228.0] 406 | rotation: 0 407 | state: enabled 408 | - name: qtgui_const_sink_x_0 409 | id: qtgui_const_sink_x 410 | parameters: 411 | affinity: '' 412 | alias: '' 413 | alpha1: '1.0' 414 | alpha10: '1.0' 415 | alpha2: '1.0' 416 | alpha3: '1.0' 417 | alpha4: '1.0' 418 | alpha5: '1.0' 419 | alpha6: '1.0' 420 | alpha7: '1.0' 421 | alpha8: '1.0' 422 | alpha9: '1.0' 423 | autoscale: 'False' 424 | axislabels: 'True' 425 | color1: '"blue"' 426 | color10: '"red"' 427 | color2: '"red"' 428 | color3: '"red"' 429 | color4: '"red"' 430 | color5: '"red"' 431 | color6: '"red"' 432 | color7: '"red"' 433 | color8: '"red"' 434 | color9: '"red"' 435 | comment: '' 436 | grid: 'False' 437 | gui_hint: '' 438 | label1: '' 439 | label10: '' 440 | label2: '' 441 | label3: '' 442 | label4: '' 443 | label5: '' 444 | label6: '' 445 | label7: '' 446 | label8: '' 447 | label9: '' 448 | legend: 'True' 449 | marker1: '0' 450 | marker10: '0' 451 | marker2: '0' 452 | marker3: '0' 453 | marker4: '0' 454 | marker5: '0' 455 | marker6: '0' 456 | marker7: '0' 457 | marker8: '0' 458 | marker9: '0' 459 | name: '""' 460 | nconnections: '1' 461 | size: '1024' 462 | style1: '0' 463 | style10: '0' 464 | style2: '0' 465 | style3: '0' 466 | style4: '0' 467 | style5: '0' 468 | style6: '0' 469 | style7: '0' 470 | style8: '0' 471 | style9: '0' 472 | tr_chan: '0' 473 | tr_level: '0.0' 474 | tr_mode: qtgui.TRIG_MODE_FREE 475 | tr_slope: qtgui.TRIG_SLOPE_POS 476 | tr_tag: '""' 477 | type: complex 478 | update_time: '0.10' 479 | width1: '1' 480 | width10: '1' 481 | width2: '1' 482 | width3: '1' 483 | width4: '1' 484 | width5: '1' 485 | width6: '1' 486 | width7: '1' 487 | width8: '1' 488 | width9: '1' 489 | xmax: '2' 490 | xmin: '-2' 491 | ymax: '2' 492 | ymin: '-2' 493 | states: 494 | bus_sink: false 495 | bus_source: false 496 | bus_structure: null 497 | coordinate: [664, 172.0] 498 | rotation: 0 499 | state: enabled 500 | - name: virtual_sink_0 501 | id: virtual_sink 502 | parameters: 503 | alias: '' 504 | comment: '' 505 | stream_id: int-mod 506 | states: 507 | bus_sink: false 508 | bus_source: false 509 | bus_structure: null 510 | coordinate: [872, 148.0] 511 | rotation: 180 512 | state: true 513 | - name: virtual_sink_1 514 | id: virtual_sink 515 | parameters: 516 | alias: '' 517 | comment: '' 518 | stream_id: '' 519 | states: 520 | bus_sink: false 521 | bus_source: false 522 | bus_structure: null 523 | coordinate: [1112, 356.0] 524 | rotation: 180 525 | state: true 526 | - name: virtual_source_0 527 | id: virtual_source 528 | parameters: 529 | alias: '' 530 | comment: '' 531 | stream_id: int-mod 532 | states: 533 | bus_sink: false 534 | bus_source: false 535 | bus_structure: null 536 | coordinate: [224, 260.0] 537 | rotation: 180 538 | state: true 539 | - name: virtual_source_1 540 | id: virtual_source 541 | parameters: 542 | alias: '' 543 | comment: '' 544 | stream_id: '' 545 | states: 546 | bus_sink: false 547 | bus_source: false 548 | bus_structure: null 549 | coordinate: [32, 444.0] 550 | rotation: 0 551 | state: true 552 | 553 | connections: 554 | - [analog_fastnoise_source_x_0, '0', blocks_add_xx_0, '0'] 555 | - [blocks_add_xx_0, '0', blocks_throttle_0_0, '0'] 556 | - [blocks_add_xx_0, '0', qtgui_const_sink_x_0, '0'] 557 | - [blocks_pack_k_bits_bb_0, '0', blocks_file_sink_0, '0'] 558 | - [blocks_throttle_0_0, '0', dvbs2rx_ldpc_decoder_cb_0, '0'] 559 | - [dtv_dvb_bbscrambler_bb_0, '0', dtv_dvb_bch_bb_0, '0'] 560 | - [dtv_dvb_bch_bb_0, '0', dtv_dvb_ldpc_bb_0, '0'] 561 | - [dtv_dvb_ldpc_bb_0, '0', dtv_dvbs2_interleaver_bb_0, '0'] 562 | - [dtv_dvbs2_interleaver_bb_0, '0', virtual_sink_0, '0'] 563 | - [dtv_dvbs2_modulator_bc_0, '0', blocks_add_xx_0, '1'] 564 | - [dvbgse_bbheader_source_0, '0', dtv_dvb_bbscrambler_bb_0, '0'] 565 | - [dvbs2rx_bbdescrambler_bb_0, '0', blocks_pack_k_bits_bb_0, '0'] 566 | - [dvbs2rx_bbdescrambler_bb_0, '0', dvbgse_bbheader_sink_0, '0'] 567 | - [dvbs2rx_bch_decoder_bb_0, '0', dvbs2rx_bbdescrambler_bb_0, '0'] 568 | - [dvbs2rx_ldpc_decoder_cb_0, '0', virtual_sink_1, '0'] 569 | - [virtual_source_0, '0', dtv_dvbs2_modulator_bc_0, '0'] 570 | - [virtual_source_1, '0', dvbs2rx_bch_decoder_bb_0, '0'] 571 | 572 | metadata: 573 | file_format: 1 574 | -------------------------------------------------------------------------------- /apps/dvbs2_txip.grc: -------------------------------------------------------------------------------- 1 | options: 2 | parameters: 3 | author: '' 4 | catch_exceptions: 'True' 5 | category: Custom 6 | cmake_opt: '' 7 | comment: '' 8 | copyright: '' 9 | description: '' 10 | gen_cmake: 'On' 11 | gen_linking: dynamic 12 | generate_options: qt_gui 13 | hier_block_src_path: '.:' 14 | id: dvbs2_tx 15 | max_nouts: '0' 16 | output_language: python 17 | placement: (0,0) 18 | qt_qss_theme: '' 19 | realtime_scheduling: '' 20 | run: 'True' 21 | run_command: '{python} -u {filename}' 22 | run_options: prompt 23 | sizing_mode: fixed 24 | thread_safe_setters: '' 25 | title: '' 26 | window_size: 1280, 1024 27 | states: 28 | bus_sink: false 29 | bus_source: false 30 | bus_structure: null 31 | coordinate: [8, 11] 32 | rotation: 0 33 | state: enabled 34 | 35 | blocks: 36 | - name: center_freq 37 | id: variable 38 | parameters: 39 | comment: '' 40 | value: 1280e6 41 | states: 42 | bus_sink: false 43 | bus_source: false 44 | bus_structure: null 45 | coordinate: [8, 203] 46 | rotation: 0 47 | state: enabled 48 | - name: rolloff 49 | id: variable 50 | parameters: 51 | comment: '' 52 | value: '0.2' 53 | states: 54 | bus_sink: false 55 | bus_source: false 56 | bus_structure: null 57 | coordinate: [8, 267] 58 | rotation: 0 59 | state: enabled 60 | - name: samp_rate 61 | id: variable 62 | parameters: 63 | comment: '' 64 | value: symbol_rate * 2 65 | states: 66 | bus_sink: false 67 | bus_source: false 68 | bus_structure: null 69 | coordinate: [8, 75] 70 | rotation: 0 71 | state: enabled 72 | - name: symbol_rate 73 | id: variable 74 | parameters: 75 | comment: '' 76 | value: '6000000' 77 | states: 78 | bus_sink: false 79 | bus_source: false 80 | bus_structure: null 81 | coordinate: [8, 139] 82 | rotation: 0 83 | state: enabled 84 | - name: taps 85 | id: variable 86 | parameters: 87 | comment: '' 88 | value: '200' 89 | states: 90 | bus_sink: false 91 | bus_source: false 92 | bus_structure: null 93 | coordinate: [8, 331] 94 | rotation: 0 95 | state: enabled 96 | - name: tx_gain 97 | id: variable_qtgui_range 98 | parameters: 99 | comment: '' 100 | gui_hint: '' 101 | label: '' 102 | min_len: '200' 103 | orient: QtCore.Qt.Horizontal 104 | rangeType: float 105 | start: '0' 106 | step: '1' 107 | stop: '89' 108 | value: '40' 109 | widget: counter_slider 110 | states: 111 | bus_sink: false 112 | bus_source: false 113 | bus_structure: null 114 | coordinate: [240, 480] 115 | rotation: 0 116 | state: enabled 117 | - name: vga1_gain 118 | id: variable_qtgui_range 119 | parameters: 120 | comment: '' 121 | gui_hint: '' 122 | label: '' 123 | min_len: '200' 124 | orient: QtCore.Qt.Horizontal 125 | rangeType: int 126 | start: '-35' 127 | step: '1' 128 | stop: '-4' 129 | value: '-8' 130 | widget: counter_slider 131 | states: 132 | bus_sink: false 133 | bus_source: false 134 | bus_structure: null 135 | coordinate: [8, 480] 136 | rotation: 0 137 | state: enabled 138 | - name: vga2_gain 139 | id: variable_qtgui_range 140 | parameters: 141 | comment: '' 142 | gui_hint: '' 143 | label: '' 144 | min_len: '200' 145 | orient: QtCore.Qt.Horizontal 146 | rangeType: int 147 | start: '0' 148 | step: '1' 149 | stop: '25' 150 | value: '10' 151 | widget: counter_slider 152 | states: 153 | bus_sink: false 154 | bus_source: false 155 | bus_structure: null 156 | coordinate: [120, 480] 157 | rotation: 0 158 | state: enabled 159 | - name: dtv_dvb_bbscrambler_bb_0 160 | id: dtv_dvb_bbscrambler_bb 161 | parameters: 162 | affinity: '' 163 | alias: '' 164 | comment: '' 165 | framesize1: FECFRAME_NORMAL 166 | framesize2: FECFRAME_SHORT 167 | maxoutbuf: '0' 168 | minoutbuf: '0' 169 | rate1: C1_2 170 | rate2: C1_3 171 | rate3: C5_6 172 | rate4: C1_5_MEDIUM 173 | rate5: C5_6 174 | standard: STANDARD_DVBS2 175 | states: 176 | bus_sink: false 177 | bus_source: false 178 | bus_structure: null 179 | coordinate: [504, 52.0] 180 | rotation: 0 181 | state: enabled 182 | - name: dtv_dvb_bch_bb_0 183 | id: dtv_dvb_bch_bb 184 | parameters: 185 | affinity: '' 186 | alias: '' 187 | comment: '' 188 | framesize1: FECFRAME_NORMAL 189 | framesize2: FECFRAME_SHORT 190 | maxoutbuf: '0' 191 | minoutbuf: '0' 192 | rate1: C1_2 193 | rate2: C1_3 194 | rate3: C5_6 195 | rate4: C1_5_MEDIUM 196 | rate5: C5_6 197 | standard: STANDARD_DVBS2 198 | states: 199 | bus_sink: false 200 | bus_source: false 201 | bus_structure: null 202 | coordinate: [784, 52.0] 203 | rotation: 0 204 | state: enabled 205 | - name: dtv_dvb_ldpc_bb_0 206 | id: dtv_dvb_ldpc_bb 207 | parameters: 208 | affinity: '' 209 | alias: '' 210 | comment: '' 211 | constellation: MOD_OTHER 212 | framesize1: FECFRAME_NORMAL 213 | framesize2: FECFRAME_SHORT 214 | maxoutbuf: '0' 215 | minoutbuf: '0' 216 | rate1: C1_2 217 | rate2: C1_3 218 | rate3: C5_6 219 | rate4: C1_5_MEDIUM 220 | rate5: C5_6 221 | standard: STANDARD_DVBS2 222 | states: 223 | bus_sink: false 224 | bus_source: false 225 | bus_structure: null 226 | coordinate: [1040, 44.0] 227 | rotation: 0 228 | state: enabled 229 | - name: dtv_dvbs2_interleaver_bb_0 230 | id: dtv_dvbs2_interleaver_bb 231 | parameters: 232 | affinity: '' 233 | alias: '' 234 | comment: '' 235 | constellation: MOD_8PSK 236 | framesize: FECFRAME_SHORT 237 | maxoutbuf: '0' 238 | minoutbuf: '0' 239 | rate1: C5_6 240 | rate2: C1_5_MEDIUM 241 | rate3: C5_6 242 | states: 243 | bus_sink: false 244 | bus_source: false 245 | bus_structure: null 246 | coordinate: [208, 220.0] 247 | rotation: 0 248 | state: enabled 249 | - name: dtv_dvbs2_modulator_bc_0 250 | id: dtv_dvbs2_modulator_bc 251 | parameters: 252 | affinity: '' 253 | alias: '' 254 | comment: '' 255 | constellation: MOD_8PSK 256 | framesize: FECFRAME_SHORT 257 | interpolation: INTERPOLATION_OFF 258 | maxoutbuf: '0' 259 | minoutbuf: '0' 260 | rate1: C5_6 261 | rate2: C1_5_MEDIUM 262 | rate3: C5_6 263 | states: 264 | bus_sink: false 265 | bus_source: false 266 | bus_structure: null 267 | coordinate: [512, 212.0] 268 | rotation: 0 269 | state: enabled 270 | - name: dtv_dvbs2_physical_cc_0 271 | id: dtv_dvbs2_physical_cc 272 | parameters: 273 | affinity: '' 274 | alias: '' 275 | comment: '' 276 | constellation: MOD_8PSK 277 | framesize: FECFRAME_SHORT 278 | goldcode: '0' 279 | maxoutbuf: '0' 280 | minoutbuf: '0' 281 | pilots: PILOTS_ON 282 | rate1: C5_6 283 | rate2: C1_5_MEDIUM 284 | rate3: C5_6 285 | states: 286 | bus_sink: false 287 | bus_source: false 288 | bus_structure: null 289 | coordinate: [792, 204.0] 290 | rotation: 0 291 | state: enabled 292 | - name: dvbgse_bbheader_source_0 293 | id: dvbgse_bbheader_source 294 | parameters: 295 | affinity: '' 296 | alias: '' 297 | comment: '' 298 | dst_address: 10.0.1.190 299 | fecblocks: '168' 300 | framesize1: FECFRAME_NORMAL 301 | framesize2: FECFRAME_SHORT 302 | gse_padding: PADDING_PACKET_LENGTH_0 303 | inband: INBAND_OFF 304 | ipaddr_spoof: IPADDR_SPOOF_OFF 305 | maxoutbuf: '0' 306 | minoutbuf: '0' 307 | ping_reply: PING_REPLY_ON 308 | rate1: C1_2 309 | rate2: C1_3 310 | rate3: C5_6 311 | rate4: C1_5_MEDIUM 312 | rate5: C5_6 313 | rolloff: RO_0_20 314 | src_address: 44.0.0.3 315 | standard: STANDARD_DVBS2 316 | tsrate: '4000000' 317 | states: 318 | bus_sink: false 319 | bus_source: false 320 | bus_structure: null 321 | coordinate: [208, 20.0] 322 | rotation: 0 323 | state: enabled 324 | - name: fft_filter_xxx_0 325 | id: fft_filter_xxx 326 | parameters: 327 | affinity: '' 328 | alias: '' 329 | comment: '' 330 | decim: '1' 331 | maxoutbuf: '0' 332 | minoutbuf: '0' 333 | nthreads: '1' 334 | samp_delay: '0' 335 | taps: firdes.root_raised_cosine(1.0, samp_rate, samp_rate/2, rolloff, taps) 336 | type: ccc 337 | states: 338 | bus_sink: false 339 | bus_source: false 340 | bus_structure: null 341 | coordinate: [640, 380.0] 342 | rotation: 0 343 | state: enabled 344 | - name: qtgui_freq_sink_x_0 345 | id: qtgui_freq_sink_x 346 | parameters: 347 | affinity: '' 348 | alias: '' 349 | alpha1: '1.0' 350 | alpha10: '1.0' 351 | alpha2: '1.0' 352 | alpha3: '1.0' 353 | alpha4: '1.0' 354 | alpha5: '1.0' 355 | alpha6: '1.0' 356 | alpha7: '1.0' 357 | alpha8: '1.0' 358 | alpha9: '1.0' 359 | autoscale: 'False' 360 | average: '0.2' 361 | axislabels: 'True' 362 | bw: samp_rate 363 | color1: '"blue"' 364 | color10: '"dark blue"' 365 | color2: '"red"' 366 | color3: '"green"' 367 | color4: '"black"' 368 | color5: '"cyan"' 369 | color6: '"magenta"' 370 | color7: '"yellow"' 371 | color8: '"dark red"' 372 | color9: '"dark green"' 373 | comment: '' 374 | ctrlpanel: 'False' 375 | fc: center_freq 376 | fftsize: '1024' 377 | freqhalf: 'True' 378 | grid: 'True' 379 | gui_hint: '' 380 | label: Relative Gain 381 | label1: '' 382 | label10: '' 383 | label2: '' 384 | label3: '' 385 | label4: '' 386 | label5: '' 387 | label6: '' 388 | label7: '' 389 | label8: '' 390 | label9: '' 391 | legend: 'True' 392 | maxoutbuf: '0' 393 | minoutbuf: '0' 394 | name: '""' 395 | nconnections: '1' 396 | norm_window: 'False' 397 | showports: 'True' 398 | tr_chan: '0' 399 | tr_level: '0.0' 400 | tr_mode: qtgui.TRIG_MODE_FREE 401 | tr_tag: '""' 402 | type: complex 403 | units: dB 404 | update_time: '0.10' 405 | width1: '1' 406 | width10: '1' 407 | width2: '1' 408 | width3: '1' 409 | width4: '1' 410 | width5: '1' 411 | width6: '1' 412 | width7: '1' 413 | width8: '1' 414 | width9: '1' 415 | wintype: window.WIN_BLACKMAN_hARRIS 416 | ymax: '10' 417 | ymin: '-140' 418 | states: 419 | bus_sink: false 420 | bus_source: false 421 | bus_structure: null 422 | coordinate: [1048, 320.0] 423 | rotation: 0 424 | state: enabled 425 | - name: uhd_usrp_sink_0_0 426 | id: uhd_usrp_sink 427 | parameters: 428 | affinity: '' 429 | alias: '' 430 | ant0: '' 431 | ant1: '' 432 | ant10: '' 433 | ant11: '' 434 | ant12: '' 435 | ant13: '' 436 | ant14: '' 437 | ant15: '' 438 | ant16: '' 439 | ant17: '' 440 | ant18: '' 441 | ant19: '' 442 | ant2: '' 443 | ant20: '' 444 | ant21: '' 445 | ant22: '' 446 | ant23: '' 447 | ant24: '' 448 | ant25: '' 449 | ant26: '' 450 | ant27: '' 451 | ant28: '' 452 | ant29: '' 453 | ant3: '' 454 | ant30: '' 455 | ant31: '' 456 | ant4: '' 457 | ant5: '' 458 | ant6: '' 459 | ant7: '' 460 | ant8: '' 461 | ant9: '' 462 | bw0: '0' 463 | bw1: '0' 464 | bw10: '0' 465 | bw11: '0' 466 | bw12: '0' 467 | bw13: '0' 468 | bw14: '0' 469 | bw15: '0' 470 | bw16: '0' 471 | bw17: '0' 472 | bw18: '0' 473 | bw19: '0' 474 | bw2: '0' 475 | bw20: '0' 476 | bw21: '0' 477 | bw22: '0' 478 | bw23: '0' 479 | bw24: '0' 480 | bw25: '0' 481 | bw26: '0' 482 | bw27: '0' 483 | bw28: '0' 484 | bw29: '0' 485 | bw3: '0' 486 | bw30: '0' 487 | bw31: '0' 488 | bw4: '0' 489 | bw5: '0' 490 | bw6: '0' 491 | bw7: '0' 492 | bw8: '0' 493 | bw9: '0' 494 | center_freq0: uhd.tune_request(center_freq, ((symbol_rate * (1 + rolloff)) / 2 495 | ) + 1e5) 496 | center_freq1: '0' 497 | center_freq10: '0' 498 | center_freq11: '0' 499 | center_freq12: '0' 500 | center_freq13: '0' 501 | center_freq14: '0' 502 | center_freq15: '0' 503 | center_freq16: '0' 504 | center_freq17: '0' 505 | center_freq18: '0' 506 | center_freq19: '0' 507 | center_freq2: '0' 508 | center_freq20: '0' 509 | center_freq21: '0' 510 | center_freq22: '0' 511 | center_freq23: '0' 512 | center_freq24: '0' 513 | center_freq25: '0' 514 | center_freq26: '0' 515 | center_freq27: '0' 516 | center_freq28: '0' 517 | center_freq29: '0' 518 | center_freq3: '0' 519 | center_freq30: '0' 520 | center_freq31: '0' 521 | center_freq4: '0' 522 | center_freq5: '0' 523 | center_freq6: '0' 524 | center_freq7: '0' 525 | center_freq8: '0' 526 | center_freq9: '0' 527 | clock_rate: '0.0' 528 | clock_source0: '' 529 | clock_source1: '' 530 | clock_source2: '' 531 | clock_source3: '' 532 | clock_source4: '' 533 | clock_source5: '' 534 | clock_source6: '' 535 | clock_source7: '' 536 | comment: '' 537 | dev_addr: '"send_frame_size=8192,num_send_frames=128,master_clock_rate=" + str(samp_rate*2)' 538 | dev_args: '""' 539 | gain0: tx_gain 540 | gain1: '0' 541 | gain10: '0' 542 | gain11: '0' 543 | gain12: '0' 544 | gain13: '0' 545 | gain14: '0' 546 | gain15: '0' 547 | gain16: '0' 548 | gain17: '0' 549 | gain18: '0' 550 | gain19: '0' 551 | gain2: '0' 552 | gain20: '0' 553 | gain21: '0' 554 | gain22: '0' 555 | gain23: '0' 556 | gain24: '0' 557 | gain25: '0' 558 | gain26: '0' 559 | gain27: '0' 560 | gain28: '0' 561 | gain29: '0' 562 | gain3: '0' 563 | gain30: '0' 564 | gain31: '0' 565 | gain4: '0' 566 | gain5: '0' 567 | gain6: '0' 568 | gain7: '0' 569 | gain8: '0' 570 | gain9: '0' 571 | gain_type0: default 572 | gain_type1: default 573 | gain_type10: default 574 | gain_type11: default 575 | gain_type12: default 576 | gain_type13: default 577 | gain_type14: default 578 | gain_type15: default 579 | gain_type16: default 580 | gain_type17: default 581 | gain_type18: default 582 | gain_type19: default 583 | gain_type2: default 584 | gain_type20: default 585 | gain_type21: default 586 | gain_type22: default 587 | gain_type23: default 588 | gain_type24: default 589 | gain_type25: default 590 | gain_type26: default 591 | gain_type27: default 592 | gain_type28: default 593 | gain_type29: default 594 | gain_type3: default 595 | gain_type30: default 596 | gain_type31: default 597 | gain_type4: default 598 | gain_type5: default 599 | gain_type6: default 600 | gain_type7: default 601 | gain_type8: default 602 | gain_type9: default 603 | len_tag_name: '' 604 | lo_export0: 'False' 605 | lo_export1: 'False' 606 | lo_export10: 'False' 607 | lo_export11: 'False' 608 | lo_export12: 'False' 609 | lo_export13: 'False' 610 | lo_export14: 'False' 611 | lo_export15: 'False' 612 | lo_export16: 'False' 613 | lo_export17: 'False' 614 | lo_export18: 'False' 615 | lo_export19: 'False' 616 | lo_export2: 'False' 617 | lo_export20: 'False' 618 | lo_export21: 'False' 619 | lo_export22: 'False' 620 | lo_export23: 'False' 621 | lo_export24: 'False' 622 | lo_export25: 'False' 623 | lo_export26: 'False' 624 | lo_export27: 'False' 625 | lo_export28: 'False' 626 | lo_export29: 'False' 627 | lo_export3: 'False' 628 | lo_export30: 'False' 629 | lo_export31: 'False' 630 | lo_export4: 'False' 631 | lo_export5: 'False' 632 | lo_export6: 'False' 633 | lo_export7: 'False' 634 | lo_export8: 'False' 635 | lo_export9: 'False' 636 | lo_source0: internal 637 | lo_source1: internal 638 | lo_source10: internal 639 | lo_source11: internal 640 | lo_source12: internal 641 | lo_source13: internal 642 | lo_source14: internal 643 | lo_source15: internal 644 | lo_source16: internal 645 | lo_source17: internal 646 | lo_source18: internal 647 | lo_source19: internal 648 | lo_source2: internal 649 | lo_source20: internal 650 | lo_source21: internal 651 | lo_source22: internal 652 | lo_source23: internal 653 | lo_source24: internal 654 | lo_source25: internal 655 | lo_source26: internal 656 | lo_source27: internal 657 | lo_source28: internal 658 | lo_source29: internal 659 | lo_source3: internal 660 | lo_source30: internal 661 | lo_source31: internal 662 | lo_source4: internal 663 | lo_source5: internal 664 | lo_source6: internal 665 | lo_source7: internal 666 | lo_source8: internal 667 | lo_source9: internal 668 | maxoutbuf: '0' 669 | minoutbuf: '0' 670 | nchan: '1' 671 | num_mboards: '1' 672 | otw: '' 673 | samp_rate: samp_rate 674 | sd_spec0: '' 675 | sd_spec1: '' 676 | sd_spec2: '' 677 | sd_spec3: '' 678 | sd_spec4: '' 679 | sd_spec5: '' 680 | sd_spec6: '' 681 | sd_spec7: '' 682 | show_lo_controls: 'False' 683 | start_time: '-1.0' 684 | stream_args: '' 685 | stream_chans: '[]' 686 | sync: none 687 | time_source0: '' 688 | time_source1: '' 689 | time_source2: '' 690 | time_source3: '' 691 | time_source4: '' 692 | time_source5: '' 693 | time_source6: '' 694 | time_source7: '' 695 | type: fc32 696 | states: 697 | bus_sink: false 698 | bus_source: false 699 | bus_structure: null 700 | coordinate: [1048, 428.0] 701 | rotation: 0 702 | state: enabled 703 | - name: virtual_sink_0 704 | id: virtual_sink 705 | parameters: 706 | alias: '' 707 | comment: '' 708 | stream_id: ldpc-int 709 | states: 710 | bus_sink: false 711 | bus_source: false 712 | bus_structure: null 713 | coordinate: [1064, 140.0] 714 | rotation: 180 715 | state: true 716 | - name: virtual_sink_1 717 | id: virtual_sink 718 | parameters: 719 | alias: '' 720 | comment: '' 721 | stream_id: framer-rrc 722 | states: 723 | bus_sink: false 724 | bus_source: false 725 | bus_structure: null 726 | coordinate: [1064, 236.0] 727 | rotation: 0 728 | state: true 729 | - name: virtual_source_0 730 | id: virtual_source 731 | parameters: 732 | alias: '' 733 | comment: '' 734 | stream_id: ldpc-int 735 | states: 736 | bus_sink: false 737 | bus_source: false 738 | bus_structure: null 739 | coordinate: [208, 172.0] 740 | rotation: 180 741 | state: true 742 | - name: virtual_source_1 743 | id: virtual_source 744 | parameters: 745 | alias: '' 746 | comment: '' 747 | stream_id: framer-rrc 748 | states: 749 | bus_sink: false 750 | bus_source: false 751 | bus_structure: null 752 | coordinate: [304, 396.0] 753 | rotation: 0 754 | state: true 755 | 756 | connections: 757 | - [dtv_dvb_bbscrambler_bb_0, '0', dtv_dvb_bch_bb_0, '0'] 758 | - [dtv_dvb_bch_bb_0, '0', dtv_dvb_ldpc_bb_0, '0'] 759 | - [dtv_dvb_ldpc_bb_0, '0', virtual_sink_0, '0'] 760 | - [dtv_dvbs2_interleaver_bb_0, '0', dtv_dvbs2_modulator_bc_0, '0'] 761 | - [dtv_dvbs2_modulator_bc_0, '0', dtv_dvbs2_physical_cc_0, '0'] 762 | - [dtv_dvbs2_physical_cc_0, '0', virtual_sink_1, '0'] 763 | - [dvbgse_bbheader_source_0, '0', dtv_dvb_bbscrambler_bb_0, '0'] 764 | - [fft_filter_xxx_0, '0', qtgui_freq_sink_x_0, '0'] 765 | - [fft_filter_xxx_0, '0', uhd_usrp_sink_0_0, '0'] 766 | - [virtual_source_0, '0', dtv_dvbs2_interleaver_bb_0, '0'] 767 | - [virtual_source_1, '0', fft_filter_xxx_0, '0'] 768 | 769 | metadata: 770 | file_format: 1 771 | -------------------------------------------------------------------------------- /cmake/Modules/CMakeParseArgumentsCopy.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE_PARSE_ARGUMENTS( args...) 2 | # 3 | # CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for 4 | # parsing the arguments given to that macro or function. 5 | # It processes the arguments and defines a set of variables which hold the 6 | # values of the respective options. 7 | # 8 | # The argument contains all options for the respective macro, 9 | # i.e. keywords which can be used when calling the macro without any value 10 | # following, like e.g. the OPTIONAL keyword of the install() command. 11 | # 12 | # The argument contains all keywords for this macro 13 | # which are followed by one value, like e.g. DESTINATION keyword of the 14 | # install() command. 15 | # 16 | # The argument contains all keywords for this macro 17 | # which can be followed by more than one value, like e.g. the TARGETS or 18 | # FILES keywords of the install() command. 19 | # 20 | # When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the 21 | # keywords listed in , and 22 | # a variable composed of the given 23 | # followed by "_" and the name of the respective keyword. 24 | # These variables will then hold the respective value from the argument list. 25 | # For the keywords this will be TRUE or FALSE. 26 | # 27 | # All remaining arguments are collected in a variable 28 | # _UNPARSED_ARGUMENTS, this can be checked afterwards to see whether 29 | # your macro was called with unrecognized parameters. 30 | # 31 | # As an example here a my_install() macro, which takes similar arguments as the 32 | # real install() command: 33 | # 34 | # function(MY_INSTALL) 35 | # set(options OPTIONAL FAST) 36 | # set(oneValueArgs DESTINATION RENAME) 37 | # set(multiValueArgs TARGETS CONFIGURATIONS) 38 | # cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) 39 | # ... 40 | # 41 | # Assume my_install() has been called like this: 42 | # my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub) 43 | # 44 | # After the cmake_parse_arguments() call the macro will have set the following 45 | # variables: 46 | # MY_INSTALL_OPTIONAL = TRUE 47 | # MY_INSTALL_FAST = FALSE (this option was not used when calling my_install() 48 | # MY_INSTALL_DESTINATION = "bin" 49 | # MY_INSTALL_RENAME = "" (was not used) 50 | # MY_INSTALL_TARGETS = "foo;bar" 51 | # MY_INSTALL_CONFIGURATIONS = "" (was not used) 52 | # MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL" 53 | # 54 | # You can the continue and process these variables. 55 | # 56 | # Keywords terminate lists of values, e.g. if directly after a one_value_keyword 57 | # another recognized keyword follows, this is interpreted as the beginning of 58 | # the new option. 59 | # E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in 60 | # MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would 61 | # be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefore. 62 | 63 | #============================================================================= 64 | # Copyright 2010 Alexander Neundorf 65 | # 66 | # Distributed under the OSI-approved BSD License (the "License"); 67 | # see accompanying file Copyright.txt for details. 68 | # 69 | # This software is distributed WITHOUT ANY WARRANTY; without even the 70 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 71 | # See the License for more information. 72 | #============================================================================= 73 | # (To distribute this file outside of CMake, substitute the full 74 | # License text for the above reference.) 75 | 76 | 77 | if(__CMAKE_PARSE_ARGUMENTS_INCLUDED) 78 | return() 79 | endif() 80 | set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE) 81 | 82 | 83 | function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames) 84 | # first set all result variables to empty/FALSE 85 | foreach(arg_name ${_singleArgNames} ${_multiArgNames}) 86 | set(${prefix}_${arg_name}) 87 | endforeach(arg_name) 88 | 89 | foreach(option ${_optionNames}) 90 | set(${prefix}_${option} FALSE) 91 | endforeach(option) 92 | 93 | set(${prefix}_UNPARSED_ARGUMENTS) 94 | 95 | set(insideValues FALSE) 96 | set(currentArgName) 97 | 98 | # now iterate over all arguments and fill the result variables 99 | foreach(currentArg ${ARGN}) 100 | list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword 101 | list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword 102 | list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword 103 | 104 | if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1) 105 | if(insideValues) 106 | if("${insideValues}" STREQUAL "SINGLE") 107 | set(${prefix}_${currentArgName} ${currentArg}) 108 | set(insideValues FALSE) 109 | elseif("${insideValues}" STREQUAL "MULTI") 110 | list(APPEND ${prefix}_${currentArgName} ${currentArg}) 111 | endif() 112 | else(insideValues) 113 | list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg}) 114 | endif(insideValues) 115 | else() 116 | if(NOT ${optionIndex} EQUAL -1) 117 | set(${prefix}_${currentArg} TRUE) 118 | set(insideValues FALSE) 119 | elseif(NOT ${singleArgIndex} EQUAL -1) 120 | set(currentArgName ${currentArg}) 121 | set(${prefix}_${currentArgName}) 122 | set(insideValues "SINGLE") 123 | elseif(NOT ${multiArgIndex} EQUAL -1) 124 | set(currentArgName ${currentArg}) 125 | set(${prefix}_${currentArgName}) 126 | set(insideValues "MULTI") 127 | endif() 128 | endif() 129 | 130 | endforeach(currentArg) 131 | 132 | # propagate the result variables to the caller: 133 | foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames}) 134 | set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE) 135 | endforeach(arg_name) 136 | set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE) 137 | 138 | endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs) 139 | -------------------------------------------------------------------------------- /cmake/Modules/FindPcap.cmake: -------------------------------------------------------------------------------- 1 | if(NOT PKG_CONFIG_FOUND) 2 | INCLUDE(FindPkgConfig) 3 | endif() 4 | PKG_CHECK_MODULES(PC_PCAP pcap) 5 | 6 | FIND_PATH( 7 | PCAP_INCLUDE_DIRS 8 | NAMES pcap.h 9 | HINTS ${PC_PCAP_INCLUDEDIR} 10 | PATHS ${CMAKE_INSTALL_PREFIX}/include 11 | /usr/local/include 12 | /usr/include 13 | ) 14 | 15 | FIND_LIBRARY( 16 | PCAP_LIBRARIES 17 | NAMES pcap 18 | HINTS ${PC_PCAP_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(Pcap DEFAULT_MSG PCAP_LIBRARIES PCAP_INCLUDE_DIRS) 29 | MARK_AS_ADVANCED(PCAP_LIBRARIES PCAP_INCLUDE_DIRS) 30 | 31 | -------------------------------------------------------------------------------- /cmake/Modules/dvbgseConfig.cmake: -------------------------------------------------------------------------------- 1 | if(NOT PKG_CONFIG_FOUND) 2 | INCLUDE(FindPkgConfig) 3 | endif() 4 | PKG_CHECK_MODULES(PC_DVBGSE dvbgse) 5 | 6 | FIND_PATH( 7 | DVBGSE_INCLUDE_DIRS 8 | NAMES dvbgse/api.h 9 | HINTS $ENV{DVBGSE_DIR}/include 10 | ${PC_DVBGSE_INCLUDEDIR} 11 | PATHS ${CMAKE_INSTALL_PREFIX}/include 12 | /usr/local/include 13 | /usr/include 14 | ) 15 | 16 | FIND_LIBRARY( 17 | DVBGSE_LIBRARIES 18 | NAMES gnuradio-dvbgse 19 | HINTS $ENV{DVBGSE_DIR}/lib 20 | ${PC_DVBGSE_LIBDIR} 21 | PATHS ${CMAKE_INSTALL_PREFIX}/lib 22 | ${CMAKE_INSTALL_PREFIX}/lib64 23 | /usr/local/lib 24 | /usr/local/lib64 25 | /usr/lib 26 | /usr/lib64 27 | ) 28 | 29 | include("${CMAKE_CURRENT_LIST_DIR}/dvbgseTarget.cmake") 30 | 31 | INCLUDE(FindPackageHandleStandardArgs) 32 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(DVBGSE DEFAULT_MSG DVBGSE_LIBRARIES DVBGSE_INCLUDE_DIRS) 33 | MARK_AS_ADVANCED(DVBGSE_LIBRARIES DVBGSE_INCLUDE_DIRS) 34 | -------------------------------------------------------------------------------- /cmake/Modules/targetConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # SPDX-License-Identifier: GPL-3.0-or-later 6 | # 7 | 8 | include(CMakeFindDependencyMacro) 9 | 10 | set(target_deps "@TARGET_DEPENDENCIES@") 11 | foreach(dep IN LISTS target_deps) 12 | find_dependency(${dep}) 13 | endforeach() 14 | include("${CMAKE_CURRENT_LIST_DIR}/@TARGET@Targets.cmake") 15 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file was generated by gr_modtool, a tool from the GNU Radio framework 4 | # This file is a part of gr-dvbgse 5 | # 6 | # SPDX-License-Identifier: GPL-3.0-or-later 7 | # 8 | 9 | ######################################################################## 10 | # Setup dependencies 11 | ######################################################################## 12 | find_package(Doxygen) 13 | 14 | ######################################################################## 15 | # Begin conditional configuration 16 | ######################################################################## 17 | if(ENABLE_DOXYGEN) 18 | 19 | ######################################################################## 20 | # Add subdirectories 21 | ######################################################################## 22 | add_subdirectory(doxygen) 23 | 24 | endif(ENABLE_DOXYGEN) 25 | -------------------------------------------------------------------------------- /docs/README.dvbgse: -------------------------------------------------------------------------------- 1 | This is the dvbgse-write-a-block package meant as a guide to building 2 | out-of-tree packages. To use the dvbgse blocks, the Python namespaces 3 | is in 'dvbgse', which is imported as: 4 | 5 | import dvbgse 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(dvbgse) 12 | -------------------------------------------------------------------------------- /docs/doxygen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file was generated by gr_modtool, a tool from the GNU Radio framework 4 | # This file is a part of gr-dvbgse 5 | # 6 | # SPDX-License-Identifier: GPL-3.0-or-later 7 | # 8 | 9 | ######################################################################## 10 | # Create the doxygen configuration file 11 | ######################################################################## 12 | file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} top_srcdir) 13 | file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} top_builddir) 14 | file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} abs_top_srcdir) 15 | file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} abs_top_builddir) 16 | 17 | set(HAVE_DOT ${DOXYGEN_DOT_FOUND}) 18 | set(enable_html_docs YES) 19 | set(enable_latex_docs NO) 20 | set(enable_mathjax NO) 21 | set(enable_xml_docs YES) 22 | 23 | configure_file( 24 | ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in 25 | ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile 26 | @ONLY) 27 | 28 | set(BUILT_DIRS ${CMAKE_CURRENT_BINARY_DIR}/xml ${CMAKE_CURRENT_BINARY_DIR}/html) 29 | 30 | ######################################################################## 31 | # Make and install doxygen docs 32 | ######################################################################## 33 | add_custom_command( 34 | OUTPUT ${BUILT_DIRS} 35 | COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile 36 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 37 | COMMENT "Generating documentation with doxygen" 38 | ) 39 | 40 | add_custom_target(doxygen_target ALL DEPENDS ${BUILT_DIRS}) 41 | 42 | install(DIRECTORY ${BUILT_DIRS} DESTINATION ${GR_PKG_DOC_DIR}) 43 | -------------------------------------------------------------------------------- /docs/doxygen/doxyxml/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2010 Free Software Foundation, Inc. 3 | # 4 | # This file was generated by gr_modtool, a tool from the GNU Radio framework 5 | # This file is a part of gr-dvbgse 6 | # 7 | # SPDX-License-Identifier: GPL-3.0-or-later 8 | # 9 | # 10 | """ 11 | Python interface to contents of doxygen xml documentation. 12 | 13 | Example use: 14 | See the contents of the example folder for the C++ and 15 | doxygen-generated xml used in this example. 16 | 17 | >>> # Parse the doxygen docs. 18 | >>> import os 19 | >>> this_dir = os.path.dirname(globals()['__file__']) 20 | >>> xml_path = this_dir + "/example/xml/" 21 | >>> di = DoxyIndex(xml_path) 22 | 23 | Get a list of all top-level objects. 24 | 25 | >>> print([mem.name() for mem in di.members()]) 26 | [u'Aadvark', u'aadvarky_enough', u'main'] 27 | 28 | Get all functions. 29 | 30 | >>> print([mem.name() for mem in di.in_category(DoxyFunction)]) 31 | [u'aadvarky_enough', u'main'] 32 | 33 | Check if an object is present. 34 | 35 | >>> di.has_member(u'Aadvark') 36 | True 37 | >>> di.has_member(u'Fish') 38 | False 39 | 40 | Get an item by name and check its properties. 41 | 42 | >>> aad = di.get_member(u'Aadvark') 43 | >>> print(aad.brief_description) 44 | Models the mammal Aadvark. 45 | >>> print(aad.detailed_description) 46 | Sadly the model is incomplete and cannot capture all aspects of an aadvark yet. 47 | 48 | This line is uninformative and is only to test line breaks in the comments. 49 | >>> [mem.name() for mem in aad.members()] 50 | [u'aadvarkness', u'print', u'Aadvark', u'get_aadvarkness'] 51 | >>> aad.get_member(u'print').brief_description 52 | u'Outputs the vital aadvark statistics.' 53 | 54 | """ 55 | 56 | from .doxyindex import DoxyIndex, DoxyFunction, DoxyParam, DoxyClass, DoxyFile, DoxyNamespace, DoxyGroup, DoxyFriend, DoxyOther 57 | 58 | def _test(): 59 | import os 60 | this_dir = os.path.dirname(globals()['__file__']) 61 | xml_path = this_dir + "/example/xml/" 62 | di = DoxyIndex(xml_path) 63 | # Get the Aadvark class 64 | aad = di.get_member('Aadvark') 65 | aad.brief_description 66 | import doctest 67 | return doctest.testmod() 68 | 69 | if __name__ == "__main__": 70 | _test() 71 | 72 | -------------------------------------------------------------------------------- /docs/doxygen/doxyxml/base.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2010 Free Software Foundation, Inc. 3 | # 4 | # This file was generated by gr_modtool, a tool from the GNU Radio framework 5 | # This file is a part of gr-dvbgse 6 | # 7 | # SPDX-License-Identifier: GPL-3.0-or-later 8 | # 9 | # 10 | """ 11 | A base class is created. 12 | 13 | Classes based upon this are used to make more user-friendly interfaces 14 | to the doxygen xml docs than the generated classes provide. 15 | """ 16 | 17 | import os 18 | import pdb 19 | 20 | from xml.parsers.expat import ExpatError 21 | 22 | from .generated import compound 23 | 24 | 25 | class Base(object): 26 | 27 | class Duplicate(Exception): 28 | pass 29 | 30 | class NoSuchMember(Exception): 31 | pass 32 | 33 | class ParsingError(Exception): 34 | pass 35 | 36 | def __init__(self, parse_data, top=None): 37 | self._parsed = False 38 | self._error = False 39 | self._parse_data = parse_data 40 | self._members = [] 41 | self._dict_members = {} 42 | self._in_category = {} 43 | self._data = {} 44 | if top is not None: 45 | self._xml_path = top._xml_path 46 | # Set up holder of references 47 | else: 48 | top = self 49 | self._refs = {} 50 | self._xml_path = parse_data 51 | self.top = top 52 | 53 | @classmethod 54 | def from_refid(cls, refid, top=None): 55 | """ Instantiate class from a refid rather than parsing object. """ 56 | # First check to see if its already been instantiated. 57 | if top is not None and refid in top._refs: 58 | return top._refs[refid] 59 | # Otherwise create a new instance and set refid. 60 | inst = cls(None, top=top) 61 | inst.refid = refid 62 | inst.add_ref(inst) 63 | return inst 64 | 65 | @classmethod 66 | def from_parse_data(cls, parse_data, top=None): 67 | refid = getattr(parse_data, 'refid', None) 68 | if refid is not None and top is not None and refid in top._refs: 69 | return top._refs[refid] 70 | inst = cls(parse_data, top=top) 71 | if refid is not None: 72 | inst.refid = refid 73 | inst.add_ref(inst) 74 | return inst 75 | 76 | def add_ref(self, obj): 77 | if hasattr(obj, 'refid'): 78 | self.top._refs[obj.refid] = obj 79 | 80 | mem_classes = [] 81 | 82 | def get_cls(self, mem): 83 | for cls in self.mem_classes: 84 | if cls.can_parse(mem): 85 | return cls 86 | raise Exception(("Did not find a class for object '%s'." \ 87 | % (mem.get_name()))) 88 | 89 | def convert_mem(self, mem): 90 | try: 91 | cls = self.get_cls(mem) 92 | converted = cls.from_parse_data(mem, self.top) 93 | if converted is None: 94 | raise Exception('No class matched this object.') 95 | self.add_ref(converted) 96 | return converted 97 | except Exception as e: 98 | print(e) 99 | 100 | @classmethod 101 | def includes(cls, inst): 102 | return isinstance(inst, cls) 103 | 104 | @classmethod 105 | def can_parse(cls, obj): 106 | return False 107 | 108 | def _parse(self): 109 | self._parsed = True 110 | 111 | def _get_dict_members(self, cat=None): 112 | """ 113 | For given category a dictionary is returned mapping member names to 114 | members of that category. For names that are duplicated the name is 115 | mapped to None. 116 | """ 117 | self.confirm_no_error() 118 | if cat not in self._dict_members: 119 | new_dict = {} 120 | for mem in self.in_category(cat): 121 | if mem.name() not in new_dict: 122 | new_dict[mem.name()] = mem 123 | else: 124 | new_dict[mem.name()] = self.Duplicate 125 | self._dict_members[cat] = new_dict 126 | return self._dict_members[cat] 127 | 128 | def in_category(self, cat): 129 | self.confirm_no_error() 130 | if cat is None: 131 | return self._members 132 | if cat not in self._in_category: 133 | self._in_category[cat] = [mem for mem in self._members 134 | if cat.includes(mem)] 135 | return self._in_category[cat] 136 | 137 | def get_member(self, name, cat=None): 138 | self.confirm_no_error() 139 | # Check if it's in a namespace or class. 140 | bits = name.split('::') 141 | first = bits[0] 142 | rest = '::'.join(bits[1:]) 143 | member = self._get_dict_members(cat).get(first, self.NoSuchMember) 144 | # Raise any errors that are returned. 145 | if member in set([self.NoSuchMember, self.Duplicate]): 146 | raise member() 147 | if rest: 148 | return member.get_member(rest, cat=cat) 149 | return member 150 | 151 | def has_member(self, name, cat=None): 152 | try: 153 | mem = self.get_member(name, cat=cat) 154 | return True 155 | except self.NoSuchMember: 156 | return False 157 | 158 | def data(self): 159 | self.confirm_no_error() 160 | return self._data 161 | 162 | def members(self): 163 | self.confirm_no_error() 164 | return self._members 165 | 166 | def process_memberdefs(self): 167 | mdtss = [] 168 | for sec in self._retrieved_data.compounddef.sectiondef: 169 | mdtss += sec.memberdef 170 | # At the moment we lose all information associated with sections. 171 | # Sometimes a memberdef is in several sectiondef. 172 | # We make sure we don't get duplicates here. 173 | uniques = set([]) 174 | for mem in mdtss: 175 | converted = self.convert_mem(mem) 176 | pair = (mem.name, mem.__class__) 177 | if pair not in uniques: 178 | uniques.add(pair) 179 | self._members.append(converted) 180 | 181 | def retrieve_data(self): 182 | filename = os.path.join(self._xml_path, self.refid + '.xml') 183 | try: 184 | self._retrieved_data = compound.parse(filename) 185 | except ExpatError: 186 | print('Error in xml in file %s' % filename) 187 | self._error = True 188 | self._retrieved_data = None 189 | 190 | def check_parsed(self): 191 | if not self._parsed: 192 | self._parse() 193 | 194 | def confirm_no_error(self): 195 | self.check_parsed() 196 | if self._error: 197 | raise self.ParsingError() 198 | 199 | def error(self): 200 | self.check_parsed() 201 | return self._error 202 | 203 | def name(self): 204 | # first see if we can do it without processing. 205 | if self._parse_data is not None: 206 | return self._parse_data.name 207 | self.check_parsed() 208 | return self._retrieved_data.compounddef.name 209 | -------------------------------------------------------------------------------- /docs/doxygen/doxyxml/doxyindex.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2010 Free Software Foundation, Inc. 3 | # 4 | # This file was generated by gr_modtool, a tool from the GNU Radio framework 5 | # This file is a part of gr-dvbgse 6 | # 7 | # SPDX-License-Identifier: GPL-3.0-or-later 8 | # 9 | # 10 | """ 11 | Classes providing more user-friendly interfaces to the doxygen xml 12 | docs than the generated classes provide. 13 | """ 14 | 15 | import os 16 | 17 | from .generated import index 18 | from .base import Base 19 | from .text import description 20 | 21 | class DoxyIndex(Base): 22 | """ 23 | Parses a doxygen xml directory. 24 | """ 25 | 26 | __module__ = "gnuradio.utils.doxyxml" 27 | 28 | def _parse(self): 29 | if self._parsed: 30 | return 31 | super(DoxyIndex, self)._parse() 32 | self._root = index.parse(os.path.join(self._xml_path, 'index.xml')) 33 | for mem in self._root.compound: 34 | converted = self.convert_mem(mem) 35 | # For files and namespaces we want the contents to be 36 | # accessible directly from the parent rather than having 37 | # to go through the file object. 38 | if self.get_cls(mem) == DoxyFile: 39 | if mem.name.endswith('.h'): 40 | self._members += converted.members() 41 | self._members.append(converted) 42 | elif self.get_cls(mem) == DoxyNamespace: 43 | self._members += converted.members() 44 | self._members.append(converted) 45 | else: 46 | self._members.append(converted) 47 | 48 | 49 | class DoxyCompMem(Base): 50 | 51 | 52 | kind = None 53 | 54 | def __init__(self, *args, **kwargs): 55 | super(DoxyCompMem, self).__init__(*args, **kwargs) 56 | 57 | @classmethod 58 | def can_parse(cls, obj): 59 | return obj.kind == cls.kind 60 | 61 | def set_descriptions(self, parse_data): 62 | bd = description(getattr(parse_data, 'briefdescription', None)) 63 | dd = description(getattr(parse_data, 'detaileddescription', None)) 64 | self._data['brief_description'] = bd 65 | self._data['detailed_description'] = dd 66 | 67 | def set_parameters(self, data): 68 | vs = [ddc.value for ddc in data.detaileddescription.content_] 69 | pls = [] 70 | for v in vs: 71 | if hasattr(v, 'parameterlist'): 72 | pls += v.parameterlist 73 | pis = [] 74 | for pl in pls: 75 | pis += pl.parameteritem 76 | dpis = [] 77 | for pi in pis: 78 | dpi = DoxyParameterItem(pi) 79 | dpi._parse() 80 | dpis.append(dpi) 81 | self._data['params'] = dpis 82 | 83 | 84 | class DoxyCompound(DoxyCompMem): 85 | pass 86 | 87 | class DoxyMember(DoxyCompMem): 88 | pass 89 | 90 | class DoxyFunction(DoxyMember): 91 | 92 | __module__ = "gnuradio.utils.doxyxml" 93 | 94 | kind = 'function' 95 | 96 | def _parse(self): 97 | if self._parsed: 98 | return 99 | super(DoxyFunction, self)._parse() 100 | self.set_descriptions(self._parse_data) 101 | self.set_parameters(self._parse_data) 102 | if not self._data['params']: 103 | # If the params weren't set by a comment then just grab the names. 104 | self._data['params'] = [] 105 | prms = self._parse_data.param 106 | for prm in prms: 107 | self._data['params'].append(DoxyParam(prm)) 108 | 109 | brief_description = property(lambda self: self.data()['brief_description']) 110 | detailed_description = property(lambda self: self.data()['detailed_description']) 111 | params = property(lambda self: self.data()['params']) 112 | 113 | Base.mem_classes.append(DoxyFunction) 114 | 115 | 116 | class DoxyParam(DoxyMember): 117 | 118 | __module__ = "gnuradio.utils.doxyxml" 119 | 120 | def _parse(self): 121 | if self._parsed: 122 | return 123 | super(DoxyParam, self)._parse() 124 | self.set_descriptions(self._parse_data) 125 | self._data['declname'] = self._parse_data.declname 126 | 127 | @property 128 | def description(self): 129 | descriptions = [] 130 | if self.brief_description: 131 | descriptions.append(self.brief_description) 132 | if self.detailed_description: 133 | descriptions.append(self.detailed_description) 134 | return '\n\n'.join(descriptions) 135 | 136 | brief_description = property(lambda self: self.data()['brief_description']) 137 | detailed_description = property(lambda self: self.data()['detailed_description']) 138 | name = property(lambda self: self.data()['declname']) 139 | 140 | class DoxyParameterItem(DoxyMember): 141 | """A different representation of a parameter in Doxygen.""" 142 | 143 | def _parse(self): 144 | if self._parsed: 145 | return 146 | super(DoxyParameterItem, self)._parse() 147 | names = [] 148 | for nl in self._parse_data.parameternamelist: 149 | for pn in nl.parametername: 150 | names.append(description(pn)) 151 | # Just take first name 152 | self._data['name'] = names[0] 153 | # Get description 154 | pd = description(self._parse_data.get_parameterdescription()) 155 | self._data['description'] = pd 156 | 157 | description = property(lambda self: self.data()['description']) 158 | name = property(lambda self: self.data()['name']) 159 | 160 | 161 | class DoxyClass(DoxyCompound): 162 | 163 | __module__ = "gnuradio.utils.doxyxml" 164 | 165 | kind = 'class' 166 | 167 | def _parse(self): 168 | if self._parsed: 169 | return 170 | super(DoxyClass, self)._parse() 171 | self.retrieve_data() 172 | if self._error: 173 | return 174 | self.set_descriptions(self._retrieved_data.compounddef) 175 | self.set_parameters(self._retrieved_data.compounddef) 176 | # Sectiondef.kind tells about whether private or public. 177 | # We just ignore this for now. 178 | self.process_memberdefs() 179 | 180 | brief_description = property(lambda self: self.data()['brief_description']) 181 | detailed_description = property(lambda self: self.data()['detailed_description']) 182 | params = property(lambda self: self.data()['params']) 183 | 184 | Base.mem_classes.append(DoxyClass) 185 | 186 | 187 | class DoxyFile(DoxyCompound): 188 | 189 | __module__ = "gnuradio.utils.doxyxml" 190 | 191 | kind = 'file' 192 | 193 | def _parse(self): 194 | if self._parsed: 195 | return 196 | super(DoxyFile, self)._parse() 197 | self.retrieve_data() 198 | self.set_descriptions(self._retrieved_data.compounddef) 199 | if self._error: 200 | return 201 | self.process_memberdefs() 202 | 203 | brief_description = property(lambda self: self.data()['brief_description']) 204 | detailed_description = property(lambda self: self.data()['detailed_description']) 205 | 206 | Base.mem_classes.append(DoxyFile) 207 | 208 | 209 | class DoxyNamespace(DoxyCompound): 210 | 211 | __module__ = "gnuradio.utils.doxyxml" 212 | 213 | kind = 'namespace' 214 | 215 | def _parse(self): 216 | if self._parsed: 217 | return 218 | super(DoxyNamespace, self)._parse() 219 | self.retrieve_data() 220 | self.set_descriptions(self._retrieved_data.compounddef) 221 | if self._error: 222 | return 223 | self.process_memberdefs() 224 | 225 | Base.mem_classes.append(DoxyNamespace) 226 | 227 | 228 | class DoxyGroup(DoxyCompound): 229 | 230 | __module__ = "gnuradio.utils.doxyxml" 231 | 232 | kind = 'group' 233 | 234 | def _parse(self): 235 | if self._parsed: 236 | return 237 | super(DoxyGroup, self)._parse() 238 | self.retrieve_data() 239 | if self._error: 240 | return 241 | cdef = self._retrieved_data.compounddef 242 | self._data['title'] = description(cdef.title) 243 | # Process inner groups 244 | grps = cdef.innergroup 245 | for grp in grps: 246 | converted = DoxyGroup.from_refid(grp.refid, top=self.top) 247 | self._members.append(converted) 248 | # Process inner classes 249 | klasses = cdef.innerclass 250 | for kls in klasses: 251 | converted = DoxyClass.from_refid(kls.refid, top=self.top) 252 | self._members.append(converted) 253 | # Process normal members 254 | self.process_memberdefs() 255 | 256 | title = property(lambda self: self.data()['title']) 257 | 258 | 259 | Base.mem_classes.append(DoxyGroup) 260 | 261 | 262 | class DoxyFriend(DoxyMember): 263 | 264 | __module__ = "gnuradio.utils.doxyxml" 265 | 266 | kind = 'friend' 267 | 268 | Base.mem_classes.append(DoxyFriend) 269 | 270 | 271 | class DoxyOther(Base): 272 | 273 | __module__ = "gnuradio.utils.doxyxml" 274 | 275 | kinds = set(['variable', 'struct', 'union', 'define', 'typedef', 'enum', 276 | 'dir', 'page', 'signal', 'slot', 'property']) 277 | 278 | @classmethod 279 | def can_parse(cls, obj): 280 | return obj.kind in cls.kinds 281 | 282 | Base.mem_classes.append(DoxyOther) 283 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /docs/doxygen/doxyxml/generated/compound.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | Generated Mon Feb 9 19:08:05 2009 by generateDS.py. 5 | """ 6 | 7 | 8 | from xml.dom import minidom 9 | from xml.dom import Node 10 | 11 | import sys 12 | 13 | from . import compoundsuper as supermod 14 | from .compoundsuper import MixedContainer 15 | 16 | 17 | class DoxygenTypeSub(supermod.DoxygenType): 18 | def __init__(self, version=None, compounddef=None): 19 | supermod.DoxygenType.__init__(self, version, compounddef) 20 | 21 | def find(self, details): 22 | 23 | return self.compounddef.find(details) 24 | 25 | supermod.DoxygenType.subclass = DoxygenTypeSub 26 | # end class DoxygenTypeSub 27 | 28 | 29 | class compounddefTypeSub(supermod.compounddefType): 30 | def __init__(self, kind=None, prot=None, id=None, compoundname='', title='', basecompoundref=None, derivedcompoundref=None, includes=None, includedby=None, incdepgraph=None, invincdepgraph=None, innerdir=None, innerfile=None, innerclass=None, innernamespace=None, innerpage=None, innergroup=None, templateparamlist=None, sectiondef=None, briefdescription=None, detaileddescription=None, inheritancegraph=None, collaborationgraph=None, programlisting=None, location=None, listofallmembers=None): 31 | supermod.compounddefType.__init__(self, kind, prot, id, compoundname, title, basecompoundref, derivedcompoundref, includes, includedby, incdepgraph, invincdepgraph, innerdir, innerfile, innerclass, innernamespace, innerpage, innergroup, templateparamlist, sectiondef, briefdescription, detaileddescription, inheritancegraph, collaborationgraph, programlisting, location, listofallmembers) 32 | 33 | def find(self, details): 34 | 35 | if self.id == details.refid: 36 | return self 37 | 38 | for sectiondef in self.sectiondef: 39 | result = sectiondef.find(details) 40 | if result: 41 | return result 42 | 43 | 44 | supermod.compounddefType.subclass = compounddefTypeSub 45 | # end class compounddefTypeSub 46 | 47 | 48 | class listofallmembersTypeSub(supermod.listofallmembersType): 49 | def __init__(self, member=None): 50 | supermod.listofallmembersType.__init__(self, member) 51 | supermod.listofallmembersType.subclass = listofallmembersTypeSub 52 | # end class listofallmembersTypeSub 53 | 54 | 55 | class memberRefTypeSub(supermod.memberRefType): 56 | def __init__(self, virt=None, prot=None, refid=None, ambiguityscope=None, scope='', name=''): 57 | supermod.memberRefType.__init__(self, virt, prot, refid, ambiguityscope, scope, name) 58 | supermod.memberRefType.subclass = memberRefTypeSub 59 | # end class memberRefTypeSub 60 | 61 | 62 | class compoundRefTypeSub(supermod.compoundRefType): 63 | def __init__(self, virt=None, prot=None, refid=None, valueOf_='', mixedclass_=None, content_=None): 64 | supermod.compoundRefType.__init__(self, mixedclass_, content_) 65 | supermod.compoundRefType.subclass = compoundRefTypeSub 66 | # end class compoundRefTypeSub 67 | 68 | 69 | class reimplementTypeSub(supermod.reimplementType): 70 | def __init__(self, refid=None, valueOf_='', mixedclass_=None, content_=None): 71 | supermod.reimplementType.__init__(self, mixedclass_, content_) 72 | supermod.reimplementType.subclass = reimplementTypeSub 73 | # end class reimplementTypeSub 74 | 75 | 76 | class incTypeSub(supermod.incType): 77 | def __init__(self, local=None, refid=None, valueOf_='', mixedclass_=None, content_=None): 78 | supermod.incType.__init__(self, mixedclass_, content_) 79 | supermod.incType.subclass = incTypeSub 80 | # end class incTypeSub 81 | 82 | 83 | class refTypeSub(supermod.refType): 84 | def __init__(self, prot=None, refid=None, valueOf_='', mixedclass_=None, content_=None): 85 | supermod.refType.__init__(self, mixedclass_, content_) 86 | supermod.refType.subclass = refTypeSub 87 | # end class refTypeSub 88 | 89 | 90 | 91 | class refTextTypeSub(supermod.refTextType): 92 | def __init__(self, refid=None, kindref=None, external=None, valueOf_='', mixedclass_=None, content_=None): 93 | supermod.refTextType.__init__(self, mixedclass_, content_) 94 | 95 | supermod.refTextType.subclass = refTextTypeSub 96 | # end class refTextTypeSub 97 | 98 | class sectiondefTypeSub(supermod.sectiondefType): 99 | 100 | 101 | def __init__(self, kind=None, header='', description=None, memberdef=None): 102 | supermod.sectiondefType.__init__(self, kind, header, description, memberdef) 103 | 104 | def find(self, details): 105 | 106 | for memberdef in self.memberdef: 107 | if memberdef.id == details.refid: 108 | return memberdef 109 | 110 | return None 111 | 112 | 113 | supermod.sectiondefType.subclass = sectiondefTypeSub 114 | # end class sectiondefTypeSub 115 | 116 | 117 | class memberdefTypeSub(supermod.memberdefType): 118 | def __init__(self, initonly=None, kind=None, volatile=None, const=None, raise_=None, virt=None, readable=None, prot=None, explicit=None, new=None, final=None, writable=None, add=None, static=None, remove=None, sealed=None, mutable=None, gettable=None, inline=None, settable=None, id=None, templateparamlist=None, type_=None, definition='', argsstring='', name='', read='', write='', bitfield='', reimplements=None, reimplementedby=None, param=None, enumvalue=None, initializer=None, exceptions=None, briefdescription=None, detaileddescription=None, inbodydescription=None, location=None, references=None, referencedby=None): 119 | supermod.memberdefType.__init__(self, initonly, kind, volatile, const, raise_, virt, readable, prot, explicit, new, final, writable, add, static, remove, sealed, mutable, gettable, inline, settable, id, templateparamlist, type_, definition, argsstring, name, read, write, bitfield, reimplements, reimplementedby, param, enumvalue, initializer, exceptions, briefdescription, detaileddescription, inbodydescription, location, references, referencedby) 120 | supermod.memberdefType.subclass = memberdefTypeSub 121 | # end class memberdefTypeSub 122 | 123 | 124 | class descriptionTypeSub(supermod.descriptionType): 125 | def __init__(self, title='', para=None, sect1=None, internal=None, mixedclass_=None, content_=None): 126 | supermod.descriptionType.__init__(self, mixedclass_, content_) 127 | supermod.descriptionType.subclass = descriptionTypeSub 128 | # end class descriptionTypeSub 129 | 130 | 131 | class enumvalueTypeSub(supermod.enumvalueType): 132 | def __init__(self, prot=None, id=None, name='', initializer=None, briefdescription=None, detaileddescription=None, mixedclass_=None, content_=None): 133 | supermod.enumvalueType.__init__(self, mixedclass_, content_) 134 | supermod.enumvalueType.subclass = enumvalueTypeSub 135 | # end class enumvalueTypeSub 136 | 137 | 138 | class templateparamlistTypeSub(supermod.templateparamlistType): 139 | def __init__(self, param=None): 140 | supermod.templateparamlistType.__init__(self, param) 141 | supermod.templateparamlistType.subclass = templateparamlistTypeSub 142 | # end class templateparamlistTypeSub 143 | 144 | 145 | class paramTypeSub(supermod.paramType): 146 | def __init__(self, type_=None, declname='', defname='', array='', defval=None, briefdescription=None): 147 | supermod.paramType.__init__(self, type_, declname, defname, array, defval, briefdescription) 148 | supermod.paramType.subclass = paramTypeSub 149 | # end class paramTypeSub 150 | 151 | 152 | class linkedTextTypeSub(supermod.linkedTextType): 153 | def __init__(self, ref=None, mixedclass_=None, content_=None): 154 | supermod.linkedTextType.__init__(self, mixedclass_, content_) 155 | supermod.linkedTextType.subclass = linkedTextTypeSub 156 | # end class linkedTextTypeSub 157 | 158 | 159 | class graphTypeSub(supermod.graphType): 160 | def __init__(self, node=None): 161 | supermod.graphType.__init__(self, node) 162 | supermod.graphType.subclass = graphTypeSub 163 | # end class graphTypeSub 164 | 165 | 166 | class nodeTypeSub(supermod.nodeType): 167 | def __init__(self, id=None, label='', link=None, childnode=None): 168 | supermod.nodeType.__init__(self, id, label, link, childnode) 169 | supermod.nodeType.subclass = nodeTypeSub 170 | # end class nodeTypeSub 171 | 172 | 173 | class childnodeTypeSub(supermod.childnodeType): 174 | def __init__(self, relation=None, refid=None, edgelabel=None): 175 | supermod.childnodeType.__init__(self, relation, refid, edgelabel) 176 | supermod.childnodeType.subclass = childnodeTypeSub 177 | # end class childnodeTypeSub 178 | 179 | 180 | class linkTypeSub(supermod.linkType): 181 | def __init__(self, refid=None, external=None, valueOf_=''): 182 | supermod.linkType.__init__(self, refid, external) 183 | supermod.linkType.subclass = linkTypeSub 184 | # end class linkTypeSub 185 | 186 | 187 | class listingTypeSub(supermod.listingType): 188 | def __init__(self, codeline=None): 189 | supermod.listingType.__init__(self, codeline) 190 | supermod.listingType.subclass = listingTypeSub 191 | # end class listingTypeSub 192 | 193 | 194 | class codelineTypeSub(supermod.codelineType): 195 | def __init__(self, external=None, lineno=None, refkind=None, refid=None, highlight=None): 196 | supermod.codelineType.__init__(self, external, lineno, refkind, refid, highlight) 197 | supermod.codelineType.subclass = codelineTypeSub 198 | # end class codelineTypeSub 199 | 200 | 201 | class highlightTypeSub(supermod.highlightType): 202 | def __init__(self, class_=None, sp=None, ref=None, mixedclass_=None, content_=None): 203 | supermod.highlightType.__init__(self, mixedclass_, content_) 204 | supermod.highlightType.subclass = highlightTypeSub 205 | # end class highlightTypeSub 206 | 207 | 208 | class referenceTypeSub(supermod.referenceType): 209 | def __init__(self, endline=None, startline=None, refid=None, compoundref=None, valueOf_='', mixedclass_=None, content_=None): 210 | supermod.referenceType.__init__(self, mixedclass_, content_) 211 | supermod.referenceType.subclass = referenceTypeSub 212 | # end class referenceTypeSub 213 | 214 | 215 | class locationTypeSub(supermod.locationType): 216 | def __init__(self, bodystart=None, line=None, bodyend=None, bodyfile=None, file=None, valueOf_=''): 217 | supermod.locationType.__init__(self, bodystart, line, bodyend, bodyfile, file) 218 | supermod.locationType.subclass = locationTypeSub 219 | # end class locationTypeSub 220 | 221 | 222 | class docSect1TypeSub(supermod.docSect1Type): 223 | def __init__(self, id=None, title='', para=None, sect2=None, internal=None, mixedclass_=None, content_=None): 224 | supermod.docSect1Type.__init__(self, mixedclass_, content_) 225 | supermod.docSect1Type.subclass = docSect1TypeSub 226 | # end class docSect1TypeSub 227 | 228 | 229 | class docSect2TypeSub(supermod.docSect2Type): 230 | def __init__(self, id=None, title='', para=None, sect3=None, internal=None, mixedclass_=None, content_=None): 231 | supermod.docSect2Type.__init__(self, mixedclass_, content_) 232 | supermod.docSect2Type.subclass = docSect2TypeSub 233 | # end class docSect2TypeSub 234 | 235 | 236 | class docSect3TypeSub(supermod.docSect3Type): 237 | def __init__(self, id=None, title='', para=None, sect4=None, internal=None, mixedclass_=None, content_=None): 238 | supermod.docSect3Type.__init__(self, mixedclass_, content_) 239 | supermod.docSect3Type.subclass = docSect3TypeSub 240 | # end class docSect3TypeSub 241 | 242 | 243 | class docSect4TypeSub(supermod.docSect4Type): 244 | def __init__(self, id=None, title='', para=None, internal=None, mixedclass_=None, content_=None): 245 | supermod.docSect4Type.__init__(self, mixedclass_, content_) 246 | supermod.docSect4Type.subclass = docSect4TypeSub 247 | # end class docSect4TypeSub 248 | 249 | 250 | class docInternalTypeSub(supermod.docInternalType): 251 | def __init__(self, para=None, sect1=None, mixedclass_=None, content_=None): 252 | supermod.docInternalType.__init__(self, mixedclass_, content_) 253 | supermod.docInternalType.subclass = docInternalTypeSub 254 | # end class docInternalTypeSub 255 | 256 | 257 | class docInternalS1TypeSub(supermod.docInternalS1Type): 258 | def __init__(self, para=None, sect2=None, mixedclass_=None, content_=None): 259 | supermod.docInternalS1Type.__init__(self, mixedclass_, content_) 260 | supermod.docInternalS1Type.subclass = docInternalS1TypeSub 261 | # end class docInternalS1TypeSub 262 | 263 | 264 | class docInternalS2TypeSub(supermod.docInternalS2Type): 265 | def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None): 266 | supermod.docInternalS2Type.__init__(self, mixedclass_, content_) 267 | supermod.docInternalS2Type.subclass = docInternalS2TypeSub 268 | # end class docInternalS2TypeSub 269 | 270 | 271 | class docInternalS3TypeSub(supermod.docInternalS3Type): 272 | def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None): 273 | supermod.docInternalS3Type.__init__(self, mixedclass_, content_) 274 | supermod.docInternalS3Type.subclass = docInternalS3TypeSub 275 | # end class docInternalS3TypeSub 276 | 277 | 278 | class docInternalS4TypeSub(supermod.docInternalS4Type): 279 | def __init__(self, para=None, mixedclass_=None, content_=None): 280 | supermod.docInternalS4Type.__init__(self, mixedclass_, content_) 281 | supermod.docInternalS4Type.subclass = docInternalS4TypeSub 282 | # end class docInternalS4TypeSub 283 | 284 | 285 | class docURLLinkSub(supermod.docURLLink): 286 | def __init__(self, url=None, valueOf_='', mixedclass_=None, content_=None): 287 | supermod.docURLLink.__init__(self, mixedclass_, content_) 288 | supermod.docURLLink.subclass = docURLLinkSub 289 | # end class docURLLinkSub 290 | 291 | 292 | class docAnchorTypeSub(supermod.docAnchorType): 293 | def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None): 294 | supermod.docAnchorType.__init__(self, mixedclass_, content_) 295 | supermod.docAnchorType.subclass = docAnchorTypeSub 296 | # end class docAnchorTypeSub 297 | 298 | 299 | class docFormulaTypeSub(supermod.docFormulaType): 300 | def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None): 301 | supermod.docFormulaType.__init__(self, mixedclass_, content_) 302 | supermod.docFormulaType.subclass = docFormulaTypeSub 303 | # end class docFormulaTypeSub 304 | 305 | 306 | class docIndexEntryTypeSub(supermod.docIndexEntryType): 307 | def __init__(self, primaryie='', secondaryie=''): 308 | supermod.docIndexEntryType.__init__(self, primaryie, secondaryie) 309 | supermod.docIndexEntryType.subclass = docIndexEntryTypeSub 310 | # end class docIndexEntryTypeSub 311 | 312 | 313 | class docListTypeSub(supermod.docListType): 314 | def __init__(self, listitem=None): 315 | supermod.docListType.__init__(self, listitem) 316 | supermod.docListType.subclass = docListTypeSub 317 | # end class docListTypeSub 318 | 319 | 320 | class docListItemTypeSub(supermod.docListItemType): 321 | def __init__(self, para=None): 322 | supermod.docListItemType.__init__(self, para) 323 | supermod.docListItemType.subclass = docListItemTypeSub 324 | # end class docListItemTypeSub 325 | 326 | 327 | class docSimpleSectTypeSub(supermod.docSimpleSectType): 328 | def __init__(self, kind=None, title=None, para=None): 329 | supermod.docSimpleSectType.__init__(self, kind, title, para) 330 | supermod.docSimpleSectType.subclass = docSimpleSectTypeSub 331 | # end class docSimpleSectTypeSub 332 | 333 | 334 | class docVarListEntryTypeSub(supermod.docVarListEntryType): 335 | def __init__(self, term=None): 336 | supermod.docVarListEntryType.__init__(self, term) 337 | supermod.docVarListEntryType.subclass = docVarListEntryTypeSub 338 | # end class docVarListEntryTypeSub 339 | 340 | 341 | class docRefTextTypeSub(supermod.docRefTextType): 342 | def __init__(self, refid=None, kindref=None, external=None, valueOf_='', mixedclass_=None, content_=None): 343 | supermod.docRefTextType.__init__(self, mixedclass_, content_) 344 | supermod.docRefTextType.subclass = docRefTextTypeSub 345 | # end class docRefTextTypeSub 346 | 347 | 348 | class docTableTypeSub(supermod.docTableType): 349 | def __init__(self, rows=None, cols=None, row=None, caption=None): 350 | supermod.docTableType.__init__(self, rows, cols, row, caption) 351 | supermod.docTableType.subclass = docTableTypeSub 352 | # end class docTableTypeSub 353 | 354 | 355 | class docRowTypeSub(supermod.docRowType): 356 | def __init__(self, entry=None): 357 | supermod.docRowType.__init__(self, entry) 358 | supermod.docRowType.subclass = docRowTypeSub 359 | # end class docRowTypeSub 360 | 361 | 362 | class docEntryTypeSub(supermod.docEntryType): 363 | def __init__(self, thead=None, para=None): 364 | supermod.docEntryType.__init__(self, thead, para) 365 | supermod.docEntryType.subclass = docEntryTypeSub 366 | # end class docEntryTypeSub 367 | 368 | 369 | class docHeadingTypeSub(supermod.docHeadingType): 370 | def __init__(self, level=None, valueOf_='', mixedclass_=None, content_=None): 371 | supermod.docHeadingType.__init__(self, mixedclass_, content_) 372 | supermod.docHeadingType.subclass = docHeadingTypeSub 373 | # end class docHeadingTypeSub 374 | 375 | 376 | class docImageTypeSub(supermod.docImageType): 377 | def __init__(self, width=None, type_=None, name=None, height=None, valueOf_='', mixedclass_=None, content_=None): 378 | supermod.docImageType.__init__(self, mixedclass_, content_) 379 | supermod.docImageType.subclass = docImageTypeSub 380 | # end class docImageTypeSub 381 | 382 | 383 | class docDotFileTypeSub(supermod.docDotFileType): 384 | def __init__(self, name=None, valueOf_='', mixedclass_=None, content_=None): 385 | supermod.docDotFileType.__init__(self, mixedclass_, content_) 386 | supermod.docDotFileType.subclass = docDotFileTypeSub 387 | # end class docDotFileTypeSub 388 | 389 | 390 | class docTocItemTypeSub(supermod.docTocItemType): 391 | def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None): 392 | supermod.docTocItemType.__init__(self, mixedclass_, content_) 393 | supermod.docTocItemType.subclass = docTocItemTypeSub 394 | # end class docTocItemTypeSub 395 | 396 | 397 | class docTocListTypeSub(supermod.docTocListType): 398 | def __init__(self, tocitem=None): 399 | supermod.docTocListType.__init__(self, tocitem) 400 | supermod.docTocListType.subclass = docTocListTypeSub 401 | # end class docTocListTypeSub 402 | 403 | 404 | class docLanguageTypeSub(supermod.docLanguageType): 405 | def __init__(self, langid=None, para=None): 406 | supermod.docLanguageType.__init__(self, langid, para) 407 | supermod.docLanguageType.subclass = docLanguageTypeSub 408 | # end class docLanguageTypeSub 409 | 410 | 411 | class docParamListTypeSub(supermod.docParamListType): 412 | def __init__(self, kind=None, parameteritem=None): 413 | supermod.docParamListType.__init__(self, kind, parameteritem) 414 | supermod.docParamListType.subclass = docParamListTypeSub 415 | # end class docParamListTypeSub 416 | 417 | 418 | class docParamListItemSub(supermod.docParamListItem): 419 | def __init__(self, parameternamelist=None, parameterdescription=None): 420 | supermod.docParamListItem.__init__(self, parameternamelist, parameterdescription) 421 | supermod.docParamListItem.subclass = docParamListItemSub 422 | # end class docParamListItemSub 423 | 424 | 425 | class docParamNameListSub(supermod.docParamNameList): 426 | def __init__(self, parametername=None): 427 | supermod.docParamNameList.__init__(self, parametername) 428 | supermod.docParamNameList.subclass = docParamNameListSub 429 | # end class docParamNameListSub 430 | 431 | 432 | class docParamNameSub(supermod.docParamName): 433 | def __init__(self, direction=None, ref=None, mixedclass_=None, content_=None): 434 | supermod.docParamName.__init__(self, mixedclass_, content_) 435 | supermod.docParamName.subclass = docParamNameSub 436 | # end class docParamNameSub 437 | 438 | 439 | class docXRefSectTypeSub(supermod.docXRefSectType): 440 | def __init__(self, id=None, xreftitle=None, xrefdescription=None): 441 | supermod.docXRefSectType.__init__(self, id, xreftitle, xrefdescription) 442 | supermod.docXRefSectType.subclass = docXRefSectTypeSub 443 | # end class docXRefSectTypeSub 444 | 445 | 446 | class docCopyTypeSub(supermod.docCopyType): 447 | def __init__(self, link=None, para=None, sect1=None, internal=None): 448 | supermod.docCopyType.__init__(self, link, para, sect1, internal) 449 | supermod.docCopyType.subclass = docCopyTypeSub 450 | # end class docCopyTypeSub 451 | 452 | 453 | class docCharTypeSub(supermod.docCharType): 454 | def __init__(self, char=None, valueOf_=''): 455 | supermod.docCharType.__init__(self, char) 456 | supermod.docCharType.subclass = docCharTypeSub 457 | # end class docCharTypeSub 458 | 459 | class docParaTypeSub(supermod.docParaType): 460 | def __init__(self, char=None, valueOf_=''): 461 | supermod.docParaType.__init__(self, char) 462 | 463 | self.parameterlist = [] 464 | self.simplesects = [] 465 | self.content = [] 466 | 467 | def buildChildren(self, child_, nodeName_): 468 | supermod.docParaType.buildChildren(self, child_, nodeName_) 469 | 470 | if child_.nodeType == Node.TEXT_NODE: 471 | obj_ = self.mixedclass_(MixedContainer.CategoryText, 472 | MixedContainer.TypeNone, '', child_.nodeValue) 473 | self.content.append(obj_) 474 | elif child_.nodeType == Node.ELEMENT_NODE and \ 475 | nodeName_ == "ref": 476 | obj_ = supermod.docRefTextType.factory() 477 | obj_.build(child_) 478 | self.content.append(obj_) 479 | elif child_.nodeType == Node.ELEMENT_NODE and \ 480 | nodeName_ == 'parameterlist': 481 | obj_ = supermod.docParamListType.factory() 482 | obj_.build(child_) 483 | self.parameterlist.append(obj_) 484 | elif child_.nodeType == Node.ELEMENT_NODE and \ 485 | nodeName_ == 'simplesect': 486 | obj_ = supermod.docSimpleSectType.factory() 487 | obj_.build(child_) 488 | self.simplesects.append(obj_) 489 | 490 | 491 | supermod.docParaType.subclass = docParaTypeSub 492 | # end class docParaTypeSub 493 | 494 | 495 | 496 | def parse(inFilename): 497 | doc = minidom.parse(inFilename) 498 | rootNode = doc.documentElement 499 | rootObj = supermod.DoxygenType.factory() 500 | rootObj.build(rootNode) 501 | return rootObj 502 | 503 | 504 | -------------------------------------------------------------------------------- /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 | from . import compound 12 | 13 | from . 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 | -------------------------------------------------------------------------------- /docs/doxygen/doxyxml/generated/indexsuper.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # 4 | # Generated Thu Jun 11 18:43:54 2009 by generateDS.py. 5 | # 6 | 7 | 8 | import sys 9 | 10 | from xml.dom import minidom 11 | from xml.dom import Node 12 | 13 | # 14 | # User methods 15 | # 16 | # Calls to the methods in these classes are generated by generateDS.py. 17 | # You can replace these methods by re-implementing the following class 18 | # in a module named generatedssuper.py. 19 | 20 | try: 21 | from generatedssuper import GeneratedsSuper 22 | except ImportError as exp: 23 | 24 | class GeneratedsSuper(object): 25 | def format_string(self, input_data, input_name=''): 26 | return input_data 27 | def format_integer(self, input_data, input_name=''): 28 | return '%d' % input_data 29 | def format_float(self, input_data, input_name=''): 30 | return '%f' % input_data 31 | def format_double(self, input_data, input_name=''): 32 | return '%e' % input_data 33 | def format_boolean(self, input_data, input_name=''): 34 | return '%s' % input_data 35 | 36 | 37 | # 38 | # If you have installed IPython you can uncomment and use the following. 39 | # IPython is available from http://ipython.scipy.org/. 40 | # 41 | 42 | ## from IPython.Shell import IPShellEmbed 43 | ## args = '' 44 | ## ipshell = IPShellEmbed(args, 45 | ## banner = 'Dropping into IPython', 46 | ## exit_msg = 'Leaving Interpreter, back to program.') 47 | 48 | # Then use the following line where and when you want to drop into the 49 | # IPython shell: 50 | # ipshell(' -- Entering ipshell.\nHit Ctrl-D to exit') 51 | 52 | # 53 | # Globals 54 | # 55 | 56 | ExternalEncoding = 'ascii' 57 | 58 | # 59 | # Support/utility functions. 60 | # 61 | 62 | def showIndent(outfile, level): 63 | for idx in range(level): 64 | outfile.write(' ') 65 | 66 | def quote_xml(inStr): 67 | s1 = (isinstance(inStr, str) and inStr or 68 | '%s' % inStr) 69 | s1 = s1.replace('&', '&') 70 | s1 = s1.replace('<', '<') 71 | s1 = s1.replace('>', '>') 72 | return s1 73 | 74 | def quote_attrib(inStr): 75 | s1 = (isinstance(inStr, str) and inStr or 76 | '%s' % inStr) 77 | s1 = s1.replace('&', '&') 78 | s1 = s1.replace('<', '<') 79 | s1 = s1.replace('>', '>') 80 | if '"' in s1: 81 | if "'" in s1: 82 | s1 = '"%s"' % s1.replace('"', """) 83 | else: 84 | s1 = "'%s'" % s1 85 | else: 86 | s1 = '"%s"' % s1 87 | return s1 88 | 89 | def quote_python(inStr): 90 | s1 = inStr 91 | if s1.find("'") == -1: 92 | if s1.find('\n') == -1: 93 | return "'%s'" % s1 94 | else: 95 | return "'''%s'''" % s1 96 | else: 97 | if s1.find('"') != -1: 98 | s1 = s1.replace('"', '\\"') 99 | if s1.find('\n') == -1: 100 | return '"%s"' % s1 101 | else: 102 | return '"""%s"""' % s1 103 | 104 | 105 | class MixedContainer(object): 106 | # Constants for category: 107 | CategoryNone = 0 108 | CategoryText = 1 109 | CategorySimple = 2 110 | CategoryComplex = 3 111 | # Constants for content_type: 112 | TypeNone = 0 113 | TypeText = 1 114 | TypeString = 2 115 | TypeInteger = 3 116 | TypeFloat = 4 117 | TypeDecimal = 5 118 | TypeDouble = 6 119 | TypeBoolean = 7 120 | def __init__(self, category, content_type, name, value): 121 | self.category = category 122 | self.content_type = content_type 123 | self.name = name 124 | self.value = value 125 | def getCategory(self): 126 | return self.category 127 | def getContenttype(self, content_type): 128 | return self.content_type 129 | def getValue(self): 130 | return self.value 131 | def getName(self): 132 | return self.name 133 | def export(self, outfile, level, name, namespace): 134 | if self.category == MixedContainer.CategoryText: 135 | outfile.write(self.value) 136 | elif self.category == MixedContainer.CategorySimple: 137 | self.exportSimple(outfile, level, name) 138 | else: # category == MixedContainer.CategoryComplex 139 | self.value.export(outfile, level, namespace,name) 140 | def exportSimple(self, outfile, level, name): 141 | if self.content_type == MixedContainer.TypeString: 142 | outfile.write('<%s>%s' % (self.name, self.value, self.name)) 143 | elif self.content_type == MixedContainer.TypeInteger or \ 144 | self.content_type == MixedContainer.TypeBoolean: 145 | outfile.write('<%s>%d' % (self.name, self.value, self.name)) 146 | elif self.content_type == MixedContainer.TypeFloat or \ 147 | self.content_type == MixedContainer.TypeDecimal: 148 | outfile.write('<%s>%f' % (self.name, self.value, self.name)) 149 | elif self.content_type == MixedContainer.TypeDouble: 150 | outfile.write('<%s>%g' % (self.name, self.value, self.name)) 151 | def exportLiteral(self, outfile, level, name): 152 | if self.category == MixedContainer.CategoryText: 153 | showIndent(outfile, level) 154 | outfile.write('MixedContainer(%d, %d, "%s", "%s"),\n' % \ 155 | (self.category, self.content_type, self.name, self.value)) 156 | elif self.category == MixedContainer.CategorySimple: 157 | showIndent(outfile, level) 158 | outfile.write('MixedContainer(%d, %d, "%s", "%s"),\n' % \ 159 | (self.category, self.content_type, self.name, self.value)) 160 | else: # category == MixedContainer.CategoryComplex 161 | showIndent(outfile, level) 162 | outfile.write('MixedContainer(%d, %d, "%s",\n' % \ 163 | (self.category, self.content_type, self.name,)) 164 | self.value.exportLiteral(outfile, level + 1) 165 | showIndent(outfile, level) 166 | outfile.write(')\n') 167 | 168 | 169 | class _MemberSpec(object): 170 | def __init__(self, name='', data_type='', container=0): 171 | self.name = name 172 | self.data_type = data_type 173 | self.container = container 174 | def set_name(self, name): self.name = name 175 | def get_name(self): return self.name 176 | def set_data_type(self, data_type): self.data_type = data_type 177 | def get_data_type(self): return self.data_type 178 | def set_container(self, container): self.container = container 179 | def get_container(self): return self.container 180 | 181 | 182 | # 183 | # Data representation classes. 184 | # 185 | 186 | class DoxygenType(GeneratedsSuper): 187 | subclass = None 188 | superclass = None 189 | def __init__(self, version=None, compound=None): 190 | self.version = version 191 | if compound is None: 192 | self.compound = [] 193 | else: 194 | self.compound = compound 195 | def factory(*args_, **kwargs_): 196 | if DoxygenType.subclass: 197 | return DoxygenType.subclass(*args_, **kwargs_) 198 | else: 199 | return DoxygenType(*args_, **kwargs_) 200 | factory = staticmethod(factory) 201 | def get_compound(self): return self.compound 202 | def set_compound(self, compound): self.compound = compound 203 | def add_compound(self, value): self.compound.append(value) 204 | def insert_compound(self, index, value): self.compound[index] = value 205 | def get_version(self): return self.version 206 | def set_version(self, version): self.version = version 207 | def export(self, outfile, level, namespace_='', name_='DoxygenType', namespacedef_=''): 208 | showIndent(outfile, level) 209 | outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, )) 210 | self.exportAttributes(outfile, level, namespace_, name_='DoxygenType') 211 | if self.hasContent_(): 212 | outfile.write('>\n') 213 | self.exportChildren(outfile, level + 1, namespace_, name_) 214 | showIndent(outfile, level) 215 | outfile.write('\n' % (namespace_, name_)) 216 | else: 217 | outfile.write(' />\n') 218 | def exportAttributes(self, outfile, level, namespace_='', name_='DoxygenType'): 219 | outfile.write(' version=%s' % (self.format_string(quote_attrib(self.version).encode(ExternalEncoding), input_name='version'), )) 220 | def exportChildren(self, outfile, level, namespace_='', name_='DoxygenType'): 221 | for compound_ in self.compound: 222 | compound_.export(outfile, level, namespace_, name_='compound') 223 | def hasContent_(self): 224 | if ( 225 | self.compound is not None 226 | ): 227 | return True 228 | else: 229 | return False 230 | def exportLiteral(self, outfile, level, name_='DoxygenType'): 231 | level += 1 232 | self.exportLiteralAttributes(outfile, level, name_) 233 | if self.hasContent_(): 234 | self.exportLiteralChildren(outfile, level, name_) 235 | def exportLiteralAttributes(self, outfile, level, name_): 236 | if self.version is not None: 237 | showIndent(outfile, level) 238 | outfile.write('version = %s,\n' % (self.version,)) 239 | def exportLiteralChildren(self, outfile, level, name_): 240 | showIndent(outfile, level) 241 | outfile.write('compound=[\n') 242 | level += 1 243 | for compound in self.compound: 244 | showIndent(outfile, level) 245 | outfile.write('model_.compound(\n') 246 | compound.exportLiteral(outfile, level, name_='compound') 247 | showIndent(outfile, level) 248 | outfile.write('),\n') 249 | level -= 1 250 | showIndent(outfile, level) 251 | outfile.write('],\n') 252 | def build(self, node_): 253 | attrs = node_.attributes 254 | self.buildAttributes(attrs) 255 | for child_ in node_.childNodes: 256 | nodeName_ = child_.nodeName.split(':')[-1] 257 | self.buildChildren(child_, nodeName_) 258 | def buildAttributes(self, attrs): 259 | if attrs.get('version'): 260 | self.version = attrs.get('version').value 261 | def buildChildren(self, child_, nodeName_): 262 | if child_.nodeType == Node.ELEMENT_NODE and \ 263 | nodeName_ == 'compound': 264 | obj_ = CompoundType.factory() 265 | obj_.build(child_) 266 | self.compound.append(obj_) 267 | # end class DoxygenType 268 | 269 | 270 | class CompoundType(GeneratedsSuper): 271 | subclass = None 272 | superclass = None 273 | def __init__(self, kind=None, refid=None, name=None, member=None): 274 | self.kind = kind 275 | self.refid = refid 276 | self.name = name 277 | if member is None: 278 | self.member = [] 279 | else: 280 | self.member = member 281 | def factory(*args_, **kwargs_): 282 | if CompoundType.subclass: 283 | return CompoundType.subclass(*args_, **kwargs_) 284 | else: 285 | return CompoundType(*args_, **kwargs_) 286 | factory = staticmethod(factory) 287 | def get_name(self): return self.name 288 | def set_name(self, name): self.name = name 289 | def get_member(self): return self.member 290 | def set_member(self, member): self.member = member 291 | def add_member(self, value): self.member.append(value) 292 | def insert_member(self, index, value): self.member[index] = value 293 | def get_kind(self): return self.kind 294 | def set_kind(self, kind): self.kind = kind 295 | def get_refid(self): return self.refid 296 | def set_refid(self, refid): self.refid = refid 297 | def export(self, outfile, level, namespace_='', name_='CompoundType', namespacedef_=''): 298 | showIndent(outfile, level) 299 | outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, )) 300 | self.exportAttributes(outfile, level, namespace_, name_='CompoundType') 301 | if self.hasContent_(): 302 | outfile.write('>\n') 303 | self.exportChildren(outfile, level + 1, namespace_, name_) 304 | showIndent(outfile, level) 305 | outfile.write('\n' % (namespace_, name_)) 306 | else: 307 | outfile.write(' />\n') 308 | def exportAttributes(self, outfile, level, namespace_='', name_='CompoundType'): 309 | outfile.write(' kind=%s' % (quote_attrib(self.kind), )) 310 | outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), )) 311 | def exportChildren(self, outfile, level, namespace_='', name_='CompoundType'): 312 | if self.name is not None: 313 | showIndent(outfile, level) 314 | outfile.write('<%sname>%s\n' % (namespace_, self.format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_)) 315 | for member_ in self.member: 316 | member_.export(outfile, level, namespace_, name_='member') 317 | def hasContent_(self): 318 | if ( 319 | self.name is not None or 320 | self.member is not None 321 | ): 322 | return True 323 | else: 324 | return False 325 | def exportLiteral(self, outfile, level, name_='CompoundType'): 326 | level += 1 327 | self.exportLiteralAttributes(outfile, level, name_) 328 | if self.hasContent_(): 329 | self.exportLiteralChildren(outfile, level, name_) 330 | def exportLiteralAttributes(self, outfile, level, name_): 331 | if self.kind is not None: 332 | showIndent(outfile, level) 333 | outfile.write('kind = "%s",\n' % (self.kind,)) 334 | if self.refid is not None: 335 | showIndent(outfile, level) 336 | outfile.write('refid = %s,\n' % (self.refid,)) 337 | def exportLiteralChildren(self, outfile, level, name_): 338 | showIndent(outfile, level) 339 | outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding)) 340 | showIndent(outfile, level) 341 | outfile.write('member=[\n') 342 | level += 1 343 | for member in self.member: 344 | showIndent(outfile, level) 345 | outfile.write('model_.member(\n') 346 | member.exportLiteral(outfile, level, name_='member') 347 | showIndent(outfile, level) 348 | outfile.write('),\n') 349 | level -= 1 350 | showIndent(outfile, level) 351 | outfile.write('],\n') 352 | def build(self, node_): 353 | attrs = node_.attributes 354 | self.buildAttributes(attrs) 355 | for child_ in node_.childNodes: 356 | nodeName_ = child_.nodeName.split(':')[-1] 357 | self.buildChildren(child_, nodeName_) 358 | def buildAttributes(self, attrs): 359 | if attrs.get('kind'): 360 | self.kind = attrs.get('kind').value 361 | if attrs.get('refid'): 362 | self.refid = attrs.get('refid').value 363 | def buildChildren(self, child_, nodeName_): 364 | if child_.nodeType == Node.ELEMENT_NODE and \ 365 | nodeName_ == 'name': 366 | name_ = '' 367 | for text__content_ in child_.childNodes: 368 | name_ += text__content_.nodeValue 369 | self.name = name_ 370 | elif child_.nodeType == Node.ELEMENT_NODE and \ 371 | nodeName_ == 'member': 372 | obj_ = MemberType.factory() 373 | obj_.build(child_) 374 | self.member.append(obj_) 375 | # end class CompoundType 376 | 377 | 378 | class MemberType(GeneratedsSuper): 379 | subclass = None 380 | superclass = None 381 | def __init__(self, kind=None, refid=None, name=None): 382 | self.kind = kind 383 | self.refid = refid 384 | self.name = name 385 | def factory(*args_, **kwargs_): 386 | if MemberType.subclass: 387 | return MemberType.subclass(*args_, **kwargs_) 388 | else: 389 | return MemberType(*args_, **kwargs_) 390 | factory = staticmethod(factory) 391 | def get_name(self): return self.name 392 | def set_name(self, name): self.name = name 393 | def get_kind(self): return self.kind 394 | def set_kind(self, kind): self.kind = kind 395 | def get_refid(self): return self.refid 396 | def set_refid(self, refid): self.refid = refid 397 | def export(self, outfile, level, namespace_='', name_='MemberType', namespacedef_=''): 398 | showIndent(outfile, level) 399 | outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, )) 400 | self.exportAttributes(outfile, level, namespace_, name_='MemberType') 401 | if self.hasContent_(): 402 | outfile.write('>\n') 403 | self.exportChildren(outfile, level + 1, namespace_, name_) 404 | showIndent(outfile, level) 405 | outfile.write('\n' % (namespace_, name_)) 406 | else: 407 | outfile.write(' />\n') 408 | def exportAttributes(self, outfile, level, namespace_='', name_='MemberType'): 409 | outfile.write(' kind=%s' % (quote_attrib(self.kind), )) 410 | outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), )) 411 | def exportChildren(self, outfile, level, namespace_='', name_='MemberType'): 412 | if self.name is not None: 413 | showIndent(outfile, level) 414 | outfile.write('<%sname>%s\n' % (namespace_, self.format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_)) 415 | def hasContent_(self): 416 | if ( 417 | self.name is not None 418 | ): 419 | return True 420 | else: 421 | return False 422 | def exportLiteral(self, outfile, level, name_='MemberType'): 423 | level += 1 424 | self.exportLiteralAttributes(outfile, level, name_) 425 | if self.hasContent_(): 426 | self.exportLiteralChildren(outfile, level, name_) 427 | def exportLiteralAttributes(self, outfile, level, name_): 428 | if self.kind is not None: 429 | showIndent(outfile, level) 430 | outfile.write('kind = "%s",\n' % (self.kind,)) 431 | if self.refid is not None: 432 | showIndent(outfile, level) 433 | outfile.write('refid = %s,\n' % (self.refid,)) 434 | def exportLiteralChildren(self, outfile, level, name_): 435 | showIndent(outfile, level) 436 | outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding)) 437 | def build(self, node_): 438 | attrs = node_.attributes 439 | self.buildAttributes(attrs) 440 | for child_ in node_.childNodes: 441 | nodeName_ = child_.nodeName.split(':')[-1] 442 | self.buildChildren(child_, nodeName_) 443 | def buildAttributes(self, attrs): 444 | if attrs.get('kind'): 445 | self.kind = attrs.get('kind').value 446 | if attrs.get('refid'): 447 | self.refid = attrs.get('refid').value 448 | def buildChildren(self, child_, nodeName_): 449 | if child_.nodeType == Node.ELEMENT_NODE and \ 450 | nodeName_ == 'name': 451 | name_ = '' 452 | for text__content_ in child_.childNodes: 453 | name_ += text__content_.nodeValue 454 | self.name = name_ 455 | # end class MemberType 456 | 457 | 458 | USAGE_TEXT = """ 459 | Usage: python .py [ -s ] 460 | Options: 461 | -s Use the SAX parser, not the minidom parser. 462 | """ 463 | 464 | def usage(): 465 | print(USAGE_TEXT) 466 | sys.exit(1) 467 | 468 | 469 | def parse(inFileName): 470 | doc = minidom.parse(inFileName) 471 | rootNode = doc.documentElement 472 | rootObj = DoxygenType.factory() 473 | rootObj.build(rootNode) 474 | # Enable Python to collect the space used by the DOM. 475 | doc = None 476 | sys.stdout.write('\n') 477 | rootObj.export(sys.stdout, 0, name_="doxygenindex", 478 | namespacedef_='') 479 | return rootObj 480 | 481 | 482 | def parseString(inString): 483 | doc = minidom.parseString(inString) 484 | rootNode = doc.documentElement 485 | rootObj = DoxygenType.factory() 486 | rootObj.build(rootNode) 487 | # Enable Python to collect the space used by the DOM. 488 | doc = None 489 | sys.stdout.write('\n') 490 | rootObj.export(sys.stdout, 0, name_="doxygenindex", 491 | namespacedef_='') 492 | return rootObj 493 | 494 | 495 | def parseLiteral(inFileName): 496 | doc = minidom.parse(inFileName) 497 | rootNode = doc.documentElement 498 | rootObj = DoxygenType.factory() 499 | rootObj.build(rootNode) 500 | # Enable Python to collect the space used by the DOM. 501 | doc = None 502 | sys.stdout.write('from index import *\n\n') 503 | sys.stdout.write('rootObj = doxygenindex(\n') 504 | rootObj.exportLiteral(sys.stdout, 0, name_="doxygenindex") 505 | sys.stdout.write(')\n') 506 | return rootObj 507 | 508 | 509 | def main(): 510 | args = sys.argv[1:] 511 | if len(args) == 1: 512 | parse(args[0]) 513 | else: 514 | usage() 515 | 516 | 517 | 518 | 519 | if __name__ == '__main__': 520 | main() 521 | #import pdb 522 | #pdb.run('main()') 523 | -------------------------------------------------------------------------------- /docs/doxygen/doxyxml/text.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2010 Free Software Foundation, Inc. 3 | # 4 | # This file was generated by gr_modtool, a tool from the GNU Radio framework 5 | # This file is a part of gr-dvbgse 6 | # 7 | # SPDX-License-Identifier: GPL-3.0-or-later 8 | # 9 | # 10 | """ 11 | Utilities for extracting text from generated classes. 12 | """ 13 | 14 | def is_string(txt): 15 | if isinstance(txt, str): 16 | return True 17 | try: 18 | if isinstance(txt, str): 19 | return True 20 | except NameError: 21 | pass 22 | return False 23 | 24 | def description(obj): 25 | if obj is None: 26 | return None 27 | return description_bit(obj).strip() 28 | 29 | def description_bit(obj): 30 | if hasattr(obj, 'content'): 31 | contents = [description_bit(item) for item in obj.content] 32 | result = ''.join(contents) 33 | elif hasattr(obj, 'content_'): 34 | contents = [description_bit(item) for item in obj.content_] 35 | result = ''.join(contents) 36 | elif hasattr(obj, 'value'): 37 | result = description_bit(obj.value) 38 | elif is_string(obj): 39 | return obj 40 | else: 41 | raise Exception('Expecting a string or something with content, content_ or value attribute') 42 | # If this bit is a paragraph then add one some line breaks. 43 | if hasattr(obj, 'name') and obj.name == 'para': 44 | result += "\n\n" 45 | return result 46 | -------------------------------------------------------------------------------- /docs/doxygen/other/group_defs.dox: -------------------------------------------------------------------------------- 1 | /*! 2 | * \defgroup block GNU Radio DVBGSE C++ Signal Processing Blocks 3 | * \brief All C++ blocks that can be used from the DVBGSE GNU Radio 4 | * module are listed here or in the subcategories below. 5 | * 6 | */ 7 | 8 | -------------------------------------------------------------------------------- /docs/doxygen/other/main_page.dox: -------------------------------------------------------------------------------- 1 | /*! \mainpage 2 | 3 | Welcome to the GNU Radio DVBGSE Block 4 | 5 | This is the intro page for the Doxygen manual generated for the DVBGSE 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 | -------------------------------------------------------------------------------- /docs/doxygen/pydoc_macros.h: -------------------------------------------------------------------------------- 1 | #ifndef PYDOC_MACROS_H 2 | #define PYDOC_MACROS_H 3 | 4 | #define __EXPAND(x) x 5 | #define __COUNT(_1, _2, _3, _4, _5, _6, _7, COUNT, ...) COUNT 6 | #define __VA_SIZE(...) __EXPAND(__COUNT(__VA_ARGS__, 7, 6, 5, 4, 3, 2, 1)) 7 | #define __CAT1(a, b) a##b 8 | #define __CAT2(a, b) __CAT1(a, b) 9 | #define __DOC1(n1) __doc_##n1 10 | #define __DOC2(n1, n2) __doc_##n1##_##n2 11 | #define __DOC3(n1, n2, n3) __doc_##n1##_##n2##_##n3 12 | #define __DOC4(n1, n2, n3, n4) __doc_##n1##_##n2##_##n3##_##n4 13 | #define __DOC5(n1, n2, n3, n4, n5) __doc_##n1##_##n2##_##n3##_##n4##_##n5 14 | #define __DOC6(n1, n2, n3, n4, n5, n6) __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6 15 | #define __DOC7(n1, n2, n3, n4, n5, n6, n7) \ 16 | __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6##_##n7 17 | #define DOC(...) __EXPAND(__EXPAND(__CAT2(__DOC, __VA_SIZE(__VA_ARGS__)))(__VA_ARGS__)) 18 | 19 | #endif // PYDOC_MACROS_H -------------------------------------------------------------------------------- /docs/doxygen/update_pydoc.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2010-2012 Free Software Foundation, Inc. 3 | # 4 | # This file was generated by gr_modtool, a tool from the GNU Radio framework 5 | # This file is a part of gnuradio 6 | # 7 | # SPDX-License-Identifier: GPL-3.0-or-later 8 | # 9 | # 10 | """ 11 | Updates the *pydoc_h files for a module 12 | Execute using: python update_pydoc.py xml_path outputfilename 13 | 14 | The file instructs Pybind11 to transfer the doxygen comments into the 15 | python docstrings. 16 | 17 | """ 18 | 19 | import os, sys, time, glob, re, json 20 | from argparse import ArgumentParser 21 | 22 | from doxyxml import DoxyIndex, DoxyClass, DoxyFriend, DoxyFunction, DoxyFile 23 | from doxyxml import DoxyOther, base 24 | 25 | def py_name(name): 26 | bits = name.split('_') 27 | return '_'.join(bits[1:]) 28 | 29 | def make_name(name): 30 | bits = name.split('_') 31 | return bits[0] + '_make_' + '_'.join(bits[1:]) 32 | 33 | 34 | class Block(object): 35 | """ 36 | Checks if doxyxml produced objects correspond to a gnuradio block. 37 | """ 38 | 39 | @classmethod 40 | def includes(cls, item): 41 | if not isinstance(item, DoxyClass): 42 | return False 43 | # Check for a parsing error. 44 | if item.error(): 45 | return False 46 | friendname = make_name(item.name()) 47 | is_a_block = item.has_member(friendname, DoxyFriend) 48 | # But now sometimes the make function isn't a friend so check again. 49 | if not is_a_block: 50 | is_a_block = di.has_member(friendname, DoxyFunction) 51 | return is_a_block 52 | 53 | class Block2(object): 54 | """ 55 | Checks if doxyxml produced objects correspond to a new style 56 | gnuradio block. 57 | """ 58 | 59 | @classmethod 60 | def includes(cls, item): 61 | if not isinstance(item, DoxyClass): 62 | return False 63 | # Check for a parsing error. 64 | if item.error(): 65 | return False 66 | is_a_block2 = item.has_member('make', DoxyFunction) and item.has_member('sptr', DoxyOther) 67 | return is_a_block2 68 | 69 | 70 | def utoascii(text): 71 | """ 72 | Convert unicode text into ascii and escape quotes and backslashes. 73 | """ 74 | if text is None: 75 | return '' 76 | out = text.encode('ascii', 'replace') 77 | # swig will require us to replace blackslash with 4 backslashes 78 | # TODO: evaluate what this should be for pybind11 79 | out = out.replace(b'\\', b'\\\\\\\\') 80 | out = out.replace(b'"', b'\\"').decode('ascii') 81 | return str(out) 82 | 83 | 84 | def combine_descriptions(obj): 85 | """ 86 | Combines the brief and detailed descriptions of an object together. 87 | """ 88 | description = [] 89 | bd = obj.brief_description.strip() 90 | dd = obj.detailed_description.strip() 91 | if bd: 92 | description.append(bd) 93 | if dd: 94 | description.append(dd) 95 | return utoascii('\n\n'.join(description)).strip() 96 | 97 | def format_params(parameteritems): 98 | output = ['Args:'] 99 | template = ' {0} : {1}' 100 | for pi in parameteritems: 101 | output.append(template.format(pi.name, pi.description)) 102 | return '\n'.join(output) 103 | 104 | entry_templ = '%feature("docstring") {name} "{docstring}"' 105 | def make_entry(obj, name=None, templ="{description}", description=None, params=[]): 106 | """ 107 | Create a docstring key/value pair, where the key is the object name. 108 | 109 | obj - a doxyxml object from which documentation will be extracted. 110 | name - the name of the C object (defaults to obj.name()) 111 | templ - an optional template for the docstring containing only one 112 | variable named 'description'. 113 | description - if this optional variable is set then it's value is 114 | used as the description instead of extracting it from obj. 115 | """ 116 | if name is None: 117 | name=obj.name() 118 | if hasattr(obj,'_parse_data') and hasattr(obj._parse_data,'definition'): 119 | name=obj._parse_data.definition.split(' ')[-1] 120 | if "operator " in name: 121 | return '' 122 | if description is None: 123 | description = combine_descriptions(obj) 124 | if params: 125 | description += '\n\n' 126 | description += utoascii(format_params(params)) 127 | docstring = templ.format(description=description) 128 | 129 | return {name: docstring} 130 | 131 | 132 | def make_class_entry(klass, description=None, ignored_methods=[], params=None): 133 | """ 134 | Create a class docstring key/value pair. 135 | """ 136 | if params is None: 137 | params = klass.params 138 | output = {} 139 | output.update(make_entry(klass, description=description, params=params)) 140 | for func in klass.in_category(DoxyFunction): 141 | if func.name() not in ignored_methods: 142 | name = klass.name() + '::' + func.name() 143 | output.update(make_entry(func, name=name)) 144 | return output 145 | 146 | 147 | def make_block_entry(di, block): 148 | """ 149 | Create class and function docstrings of a gnuradio block 150 | """ 151 | descriptions = [] 152 | # Get the documentation associated with the class. 153 | class_desc = combine_descriptions(block) 154 | if class_desc: 155 | descriptions.append(class_desc) 156 | # Get the documentation associated with the make function 157 | make_func = di.get_member(make_name(block.name()), DoxyFunction) 158 | make_func_desc = combine_descriptions(make_func) 159 | if make_func_desc: 160 | descriptions.append(make_func_desc) 161 | # Get the documentation associated with the file 162 | try: 163 | block_file = di.get_member(block.name() + ".h", DoxyFile) 164 | file_desc = combine_descriptions(block_file) 165 | if file_desc: 166 | descriptions.append(file_desc) 167 | except base.Base.NoSuchMember: 168 | # Don't worry if we can't find a matching file. 169 | pass 170 | # And join them all together to make a super duper description. 171 | super_description = "\n\n".join(descriptions) 172 | # Associate the combined description with the class and 173 | # the make function. 174 | output = {} 175 | output.update(make_class_entry(block, description=super_description)) 176 | output.update(make_entry(make_func, description=super_description, 177 | params=block.params)) 178 | return output 179 | 180 | def make_block2_entry(di, block): 181 | """ 182 | Create class and function docstrings of a new style gnuradio block 183 | """ 184 | # For new style blocks all the relevant documentation should be 185 | # associated with the 'make' method. 186 | class_description = combine_descriptions(block) 187 | make_func = block.get_member('make', DoxyFunction) 188 | make_description = combine_descriptions(make_func) 189 | description = class_description + "\n\nConstructor Specific Documentation:\n\n" + make_description 190 | # Associate the combined description with the class and 191 | # the make function. 192 | output = {} 193 | output.update(make_class_entry( 194 | block, description=description, 195 | ignored_methods=['make'], params=make_func.params)) 196 | makename = block.name() + '::make' 197 | output.update(make_entry( 198 | make_func, name=makename, description=description, 199 | params=make_func.params)) 200 | return output 201 | 202 | def get_docstrings_dict(di, custom_output=None): 203 | 204 | output = {} 205 | if custom_output: 206 | output.update(custom_output) 207 | 208 | # Create docstrings for the blocks. 209 | blocks = di.in_category(Block) 210 | blocks2 = di.in_category(Block2) 211 | 212 | make_funcs = set([]) 213 | for block in blocks: 214 | try: 215 | make_func = di.get_member(make_name(block.name()), DoxyFunction) 216 | # Don't want to risk writing to output twice. 217 | if make_func.name() not in make_funcs: 218 | make_funcs.add(make_func.name()) 219 | output.update(make_block_entry(di, block)) 220 | except block.ParsingError: 221 | sys.stderr.write('Parsing error for block {0}\n'.format(block.name())) 222 | raise 223 | 224 | for block in blocks2: 225 | try: 226 | make_func = block.get_member('make', DoxyFunction) 227 | make_func_name = block.name() +'::make' 228 | # Don't want to risk writing to output twice. 229 | if make_func_name not in make_funcs: 230 | make_funcs.add(make_func_name) 231 | output.update(make_block2_entry(di, block)) 232 | except block.ParsingError: 233 | sys.stderr.write('Parsing error for block {0}\n'.format(block.name())) 234 | raise 235 | 236 | # Create docstrings for functions 237 | # Don't include the make functions since they have already been dealt with. 238 | funcs = [f for f in di.in_category(DoxyFunction) 239 | if f.name() not in make_funcs and not f.name().startswith('std::')] 240 | for f in funcs: 241 | try: 242 | output.update(make_entry(f)) 243 | except f.ParsingError: 244 | sys.stderr.write('Parsing error for function {0}\n'.format(f.name())) 245 | 246 | # Create docstrings for classes 247 | block_names = [block.name() for block in blocks] 248 | block_names += [block.name() for block in blocks2] 249 | klasses = [k for k in di.in_category(DoxyClass) 250 | if k.name() not in block_names and not k.name().startswith('std::')] 251 | for k in klasses: 252 | try: 253 | output.update(make_class_entry(k)) 254 | except k.ParsingError: 255 | sys.stderr.write('Parsing error for class {0}\n'.format(k.name())) 256 | 257 | # Docstrings are not created for anything that is not a function or a class. 258 | # If this excludes anything important please add it here. 259 | 260 | return output 261 | 262 | def sub_docstring_in_pydoc_h(pydoc_files, docstrings_dict, output_dir, filter_str=None): 263 | if filter_str: 264 | docstrings_dict = {k: v for k, v in docstrings_dict.items() if k.startswith(filter_str)} 265 | 266 | with open(os.path.join(output_dir,'docstring_status'),'w') as status_file: 267 | 268 | for pydoc_file in pydoc_files: 269 | if filter_str: 270 | filter_str2 = "::".join((filter_str,os.path.split(pydoc_file)[-1].split('_pydoc_template.h')[0])) 271 | docstrings_dict2 = {k: v for k, v in docstrings_dict.items() if k.startswith(filter_str2)} 272 | else: 273 | docstrings_dict2 = docstrings_dict 274 | 275 | 276 | 277 | file_in = open(pydoc_file,'r').read() 278 | for key, value in docstrings_dict2.items(): 279 | file_in_tmp = file_in 280 | try: 281 | doc_key = key.split("::") 282 | # if 'gr' in doc_key: 283 | # doc_key.remove('gr') 284 | doc_key = '_'.join(doc_key) 285 | regexp = r'(__doc_{} =\sR\"doc\()[^)]*(\)doc\")'.format(doc_key) 286 | regexp = re.compile(regexp, re.MULTILINE) 287 | 288 | (file_in, nsubs) = regexp.subn(r'\1'+value+r'\2', file_in, count=1) 289 | if nsubs == 1: 290 | status_file.write("PASS: " + pydoc_file + "\n") 291 | except KeyboardInterrupt: 292 | raise KeyboardInterrupt 293 | except: # be permissive, TODO log, but just leave the docstring blank 294 | status_file.write("FAIL: " + pydoc_file + "\n") 295 | file_in = file_in_tmp 296 | 297 | output_pathname = os.path.join(output_dir, os.path.basename(pydoc_file).replace('_template.h','.h')) 298 | # FIXME: Remove this debug print 299 | print('output docstrings to {}'.format(output_pathname)) 300 | with open(output_pathname,'w') as file_out: 301 | file_out.write(file_in) 302 | 303 | def copy_docstring_templates(pydoc_files, output_dir): 304 | with open(os.path.join(output_dir,'docstring_status'),'w') as status_file: 305 | for pydoc_file in pydoc_files: 306 | file_in = open(pydoc_file,'r').read() 307 | output_pathname = os.path.join(output_dir, os.path.basename(pydoc_file).replace('_template.h','.h')) 308 | # FIXME: Remove this debug print 309 | print('copy docstrings to {}'.format(output_pathname)) 310 | with open(output_pathname,'w') as file_out: 311 | file_out.write(file_in) 312 | status_file.write("DONE") 313 | 314 | def argParse(): 315 | """Parses commandline args.""" 316 | desc='Scrape the doxygen generated xml for docstrings to insert into python bindings' 317 | parser = ArgumentParser(description=desc) 318 | 319 | parser.add_argument("function", help="Operation to perform on docstrings", choices=["scrape","sub","copy"]) 320 | 321 | parser.add_argument("--xml_path") 322 | parser.add_argument("--bindings_dir") 323 | parser.add_argument("--output_dir") 324 | parser.add_argument("--json_path") 325 | parser.add_argument("--filter", default=None) 326 | 327 | return parser.parse_args() 328 | 329 | if __name__ == "__main__": 330 | # Parse command line options and set up doxyxml. 331 | args = argParse() 332 | if args.function.lower() == 'scrape': 333 | di = DoxyIndex(args.xml_path) 334 | docstrings_dict = get_docstrings_dict(di) 335 | with open(args.json_path, 'w') as fp: 336 | json.dump(docstrings_dict, fp) 337 | elif args.function.lower() == 'sub': 338 | with open(args.json_path, 'r') as fp: 339 | docstrings_dict = json.load(fp) 340 | pydoc_files = glob.glob(os.path.join(args.bindings_dir,'*_pydoc_template.h')) 341 | sub_docstring_in_pydoc_h(pydoc_files, docstrings_dict, args.output_dir, args.filter) 342 | elif args.function.lower() == 'copy': 343 | pydoc_files = glob.glob(os.path.join(args.bindings_dir,'*_pydoc_template.h')) 344 | copy_docstring_templates(pydoc_files, args.output_dir) 345 | 346 | 347 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /grc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file was generated by gr_modtool, a tool from the GNU Radio framework 4 | # This file is a part of gr-dvbgse 5 | # 6 | # SPDX-License-Identifier: GPL-3.0-or-later 7 | # 8 | 9 | install(FILES 10 | dvbgse_bbheader_source.block.yml 11 | dvbgse_bbheader_sink.block.yml DESTINATION share/gnuradio/grc/blocks 12 | ) 13 | -------------------------------------------------------------------------------- /grc/dvbgse_bbheader_sink.block.yml: -------------------------------------------------------------------------------- 1 | # auto-generated by grc.converter 2 | 3 | id: dvbgse_bbheader_sink 4 | label: IP Packet Sink 5 | category: '[Core]/Digital Television/DVB-GSE' 6 | 7 | parameters: 8 | - id: standard 9 | label: Standard 10 | dtype: enum 11 | options: [STANDARD_DVBS2, STANDARD_DVBT2] 12 | option_labels: [DVB-S2, DVB-T2] 13 | option_attributes: 14 | hide_dvbs2: [none, all] 15 | hide_dvbt2: [all, none] 16 | val: [dvbgse.STANDARD_DVBS2, dvbgse.STANDARD_DVBT2] 17 | - id: framesize1 18 | label: FECFRAME size 19 | dtype: enum 20 | options: [FECFRAME_NORMAL, FECFRAME_SHORT] 21 | option_labels: [Normal, Short] 22 | option_attributes: 23 | hide_medium: [all, all] 24 | hide_normal: [none, all] 25 | hide_short: [all, none] 26 | val: [dvbgse.FECFRAME_NORMAL, dvbgse.FECFRAME_SHORT] 27 | hide: ${ standard.hide_dvbt2 } 28 | - id: framesize2 29 | label: FECFRAME size 30 | dtype: enum 31 | options: [FECFRAME_NORMAL, FECFRAME_MEDIUM, FECFRAME_SHORT] 32 | option_labels: [Normal, Medium, Short] 33 | option_attributes: 34 | hide_medium: [all, none, all] 35 | hide_normal: [none, all, all] 36 | hide_short: [all, all, none] 37 | val: [dvbgse.FECFRAME_NORMAL, dvbgse.FECFRAME_MEDIUM, dvbgse.FECFRAME_SHORT] 38 | hide: ${ standard.hide_dvbs2 } 39 | - id: rate1 40 | label: Code rate 41 | dtype: enum 42 | options: [C1_2, C3_5, C2_3, C3_4, C4_5, C5_6] 43 | option_labels: [1/2, 3/5, 2/3, 3/4, 4/5, 5/6] 44 | option_attributes: 45 | val: [dvbgse.C1_2, dvbgse.C3_5, dvbgse.C2_3, dvbgse.C3_4, dvbgse.C4_5, dvbgse.C5_6] 46 | hide: ${ (framesize1.hide_normal if str(standard) == 'STANDARD_DVBT2' else 'all') 47 | } 48 | - id: rate2 49 | label: Code rate 50 | dtype: enum 51 | options: [C1_3, C2_5, C1_2, C3_5, C2_3, C3_4, C4_5, C5_6] 52 | option_labels: [1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 5/6] 53 | option_attributes: 54 | val: [dvbgse.C1_3, dvbgse.C2_5, dvbgse.C1_2, dvbgse.C3_5, dvbgse.C2_3, dvbgse.C3_4, 55 | dvbgse.C4_5, dvbgse.C5_6] 56 | hide: ${ (framesize1.hide_short if str(standard) == 'STANDARD_DVBT2' else 'all') 57 | } 58 | - id: rate3 59 | label: Code rate 60 | dtype: enum 61 | options: [C1_4, C1_3, C2_5, C1_2, C3_5, C2_3, C3_4, C4_5, C5_6, C8_9, C9_10, C2_9_VLSNR, 62 | C13_45, C9_20, C90_180, C96_180, C11_20, C100_180, C104_180, C26_45, C18_30, 63 | C28_45, C23_36, C116_180, C20_30, C124_180, C25_36, C128_180, C13_18, C132_180, 64 | C22_30, C135_180, C140_180, C7_9, C154_180] 65 | option_labels: [1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 5/6, 8/9, 9/10, 2/9 VL-SNR, 66 | 13/45, 9/20, 90/180, 96/180, 11/20, 100/180, 104/180, 26/45, 18/30, 28/45, 67 | 23/36, 116/180, 20/30, 124/180, 25/36, 128/180, 13/18, 132/180, 22/30, 135/180, 68 | 140/180, 7/9, 154/180] 69 | option_attributes: 70 | val: [dvbgse.C1_4, dvbgse.C1_3, dvbgse.C2_5, dvbgse.C1_2, dvbgse.C3_5, dvbgse.C2_3, 71 | dvbgse.C3_4, dvbgse.C4_5, dvbgse.C5_6, dvbgse.C8_9, dvbgse.C9_10, dvbgse.C2_9_VLSNR, 72 | dvbgse.C13_45, dvbgse.C9_20, dvbgse.C90_180, dvbgse.C96_180, dvbgse.C11_20, 73 | dvbgse.C100_180, dvbgse.C104_180, dvbgse.C26_45, dvbgse.C18_30, dvbgse.C28_45, 74 | dvbgse.C23_36, dvbgse.C116_180, dvbgse.C20_30, dvbgse.C124_180, dvbgse.C25_36, 75 | dvbgse.C128_180, dvbgse.C13_18, dvbgse.C132_180, dvbgse.C22_30, dvbgse.C135_180, 76 | dvbgse.C140_180, dvbgse.C7_9, dvbgse.C154_180] 77 | hide: ${ (framesize2.hide_normal if str(standard) == 'STANDARD_DVBS2' else 'all') 78 | } 79 | - id: rate4 80 | label: Code rate 81 | dtype: enum 82 | options: [C1_5_MEDIUM, C11_45_MEDIUM, C1_3_MEDIUM] 83 | option_labels: [1/5, 11/45, 1/3] 84 | option_attributes: 85 | val: [dvbgse.C1_5_MEDIUM, dvbgse.C11_45_MEDIUM, dvbgse.C1_3_MEDIUM] 86 | hide: ${ (framesize2.hide_medium if str(standard) == 'STANDARD_DVBS2' else 'all') 87 | } 88 | - id: rate5 89 | label: Code rate 90 | dtype: enum 91 | options: [C1_4, C1_3, C2_5, C1_2, C3_5, C2_3, C3_4, C4_5, C5_6, C8_9, C11_45, 92 | C4_15, C14_45, C7_15, C8_15, C26_45, C32_45, C1_5_VLSNR_SF2, C11_45_VLSNR_SF2, 93 | C1_5_VLSNR, C4_15_VLSNR, C1_3_VLSNR] 94 | option_labels: [1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 5/6, 8/9, 11/45, 4/15, 95 | 14/45, 7/15, 8/15, 26/45, 32/45, 1/5 VL-SNR SF2, 11/45 VL-SNR SF2, 1/5 VL-SNR, 96 | 4/15 VL-SNR, 1/3 VL-SNR] 97 | option_attributes: 98 | val: [dvbgse.C1_4, dvbgse.C1_3, dvbgse.C2_5, dvbgse.C1_2, dvbgse.C3_5, dvbgse.C2_3, 99 | dvbgse.C3_4, dvbgse.C4_5, dvbgse.C5_6, dvbgse.C8_9, dvbgse.C11_45, dvbgse.C4_15, 100 | dvbgse.C14_45, dvbgse.C7_15, dvbgse.C8_15, dvbgse.C26_45, dvbgse.C32_45, 101 | dvbgse.C1_5_VLSNR_SF2, dvbgse.C11_45_VLSNR_SF2, dvbgse.C1_5_VLSNR, dvbgse.C4_15_VLSNR, 102 | dvbgse.C1_3_VLSNR] 103 | hide: ${ (framesize2.hide_short if str(standard) == 'STANDARD_DVBS2' else 'all') 104 | } 105 | 106 | inputs: 107 | - domain: stream 108 | dtype: byte 109 | 110 | templates: 111 | imports: import dvbgse 112 | make: "dvbgse.bbheader_sink(${standard.val}, \n% if str(standard) == 'STANDARD_DVBT2':\n\ 113 | ${framesize1.val}, \n% else:\n${framesize2.val}, \n% endif\n% if str(standard)\ 114 | \ == 'STANDARD_DVBT2':\n% if str(framesize1) == 'FECFRAME_NORMAL':\n${rate1.val}\ 115 | \ \n% else:\n${rate2.val} \n% endif\n% else:\n% if str(framesize2) == 'FECFRAME_NORMAL':\n\ 116 | ${rate3.val} \n% elif str(framesize2) == 'FECFRAME_MEDIUM':\n${rate4.val}\ 117 | \ \n% else:\n${rate5.val} \n% endif\n% endif\n)" 118 | 119 | file_format: 1 120 | -------------------------------------------------------------------------------- /grc/dvbgse_bbheader_source.block.yml: -------------------------------------------------------------------------------- 1 | # auto-generated by grc.converter 2 | 3 | id: dvbgse_bbheader_source 4 | label: IP Packet Source 5 | category: '[Core]/Digital Television/DVB-GSE' 6 | 7 | parameters: 8 | - id: standard 9 | label: Standard 10 | dtype: enum 11 | options: [STANDARD_DVBS2, STANDARD_DVBT2] 12 | option_labels: [DVB-S2, DVB-T2] 13 | option_attributes: 14 | hide_dvbs2: [none, all] 15 | hide_dvbt2: [all, none] 16 | val: [dvbgse.STANDARD_DVBS2, dvbgse.STANDARD_DVBT2] 17 | - id: framesize1 18 | label: FECFRAME size 19 | dtype: enum 20 | options: [FECFRAME_NORMAL, FECFRAME_SHORT] 21 | option_labels: [Normal, Short] 22 | option_attributes: 23 | hide_medium: [all, all] 24 | hide_normal: [none, all] 25 | hide_short: [all, none] 26 | val: [dvbgse.FECFRAME_NORMAL, dvbgse.FECFRAME_SHORT] 27 | hide: ${ standard.hide_dvbt2 } 28 | - id: framesize2 29 | label: FECFRAME size 30 | dtype: enum 31 | options: [FECFRAME_NORMAL, FECFRAME_MEDIUM, FECFRAME_SHORT] 32 | option_labels: [Normal, Medium, Short] 33 | option_attributes: 34 | hide_medium: [all, none, all] 35 | hide_normal: [none, all, all] 36 | hide_short: [all, all, none] 37 | val: [dvbgse.FECFRAME_NORMAL, dvbgse.FECFRAME_MEDIUM, dvbgse.FECFRAME_SHORT] 38 | hide: ${ standard.hide_dvbs2 } 39 | - id: rate1 40 | label: Code rate 41 | dtype: enum 42 | options: [C1_2, C3_5, C2_3, C3_4, C4_5, C5_6] 43 | option_labels: [1/2, 3/5, 2/3, 3/4, 4/5, 5/6] 44 | option_attributes: 45 | val: [dvbgse.C1_2, dvbgse.C3_5, dvbgse.C2_3, dvbgse.C3_4, dvbgse.C4_5, dvbgse.C5_6] 46 | hide: ${ (framesize1.hide_normal if str(standard) == 'STANDARD_DVBT2' else 'all') 47 | } 48 | - id: rate2 49 | label: Code rate 50 | dtype: enum 51 | options: [C1_3, C2_5, C1_2, C3_5, C2_3, C3_4, C4_5, C5_6] 52 | option_labels: [1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 5/6] 53 | option_attributes: 54 | val: [dvbgse.C1_3, dvbgse.C2_5, dvbgse.C1_2, dvbgse.C3_5, dvbgse.C2_3, dvbgse.C3_4, 55 | dvbgse.C4_5, dvbgse.C5_6] 56 | hide: ${ (framesize1.hide_short if str(standard) == 'STANDARD_DVBT2' else 'all') 57 | } 58 | - id: rate3 59 | label: Code rate 60 | dtype: enum 61 | options: [C1_4, C1_3, C2_5, C1_2, C3_5, C2_3, C3_4, C4_5, C5_6, C8_9, C9_10, C2_9_VLSNR, 62 | C13_45, C9_20, C90_180, C96_180, C11_20, C100_180, C104_180, C26_45, C18_30, 63 | C28_45, C23_36, C116_180, C20_30, C124_180, C25_36, C128_180, C13_18, C132_180, 64 | C22_30, C135_180, C140_180, C7_9, C154_180] 65 | option_labels: [1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 5/6, 8/9, 9/10, 2/9 VL-SNR, 66 | 13/45, 9/20, 90/180, 96/180, 11/20, 100/180, 104/180, 26/45, 18/30, 28/45, 67 | 23/36, 116/180, 20/30, 124/180, 25/36, 128/180, 13/18, 132/180, 22/30, 135/180, 68 | 140/180, 7/9, 154/180] 69 | option_attributes: 70 | val: [dvbgse.C1_4, dvbgse.C1_3, dvbgse.C2_5, dvbgse.C1_2, dvbgse.C3_5, dvbgse.C2_3, 71 | dvbgse.C3_4, dvbgse.C4_5, dvbgse.C5_6, dvbgse.C8_9, dvbgse.C9_10, dvbgse.C2_9_VLSNR, 72 | dvbgse.C13_45, dvbgse.C9_20, dvbgse.C90_180, dvbgse.C96_180, dvbgse.C11_20, 73 | dvbgse.C100_180, dvbgse.C104_180, dvbgse.C26_45, dvbgse.C18_30, dvbgse.C28_45, 74 | dvbgse.C23_36, dvbgse.C116_180, dvbgse.C20_30, dvbgse.C124_180, dvbgse.C25_36, 75 | dvbgse.C128_180, dvbgse.C13_18, dvbgse.C132_180, dvbgse.C22_30, dvbgse.C135_180, 76 | dvbgse.C140_180, dvbgse.C7_9, dvbgse.C154_180] 77 | hide: ${ (framesize2.hide_normal if str(standard) == 'STANDARD_DVBS2' else 'all') 78 | } 79 | - id: rate4 80 | label: Code rate 81 | dtype: enum 82 | options: [C1_5_MEDIUM, C11_45_MEDIUM, C1_3_MEDIUM] 83 | option_labels: [1/5, 11/45, 1/3] 84 | option_attributes: 85 | val: [dvbgse.C1_5_MEDIUM, dvbgse.C11_45_MEDIUM, dvbgse.C1_3_MEDIUM] 86 | hide: ${ (framesize2.hide_medium if str(standard) == 'STANDARD_DVBS2' else 'all') 87 | } 88 | - id: rate5 89 | label: Code rate 90 | dtype: enum 91 | options: [C1_4, C1_3, C2_5, C1_2, C3_5, C2_3, C3_4, C4_5, C5_6, C8_9, C11_45, 92 | C4_15, C14_45, C7_15, C8_15, C26_45, C32_45, C1_5_VLSNR_SF2, C11_45_VLSNR_SF2, 93 | C1_5_VLSNR, C4_15_VLSNR, C1_3_VLSNR] 94 | option_labels: [1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 5/6, 8/9, 11/45, 4/15, 95 | 14/45, 7/15, 8/15, 26/45, 32/45, 1/5 VL-SNR SF2, 11/45 VL-SNR SF2, 1/5 VL-SNR, 96 | 4/15 VL-SNR, 1/3 VL-SNR] 97 | option_attributes: 98 | val: [dvbgse.C1_4, dvbgse.C1_3, dvbgse.C2_5, dvbgse.C1_2, dvbgse.C3_5, dvbgse.C2_3, 99 | dvbgse.C3_4, dvbgse.C4_5, dvbgse.C5_6, dvbgse.C8_9, dvbgse.C11_45, dvbgse.C4_15, 100 | dvbgse.C14_45, dvbgse.C7_15, dvbgse.C8_15, dvbgse.C26_45, dvbgse.C32_45, 101 | dvbgse.C1_5_VLSNR_SF2, dvbgse.C11_45_VLSNR_SF2, dvbgse.C1_5_VLSNR, dvbgse.C4_15_VLSNR, 102 | dvbgse.C1_3_VLSNR] 103 | hide: ${ (framesize2.hide_short if str(standard) == 'STANDARD_DVBS2' else 'all') 104 | } 105 | - id: rolloff 106 | label: Rolloff factor 107 | dtype: enum 108 | options: [RO_0_35, RO_0_25, RO_0_20, RO_0_15, RO_0_10, RO_0_05] 109 | option_labels: ['0.35', '0.25', '0.20', '0.15', '0.10', '0.05'] 110 | option_attributes: 111 | val: [dvbgse.RO_0_35, dvbgse.RO_0_25, dvbgse.RO_0_20, dvbgse.RO_0_15, dvbgse.RO_0_10, 112 | dvbgse.RO_0_05] 113 | hide: ${ standard.hide_dvbs2 } 114 | - id: inband 115 | label: In-band Signalling 116 | dtype: enum 117 | options: [INBAND_OFF, INBAND_ON] 118 | option_labels: ['Off', Type B] 119 | option_attributes: 120 | hide_rate: [all, none] 121 | val: [dvbgse.INBAND_OFF, dvbgse.INBAND_ON] 122 | hide: ${ standard.hide_dvbt2 } 123 | - id: fecblocks 124 | label: FEC blocks per frame 125 | dtype: int 126 | default: '168' 127 | hide: ${ inband.hide_rate } 128 | - id: tsrate 129 | label: Transport Stream Rate 130 | dtype: int 131 | default: '4000000' 132 | hide: ${ inband.hide_rate } 133 | - id: ping_reply 134 | label: Ping Reply 135 | dtype: enum 136 | options: [PING_REPLY_OFF, PING_REPLY_ON] 137 | option_labels: ['Off', 'On'] 138 | option_attributes: 139 | val: [dvbgse.PING_REPLY_OFF, dvbgse.PING_REPLY_ON] 140 | - id: ipaddr_spoof 141 | label: UDP IP Address Spoofing 142 | dtype: enum 143 | options: [IPADDR_SPOOF_OFF, IPADDR_SPOOF_ON] 144 | option_labels: ['Off', 'On'] 145 | option_attributes: 146 | hide_ipaddr: [all, none] 147 | val: [dvbgse.IPADDR_SPOOF_OFF, dvbgse.IPADDR_SPOOF_ON] 148 | - id: src_address 149 | label: Source IP Address 150 | dtype: string 151 | hide: ${ ipaddr_spoof.hide_ipaddr } 152 | - id: dst_address 153 | label: Destination IP Address 154 | dtype: string 155 | hide: ${ ipaddr_spoof.hide_ipaddr } 156 | - id: gse_padding 157 | label: Padding Packet Length 158 | dtype: enum 159 | options: [PADDING_PACKET_LENGTH_0, PADDING_PACKET_LENGTH_1] 160 | option_labels: ['0 byte', '1 byte'] 161 | option_attributes: 162 | val: [dvbgse.PADDING_PACKET_LENGTH_0, dvbgse.PADDING_PACKET_LENGTH_1] 163 | 164 | outputs: 165 | - domain: stream 166 | dtype: byte 167 | 168 | templates: 169 | imports: import dvbgse 170 | make: "dvbgse.bbheader_source(${standard.val}, \n% if str(standard) == 'STANDARD_DVBT2':\n\ 171 | ${framesize1.val}, \n% else:\n${framesize2.val}, \n% endif\n% if str(standard)\ 172 | \ == 'STANDARD_DVBT2':\n% if str(framesize1) == 'FECFRAME_NORMAL':\n${rate1.val},\ 173 | \ \n% else:\n${rate2.val}, \n% endif\n% else:\n% if str(framesize2) == 'FECFRAME_NORMAL':\n\ 174 | ${rate3.val}, \n% elif str(framesize2) == 'FECFRAME_MEDIUM':\n${rate4.val},\ 175 | \ \n% else:\n${rate5.val}, \n% endif\n% endif\n${rolloff.val}, ${inband.val},\ 176 | \ ${fecblocks}, ${tsrate}, ${ping_reply.val}, ${ipaddr_spoof.val},\ 177 | \ ${src_address}, ${dst_address}, ${gse_padding.val})" 178 | 179 | file_format: 1 180 | -------------------------------------------------------------------------------- /include/dvbgse/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011,2012 Free Software Foundation, Inc. 2 | # 3 | # This file was generated by gr_modtool, a tool from the GNU Radio framework 4 | # This file is a part of gr-dvbgse 5 | # 6 | # SPDX-License-Identifier: GPL-3.0-or-later 7 | # 8 | 9 | ######################################################################## 10 | # Install public header files 11 | ######################################################################## 12 | install(FILES 13 | api.h 14 | bbheader_source.h 15 | bbheader_sink.h DESTINATION include/dvbgse 16 | ) 17 | -------------------------------------------------------------------------------- /include/dvbgse/api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Free Software Foundation, Inc. 3 | * 4 | * This file was generated by gr_modtool, a tool from the GNU Radio framework 5 | * This file is a part of gr-dvbgse 6 | * 7 | * SPDX-License-Identifier: GPL-3.0-or-later 8 | * 9 | */ 10 | 11 | #ifndef INCLUDED_DVBGSE_API_H 12 | #define INCLUDED_DVBGSE_API_H 13 | 14 | #include 15 | 16 | #ifdef gnuradio_dvbgse_EXPORTS 17 | #define DVBGSE_API __GR_ATTR_EXPORT 18 | #else 19 | #define DVBGSE_API __GR_ATTR_IMPORT 20 | #endif 21 | 22 | #endif /* INCLUDED_DVBGSE_API_H */ 23 | -------------------------------------------------------------------------------- /include/dvbgse/bbheader_sink.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2019 Ron Economos. 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_DVBGSE_BBHEADER_SINK_H 22 | #define INCLUDED_DVBGSE_BBHEADER_SINK_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace gr { 29 | namespace dvbgse { 30 | 31 | /*! 32 | * \brief <+description of block+> 33 | * \ingroup dvbgse 34 | * 35 | */ 36 | class DVBGSE_API bbheader_sink : virtual public gr::sync_block 37 | { 38 | public: 39 | typedef std::shared_ptr sptr; 40 | 41 | /*! 42 | * \brief Return a shared_ptr to a new instance of dvbgse::bbheader_sink. 43 | * 44 | * To avoid accidental use of raw pointers, dvbgse::bbheader_sink's 45 | * constructor is in a private implementation 46 | * class. dvbgse::bbheader_sink::make is the public interface for 47 | * creating new instances. 48 | */ 49 | static sptr make(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate); 50 | }; 51 | 52 | } // namespace dvbgse 53 | } // namespace gr 54 | 55 | #endif /* INCLUDED_DVBGSE_BBHEADER_SINK_H */ 56 | 57 | -------------------------------------------------------------------------------- /include/dvbgse/bbheader_source.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2016 Ron Economos. 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_DVBGSE_BBHEADER_SOURCE_H 22 | #define INCLUDED_DVBGSE_BBHEADER_SOURCE_H 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | namespace gr { 29 | namespace dvbgse { 30 | 31 | /*! 32 | * \brief <+description of block+> 33 | * \ingroup dvbgse 34 | * 35 | */ 36 | class DVBGSE_API bbheader_source : virtual public gr::sync_block 37 | { 38 | public: 39 | typedef std::shared_ptr sptr; 40 | 41 | /*! 42 | * \brief Return a shared_ptr to a new instance of dvbgse::bbheader_source. 43 | * 44 | * To avoid accidental use of raw pointers, dvbgse::bbheader_source's 45 | * constructor is in a private implementation 46 | * class. dvbgse::bbheader_source::make is the public interface for 47 | * creating new instances. 48 | */ 49 | static sptr make(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate, dvbs2_rolloff_factor_t rolloff, dvbt2_inband_t inband, int fecblocks, int tsrate, test_ping_reply_t ping_reply, test_ipaddr_spoof_t ipaddr_spoof, char *src_address, char *dst_address, gse_padding_packet_t padding_len); 50 | }; 51 | 52 | } // namespace dvbgse 53 | } // namespace gr 54 | 55 | #endif /* INCLUDED_DVBGSE_BBHEADER_SOURCE_H */ 56 | 57 | -------------------------------------------------------------------------------- /include/dvbgse/dvb_config.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2016 Ron Economos. 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_DVBGSE_CONFIG_H 22 | #define INCLUDED_DVBGSE_CONFIG_H 23 | 24 | #define TRUE 1 25 | #define FALSE 0 26 | 27 | #define BB_HEADER_LENGTH_BITS 72 28 | 29 | // BB HEADER fields 30 | #define TS_GS_TRANSPORT 3 31 | #define TS_GS_GENERIC_PACKETIZED 0 32 | #define TS_GS_GENERIC_CONTINUOUS 1 33 | #define TS_GS_RESERVED 2 34 | 35 | #define SIS_MIS_SINGLE 1 36 | #define SIS_MIS_MULTIPLE 0 37 | 38 | #define CCM 1 39 | #define ACM 0 40 | 41 | #define ISSYI_ACTIVE 1 42 | #define ISSYI_NOT_ACTIVE 0 43 | 44 | #define NPD_ACTIVE 1 45 | #define NPD_NOT_ACTIVE 0 46 | 47 | #define FRAME_SIZE_NORMAL 64800 48 | #define FRAME_SIZE_MEDIUM 32400 49 | #define FRAME_SIZE_SHORT 16200 50 | 51 | namespace gr { 52 | namespace dvbgse { 53 | enum dvb_standard_t { 54 | STANDARD_DVBS2 = 0, 55 | STANDARD_DVBT2, 56 | }; 57 | 58 | enum dvb_code_rate_t { 59 | C1_4 = 0, 60 | C1_3, 61 | C2_5, 62 | C1_2, 63 | C3_5, 64 | C2_3, 65 | C3_4, 66 | C4_5, 67 | C5_6, 68 | C7_8, 69 | C8_9, 70 | C9_10, 71 | C13_45, 72 | C9_20, 73 | C90_180, 74 | C96_180, 75 | C11_20, 76 | C100_180, 77 | C104_180, 78 | C26_45, 79 | C18_30, 80 | C28_45, 81 | C23_36, 82 | C116_180, 83 | C20_30, 84 | C124_180, 85 | C25_36, 86 | C128_180, 87 | C13_18, 88 | C132_180, 89 | C22_30, 90 | C135_180, 91 | C140_180, 92 | C7_9, 93 | C154_180, 94 | C11_45, 95 | C4_15, 96 | C14_45, 97 | C7_15, 98 | C8_15, 99 | C32_45, 100 | C2_9_VLSNR, 101 | C1_5_MEDIUM, 102 | C11_45_MEDIUM, 103 | C1_3_MEDIUM, 104 | C1_5_VLSNR_SF2, 105 | C11_45_VLSNR_SF2, 106 | C1_5_VLSNR, 107 | C4_15_VLSNR, 108 | C1_3_VLSNR, 109 | C_OTHER, 110 | }; 111 | 112 | enum dvb_framesize_t { 113 | FECFRAME_SHORT = 0, 114 | FECFRAME_NORMAL, 115 | FECFRAME_MEDIUM, 116 | }; 117 | 118 | enum dvbs2_rolloff_factor_t { 119 | RO_0_35 = 0, 120 | RO_0_25, 121 | RO_0_20, 122 | RO_RESERVED, 123 | RO_0_15, 124 | RO_0_10, 125 | RO_0_05, 126 | }; 127 | 128 | enum dvbt2_inband_t { 129 | INBAND_OFF = 0, 130 | INBAND_ON, 131 | }; 132 | 133 | enum test_ping_reply_t { 134 | PING_REPLY_OFF = 0, 135 | PING_REPLY_ON, 136 | }; 137 | 138 | enum test_ipaddr_spoof_t { 139 | IPADDR_SPOOF_OFF = 0, 140 | IPADDR_SPOOF_ON, 141 | }; 142 | 143 | enum gse_padding_packet_t { 144 | PADDING_PACKET_LENGTH_0 = 0, 145 | PADDING_PACKET_LENGTH_1, 146 | }; 147 | 148 | } // namespace dvbgse 149 | } // namespace gr 150 | 151 | typedef gr::dvbgse::dvb_standard_t dvb_standard_t; 152 | typedef gr::dvbgse::dvb_code_rate_t dvb_code_rate_t; 153 | typedef gr::dvbgse::dvb_framesize_t dvb_framesize_t; 154 | typedef gr::dvbgse::dvbs2_rolloff_factor_t dvbs2_rolloff_factor_t; 155 | typedef gr::dvbgse::dvbt2_inband_t dvbt2_inband_t; 156 | typedef gr::dvbgse::test_ping_reply_t test_ping_reply_t; 157 | typedef gr::dvbgse::test_ipaddr_spoof_t test_ipaddr_spoof_t; 158 | typedef gr::dvbgse::gse_padding_packet_t gse_padding_packet_t; 159 | 160 | #endif /* INCLUDED_DVBGSE_CONFIG_H */ 161 | 162 | -------------------------------------------------------------------------------- /lib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011,2012,2016,2018,2019 Free Software Foundation, Inc. 2 | # 3 | # This file was generated by gr_modtool, a tool from the GNU Radio framework 4 | # This file is a part of gr-dvbgse 5 | # 6 | # SPDX-License-Identifier: GPL-3.0-or-later 7 | # 8 | 9 | ######################################################################## 10 | # Setup library 11 | ######################################################################## 12 | include(GrPlatform) #define LIB_SUFFIX 13 | 14 | list(APPEND dvbgse_sources 15 | bbheader_source_impl.cc 16 | bbheader_sink_impl.cc 17 | ) 18 | 19 | set(dvbgse_sources "${dvbgse_sources}" PARENT_SCOPE) 20 | if(NOT dvbgse_sources) 21 | MESSAGE(STATUS "No C++ sources... skipping lib/") 22 | return() 23 | endif(NOT dvbgse_sources) 24 | 25 | add_library(gnuradio-dvbgse SHARED ${dvbgse_sources}) 26 | target_link_libraries(gnuradio-dvbgse gnuradio::gnuradio-runtime ${PCAP_LIBRARIES}) 27 | target_include_directories(gnuradio-dvbgse 28 | PUBLIC $ 29 | PUBLIC $ 30 | ) 31 | set_target_properties(gnuradio-dvbgse PROPERTIES DEFINE_SYMBOL "gnuradio_dvbgse_EXPORTS") 32 | 33 | if(APPLE) 34 | set_target_properties(gnuradio-dvbgse PROPERTIES 35 | INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" 36 | ) 37 | endif(APPLE) 38 | 39 | ######################################################################## 40 | # Install built library files 41 | ######################################################################## 42 | include(GrMiscUtils) 43 | GR_LIBRARY_FOO(gnuradio-dvbgse) 44 | 45 | ######################################################################## 46 | # Print summary 47 | ######################################################################## 48 | message(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}") 49 | message(STATUS "Building for version: ${VERSION} / ${LIBVER}") 50 | 51 | ######################################################################## 52 | # Build and register unit test 53 | ######################################################################## 54 | include(GrTest) 55 | 56 | # If your unit tests require special include paths, add them here 57 | #include_directories() 58 | # List all files that contain Boost.UTF unit tests here 59 | list(APPEND test_dvbgse_sources 60 | ) 61 | # Anything we need to link to for the unit tests go here 62 | list(APPEND GR_TEST_TARGET_DEPS gnuradio-dvbgse) 63 | 64 | if(NOT test_dvbgse_sources) 65 | MESSAGE(STATUS "No C++ unit tests... skipping") 66 | return() 67 | endif(NOT test_dvbgse_sources) 68 | 69 | foreach(qa_file ${test_dvbgse_sources}) 70 | GR_ADD_CPP_TEST("dvbgse_${qa_file}" 71 | ${CMAKE_CURRENT_SOURCE_DIR}/${qa_file} 72 | ) 73 | endforeach(qa_file) 74 | -------------------------------------------------------------------------------- /lib/bbheader_sink_impl.cc: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2019 Ron Economos. 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 | #ifdef HAVE_CONFIG_H 22 | #include "config.h" 23 | #endif 24 | 25 | #include 26 | #include "bbheader_sink_impl.h" 27 | #include 28 | 29 | #define DEFAULT_IF "tap1" 30 | 31 | namespace gr { 32 | namespace dvbgse { 33 | 34 | bbheader_sink::sptr 35 | bbheader_sink::make(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate) 36 | { 37 | return gnuradio::get_initial_sptr 38 | (new bbheader_sink_impl(standard, framesize, rate)); 39 | } 40 | 41 | /* 42 | * The private constructor 43 | */ 44 | bbheader_sink_impl::bbheader_sink_impl(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate) 45 | : gr::sync_block("bbheader_sink", 46 | gr::io_signature::make(1, 1, sizeof(unsigned char)), 47 | gr::io_signature::make(0, 0, 0)) 48 | { 49 | struct ifreq ifr; 50 | int err; 51 | int fdmac; 52 | struct ifreq ifrmac; 53 | unsigned char *mac; 54 | if (framesize == FECFRAME_NORMAL) { 55 | switch (rate) { 56 | case C1_4: 57 | kbch = 16008; 58 | break; 59 | case C1_3: 60 | kbch = 21408; 61 | break; 62 | case C2_5: 63 | kbch = 25728; 64 | break; 65 | case C1_2: 66 | kbch = 32208; 67 | break; 68 | case C3_5: 69 | kbch = 38688; 70 | break; 71 | case C2_3: 72 | kbch = 43040; 73 | break; 74 | case C3_4: 75 | kbch = 48408; 76 | break; 77 | case C4_5: 78 | kbch = 51648; 79 | break; 80 | case C5_6: 81 | kbch = 53840; 82 | break; 83 | case C8_9: 84 | kbch = 57472; 85 | break; 86 | case C9_10: 87 | kbch = 58192; 88 | break; 89 | case C2_9_VLSNR: 90 | kbch = 14208; 91 | break; 92 | case C13_45: 93 | kbch = 18528; 94 | break; 95 | case C9_20: 96 | kbch = 28968; 97 | break; 98 | case C90_180: 99 | kbch = 32208; 100 | break; 101 | case C96_180: 102 | kbch = 34368; 103 | break; 104 | case C11_20: 105 | kbch = 35448; 106 | break; 107 | case C100_180: 108 | kbch = 35808; 109 | break; 110 | case C104_180: 111 | kbch = 37248; 112 | break; 113 | case C26_45: 114 | kbch = 37248; 115 | break; 116 | case C18_30: 117 | kbch = 38688; 118 | break; 119 | case C28_45: 120 | kbch = 40128; 121 | break; 122 | case C23_36: 123 | kbch = 41208; 124 | break; 125 | case C116_180: 126 | kbch = 41568; 127 | break; 128 | case C20_30: 129 | kbch = 43008; 130 | break; 131 | case C124_180: 132 | kbch = 44448; 133 | break; 134 | case C25_36: 135 | kbch = 44808; 136 | break; 137 | case C128_180: 138 | kbch = 45888; 139 | break; 140 | case C13_18: 141 | kbch = 46608; 142 | break; 143 | case C132_180: 144 | kbch = 47328; 145 | break; 146 | case C22_30: 147 | kbch = 47328; 148 | break; 149 | case C135_180: 150 | kbch = 48408; 151 | break; 152 | case C140_180: 153 | kbch = 50208; 154 | break; 155 | case C7_9: 156 | kbch = 50208; 157 | break; 158 | case C154_180: 159 | kbch = 55248; 160 | break; 161 | default: 162 | kbch = 0; 163 | break; 164 | } 165 | } 166 | else if (framesize == FECFRAME_SHORT) { 167 | switch (rate) { 168 | case C1_4: 169 | kbch = 3072; 170 | break; 171 | case C1_3: 172 | kbch = 5232; 173 | break; 174 | case C2_5: 175 | kbch = 6312; 176 | break; 177 | case C1_2: 178 | kbch = 7032; 179 | break; 180 | case C3_5: 181 | kbch = 9552; 182 | break; 183 | case C2_3: 184 | kbch = 10632; 185 | break; 186 | case C3_4: 187 | kbch = 11712; 188 | break; 189 | case C4_5: 190 | kbch = 12432; 191 | break; 192 | case C5_6: 193 | kbch = 13152; 194 | break; 195 | case C8_9: 196 | kbch = 14232; 197 | break; 198 | case C11_45: 199 | kbch = 3792; 200 | break; 201 | case C4_15: 202 | kbch = 4152; 203 | break; 204 | case C14_45: 205 | kbch = 4872; 206 | break; 207 | case C7_15: 208 | kbch = 7392; 209 | break; 210 | case C8_15: 211 | kbch = 8472; 212 | break; 213 | case C26_45: 214 | kbch = 9192; 215 | break; 216 | case C32_45: 217 | kbch = 11352; 218 | break; 219 | case C1_5_VLSNR_SF2: 220 | kbch = 2512; 221 | break; 222 | case C11_45_VLSNR_SF2: 223 | kbch = 3792; 224 | break; 225 | case C1_5_VLSNR: 226 | kbch = 3072; 227 | break; 228 | case C4_15_VLSNR: 229 | kbch = 4152; 230 | break; 231 | case C1_3_VLSNR: 232 | kbch = 5232; 233 | break; 234 | default: 235 | kbch = 0; 236 | break; 237 | } 238 | } 239 | else { 240 | switch (rate) { 241 | case C1_5_MEDIUM: 242 | kbch = 5660; 243 | break; 244 | case C11_45_MEDIUM: 245 | kbch = 7740; 246 | break; 247 | case C1_3_MEDIUM: 248 | kbch = 10620; 249 | break; 250 | default: 251 | kbch = 0; 252 | break; 253 | } 254 | } 255 | crc32_init(); 256 | for (int i = 0; i < 256; i++) { 257 | packet_alloc[i] = FALSE; 258 | packet_ptr[i] = NULL; 259 | packet_ttl[i] = 0; 260 | } 261 | dvb_standard = standard; 262 | synched = FALSE; 263 | 264 | if ((fd = open("/dev/net/tun", O_WRONLY)) == -1) { 265 | throw std::runtime_error("Error calling open()\n"); 266 | } 267 | 268 | memset(&ifr, 0, sizeof(ifr)); 269 | ifr.ifr_flags = IFF_TAP | IFF_NO_PI; 270 | strncpy(ifr.ifr_name, DEFAULT_IF, IFNAMSIZ); 271 | 272 | if ((err = ioctl(fd, TUNSETIFF, (void *) &ifr)) == -1) { 273 | close(fd); 274 | throw std::runtime_error("Error calling ioctl()\n"); 275 | } 276 | 277 | fdmac = socket(AF_INET, SOCK_DGRAM, 0); 278 | ifrmac.ifr_addr.sa_family = AF_INET; 279 | strncpy(ifrmac.ifr_name , DEFAULT_IF , IFNAMSIZ-1); 280 | ioctl(fdmac, SIOCGIFHWADDR, &ifrmac); 281 | close(fdmac); 282 | 283 | mac = (unsigned char *)ifrmac.ifr_hwaddr.sa_data; 284 | for (int i = 0; i < 6; i++) { 285 | tap_mac_address[i] = mac[i]; 286 | } 287 | 288 | set_output_multiple(kbch); 289 | } 290 | 291 | /* 292 | * Our virtual destructor. 293 | */ 294 | bbheader_sink_impl::~bbheader_sink_impl() 295 | { 296 | if (fd) { 297 | close(fd); 298 | } 299 | } 300 | 301 | #define CRC_POLY 0xAB 302 | 303 | /* 304 | * MSB is sent first 305 | * 306 | * The polynomial has been reversed 307 | */ 308 | unsigned int 309 | bbheader_sink_impl::check_crc8_bits(const unsigned char *in, int length) 310 | { 311 | int crc = 0; 312 | int b; 313 | int i = 0; 314 | 315 | for (int n = 0; n < length; n++) { 316 | b = in[i++] ^ (crc & 0x01); 317 | crc >>= 1; 318 | if (b) { 319 | crc ^= CRC_POLY; 320 | } 321 | } 322 | 323 | return (crc); 324 | } 325 | 326 | int 327 | bbheader_sink_impl::crc32_calc(unsigned char *buf, int size, int crc) 328 | { 329 | for (int i = 0; i < size; i++) { 330 | crc = (crc << 8) ^ crc32_table[((crc >> 24) ^ buf[i]) & 0xff]; 331 | } 332 | return (crc); 333 | } 334 | 335 | void 336 | bbheader_sink_impl::crc32_init(void) 337 | { 338 | unsigned int i, j, k; 339 | 340 | for (i = 0; i < 256; i++) { 341 | k = 0; 342 | for (j = (i << 24) | 0x800000; j != 0x80000000; j <<= 1) { 343 | k = (k << 1) ^ (((k ^ j) & 0x80000000) ? 0x04c11db7 : 0); 344 | } 345 | crc32_table[i] = k; 346 | } 347 | } 348 | 349 | int 350 | bbheader_sink_impl::work(int noutput_items, 351 | gr_vector_const_void_star &input_items, 352 | gr_vector_void_star &output_items) 353 | { 354 | const unsigned char *in = (const unsigned char *) input_items[0]; 355 | unsigned char *start; 356 | unsigned int check, length, temp; 357 | unsigned int start_indicator, end_indicator, label_type_indicator; 358 | unsigned int gse_length, frag_id = 0; 359 | unsigned char total_length[2] = {0}; 360 | unsigned char protocol_type[2] = {0}; 361 | unsigned char label[ETHER_ADDR_LEN] = {0}; 362 | unsigned char crc[4] = {0}; 363 | unsigned char *packet_ptr_save; 364 | BBHeader *h = &m_format[0].bb_header; 365 | int status; 366 | 367 | 368 | for (int i = 0; i < noutput_items; i += kbch) { 369 | start = (unsigned char *)in; 370 | check = check_crc8_bits(in, BB_HEADER_LENGTH_BITS + 8); 371 | if (check != 0) { 372 | synched = FALSE; 373 | fprintf(stderr, "Baseband header crc failed.\n"); 374 | in += kbch; 375 | } 376 | else { 377 | h->ts_gs = *in++ << 1; 378 | h->ts_gs |= *in++; 379 | h->sis_mis = *in++; 380 | h->ccm_acm = *in++; 381 | h->issyi = *in++; 382 | h->npd = *in++; 383 | h->ro = *in++ << 1; 384 | h->ro |= *in++; 385 | h->isi = 0; 386 | if (h->sis_mis == 0) { 387 | for (int n = 7; n >= 0; n--) { 388 | h->isi |= *in++ << n; 389 | } 390 | } 391 | else { 392 | in += 8; 393 | } 394 | h->upl = 0; 395 | for (int n = 15; n >= 0; n--) { 396 | h->upl |= *in++ << n; 397 | } 398 | h->dfl = 0; 399 | for (int n = 15; n >= 0; n--) { 400 | h->dfl |= *in++ << n; 401 | } 402 | h->sync = 0; 403 | for (int n = 7; n >= 0; n--) { 404 | h->sync |= *in++ << n; 405 | } 406 | h->syncd = 0; 407 | for (int n = 15; n >= 0; n--) { 408 | h->syncd |= *in++ << n; 409 | } 410 | in += 8; 411 | while (h->dfl > 0) { 412 | start_indicator = *in++; 413 | end_indicator = *in++; 414 | label_type_indicator = *in++ << 1; 415 | label_type_indicator |= *in++; 416 | if (start_indicator == 0 && end_indicator == 0 && label_type_indicator == 0) { 417 | h->dfl = 0; 418 | break; 419 | } 420 | h->dfl -= 4; 421 | gse_length = 0; 422 | for (int n = 11; n >= 0; n--) { 423 | gse_length |= *in++ << n; 424 | } 425 | h->dfl -= 12; 426 | if (start_indicator == 0 || end_indicator == 0) { 427 | frag_id = 0; 428 | for (int n = 7; n >= 0; n--) { 429 | frag_id |= *in++ << n; 430 | } 431 | h->dfl -= 8; 432 | gse_length -= 1; 433 | } 434 | if (start_indicator == 1 && end_indicator == 0) { 435 | for (unsigned int j = 0; j < 2; j++) { 436 | temp = 0; 437 | for (int n = 7; n >= 0; n--) { 438 | temp |= *in++ << n; 439 | } 440 | total_length[j] = (unsigned char)temp; 441 | } 442 | crc32_partial = crc32_calc(&total_length[0], 2, 0xffffffff); 443 | length = (total_length[0] & 0xff) << 8; 444 | length |= (total_length[1] & 0xff); 445 | length += ETHER_ADDR_LEN; 446 | if (packet_alloc[frag_id] == FALSE) { 447 | packet_alloc[frag_id] = TRUE; 448 | packet_ptr[frag_id] = &packet_pool[frag_id][0]; 449 | packet_ttl[frag_id] = 10; 450 | } 451 | else { 452 | fprintf(stderr, "s=1, e=0, no buffer to malloc!\n"); 453 | } 454 | h->dfl -= 16; 455 | gse_length -= 2; 456 | } 457 | if (start_indicator == 1) { 458 | for (unsigned int j = 0; j < ETHER_TYPE_LEN; j++) { 459 | temp = 0; 460 | for (int n = 7; n >= 0; n--) { 461 | temp |= *in++ << n; 462 | } 463 | protocol_type[j] = (unsigned char)temp; 464 | } 465 | crc32_partial = crc32_calc(&protocol_type[0], 2, crc32_partial); 466 | h->dfl -= 16; 467 | gse_length -= 2; 468 | if (label_type_indicator == 0) { 469 | for (unsigned int j = 0; j < ETHER_ADDR_LEN; j++) { 470 | temp = 0; 471 | for (int n = 7; n >= 0; n--) { 472 | temp |= *in++ << n; 473 | } 474 | label[j] = (unsigned char)temp; 475 | } 476 | crc32_partial = crc32_calc(&label[0], ETHER_ADDR_LEN, crc32_partial); 477 | h->dfl -= 48; 478 | gse_length -= 6; 479 | } 480 | else if (label_type_indicator == 1) { 481 | for (int j = 0; j < 3; j++) { 482 | temp = 0; 483 | for (int n = 7; n >= 0; n--) { 484 | temp |= *in++ << n; 485 | } 486 | label[j] = (unsigned char)temp; 487 | } 488 | crc32_partial = crc32_calc(&label[0], 3, crc32_partial); 489 | h->dfl -= 24; 490 | gse_length -= 3; 491 | } 492 | else if (label_type_indicator == 2) { 493 | } 494 | else if (label_type_indicator == 3) { 495 | } 496 | } 497 | if (start_indicator == 1 && end_indicator == 1) { 498 | index = 0; 499 | for (unsigned int j = 0; j < ETHER_ADDR_LEN; j++) { 500 | packet[index++] = label[j]; 501 | } 502 | for (unsigned int j = 0; j < ETHER_ADDR_LEN; j++) { 503 | packet[index++] = tap_mac_address[j]; 504 | } 505 | packet[index++] = protocol_type[0]; 506 | packet[index++] = protocol_type[1]; 507 | for (unsigned int j = 0; j < gse_length; j++) { 508 | temp = 0; 509 | for (int n = 7; n >= 0; n--) { 510 | temp |= *in++ << n; 511 | } 512 | h->dfl -= 8; 513 | packet[index++] = temp; 514 | } 515 | status = write(fd, &packet[0], index); 516 | if (status < 0) { 517 | fprintf(stderr, "Write Error\n"); 518 | } 519 | } 520 | else if (start_indicator == 1 && end_indicator == 0) { 521 | if (packet_ptr[frag_id]) { 522 | index = 0; 523 | for (unsigned int j = 0; j < ETHER_ADDR_LEN; j++) { 524 | *packet_ptr[frag_id]++ = label[j]; 525 | index++; 526 | } 527 | for (unsigned int j = 0; j < ETHER_ADDR_LEN; j++) { 528 | *packet_ptr[frag_id]++ = tap_mac_address[j]; 529 | index++; 530 | } 531 | *packet_ptr[frag_id]++ = protocol_type[0]; 532 | *packet_ptr[frag_id]++ = protocol_type[1]; 533 | index += 2; 534 | packet_ptr_save = packet_ptr[frag_id]; 535 | for (unsigned int j = 0; j < gse_length; j++) { 536 | temp = 0; 537 | for (int n = 7; n >= 0; n--) { 538 | temp |= *in++ << n; 539 | } 540 | h->dfl -= 8; 541 | *packet_ptr[frag_id]++ = temp; 542 | index++; 543 | } 544 | crc32_partial = crc32_calc(&packet_ptr_save[0], gse_length, crc32_partial); 545 | } 546 | else { 547 | fprintf(stderr, "s=1, e=0, no buffer available = %d\n", frag_id); 548 | for (unsigned int j = 0; j < gse_length; j++) { 549 | h->dfl -= 8; 550 | in += 8; 551 | } 552 | } 553 | } 554 | else if (start_indicator == 0 && end_indicator == 0) { 555 | if (packet_ptr[frag_id]) { 556 | packet_ptr_save = packet_ptr[frag_id]; 557 | for (unsigned int j = 0; j < gse_length; j++) { 558 | temp = 0; 559 | for (int n = 7; n >= 0; n--) { 560 | temp |= *in++ << n; 561 | } 562 | h->dfl -= 8; 563 | *packet_ptr[frag_id]++ = temp; 564 | index++; 565 | } 566 | crc32_partial = crc32_calc(&packet_ptr_save[0], gse_length, crc32_partial); 567 | } 568 | else { 569 | fprintf(stderr, "s=0, e=0, no buffer available= %d\n", frag_id); 570 | for (unsigned int j = 0; j < gse_length; j++) { 571 | h->dfl -= 8; 572 | in += 8; 573 | } 574 | } 575 | } 576 | else if (start_indicator == 0 && end_indicator == 1) { 577 | if (packet_ptr[frag_id]) { 578 | packet_ptr_save = packet_ptr[frag_id]; 579 | for (unsigned int j = 0; j < gse_length - 4; j++) { 580 | temp = 0; 581 | for (int n = 7; n >= 0; n--) { 582 | temp |= *in++ << n; 583 | } 584 | h->dfl -= 8; 585 | *packet_ptr[frag_id]++ = temp; 586 | index++; 587 | } 588 | crc32_partial = crc32_calc(&packet_ptr_save[0], gse_length - 4, crc32_partial); 589 | for (unsigned int j = 0; j < 4; j++) { 590 | temp = 0; 591 | for (int n = 7; n >= 0; n--) { 592 | temp |= *in++ << n; 593 | } 594 | h->dfl -= 8; 595 | crc[j] = (unsigned char)temp; 596 | } 597 | crc32_partial = crc32_calc(&crc[0], 4, crc32_partial); 598 | if (crc32_partial == 0) { 599 | status = write(fd, &packet_pool[frag_id][0], index); 600 | if (status < 0) { 601 | fprintf(stderr, "Write Error\n"); 602 | } 603 | } 604 | else { 605 | fprintf(stderr, "crc error!\n"); 606 | } 607 | if (packet_alloc[frag_id]) { 608 | packet_alloc[frag_id] = FALSE; 609 | packet_ptr[frag_id] = NULL; 610 | packet_ttl[frag_id] = 0; 611 | } 612 | else { 613 | fprintf(stderr, "dealloc error!\n"); 614 | } 615 | } 616 | else { 617 | fprintf(stderr, "s=0, e=1, no buffer available = %d\n", frag_id); 618 | for (unsigned int j = 0; j < gse_length; j++) { 619 | h->dfl -= 8; 620 | in += 8; 621 | } 622 | } 623 | } 624 | } 625 | in = start + kbch; 626 | } 627 | for (int n = 0; n < 256; n++) { 628 | if (packet_ttl[n] != 0) { 629 | packet_ttl[n]--; 630 | if (packet_ttl[n] == 0) { 631 | fprintf(stderr, "buffer %d timeout!\n", n); 632 | if (packet_alloc[n]) { 633 | packet_alloc[n] = FALSE; 634 | packet_ptr[n] = NULL; 635 | } 636 | else { 637 | fprintf(stderr, "dealloc error!\n"); 638 | } 639 | } 640 | } 641 | } 642 | } 643 | 644 | // Tell runtime system how many output items we produced. 645 | return noutput_items; 646 | } 647 | 648 | } /* namespace dvbgse */ 649 | } /* namespace gr */ 650 | 651 | -------------------------------------------------------------------------------- /lib/bbheader_sink_impl.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2019 Ron Economos. 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_DVBGSE_BBHEADER_SINK_IMPL_H 22 | #define INCLUDED_DVBGSE_BBHEADER_SINK_IMPL_H 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | typedef struct{ 34 | int ts_gs; 35 | int sis_mis; 36 | int ccm_acm; 37 | int issyi; 38 | int npd; 39 | int ro; 40 | int isi; 41 | int upl; 42 | int dfl; 43 | int sync; 44 | int syncd; 45 | }BBHeader; 46 | 47 | typedef struct{ 48 | BBHeader bb_header; 49 | }FrameFormat; 50 | 51 | namespace gr { 52 | namespace dvbgse { 53 | 54 | class bbheader_sink_impl : public bbheader_sink 55 | { 56 | private: 57 | unsigned int kbch; 58 | unsigned int dvb_standard; 59 | unsigned int synched; 60 | unsigned int index; 61 | int crc32_partial; 62 | FrameFormat m_format[1]; 63 | int fd; 64 | unsigned char tap_mac_address[6]; 65 | unsigned int crc32_table[256]; 66 | unsigned char packet[4096]; 67 | unsigned char packet_pool[256][4096]; 68 | unsigned char *packet_ptr[256]; 69 | unsigned int packet_alloc[256]; 70 | unsigned int packet_ttl[256]; 71 | unsigned int check_crc8_bits(const unsigned char *, int); 72 | void crc32_init(void); 73 | int crc32_calc(unsigned char *, int, int); 74 | 75 | public: 76 | bbheader_sink_impl(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate); 77 | ~bbheader_sink_impl(); 78 | 79 | // Where all the action really happens 80 | int work(int noutput_items, 81 | gr_vector_const_void_star &input_items, 82 | gr_vector_void_star &output_items); 83 | }; 84 | 85 | } // namespace dvbgse 86 | } // namespace gr 87 | 88 | #endif /* INCLUDED_DVBGSE_BBHEADER_SINK_IMPL_H */ 89 | 90 | -------------------------------------------------------------------------------- /lib/bbheader_source_impl.h: -------------------------------------------------------------------------------- 1 | /* -*- c++ -*- */ 2 | /* 3 | * Copyright 2016 Ron Economos. 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_DVBGSE_BBHEADER_SOURCE_IMPL_H 22 | #define INCLUDED_DVBGSE_BBHEADER_SOURCE_IMPL_H 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | #define START_INDICATOR_SIZE 1 35 | #define END_INDICATOR_SIZE 1 36 | #define LABEL_TYPE_INDICATOR_SIZE 2 37 | #define GSE_LENGTH_SIZE 12 38 | 39 | #define HEADER_SIZE ((START_INDICATOR_SIZE + END_INDICATOR_SIZE + LABEL_TYPE_INDICATOR_SIZE + GSE_LENGTH_SIZE) / 8) 40 | #define FRAG_ID_SIZE 1 41 | #define TOTAL_LENGTH_SIZE 2 42 | #define MAX_GSE_LENGTH 4096 43 | 44 | typedef struct{ 45 | int ts_gs; 46 | int sis_mis; 47 | int ccm_acm; 48 | int issyi; 49 | int npd; 50 | int ro; 51 | int isi; 52 | int upl; 53 | int dfl; 54 | int sync; 55 | int syncd; 56 | }BBHeader; 57 | 58 | typedef struct{ 59 | BBHeader bb_header; 60 | }FrameFormat; 61 | 62 | namespace gr { 63 | namespace dvbgse { 64 | 65 | class bbheader_source_impl : public bbheader_source 66 | { 67 | private: 68 | unsigned int kbch; 69 | unsigned int count; 70 | unsigned char crc; 71 | unsigned int frame_size; 72 | unsigned int padding_length; 73 | int inband_type_b; 74 | int fec_blocks; 75 | int fec_block; 76 | int ts_rate; 77 | int ping_reply_mode; 78 | int ipaddr_spoof_mode; 79 | bool dvbs2x; 80 | bool alternate; 81 | bool nibble; 82 | FrameFormat m_format[1]; 83 | unsigned char crc_tab[256]; 84 | unsigned int crc32_table[256]; 85 | pcap_t* descr; 86 | struct pcap_pkthdr hdr; 87 | int fd; 88 | unsigned char *packet_ptr; 89 | bool packet_fragmented; 90 | int packet_length; 91 | bool last_packet_valid; 92 | const unsigned char *packet; 93 | unsigned char frag_id; 94 | int crc32_partial; 95 | unsigned char src_addr[sizeof(in_addr)]; 96 | unsigned char dst_addr[sizeof(in_addr)]; 97 | void add_bbheader(unsigned char *, int, int, bool); 98 | void build_crc8_table(void); 99 | int add_crc8_bits(unsigned char *, int); 100 | void add_inband_type_b(unsigned char *, int); 101 | void crc32_init(void); 102 | int crc32_calc(unsigned char *, int, int); 103 | int checksum(unsigned short *, int, int); 104 | inline void ping_reply(void); 105 | inline void ipaddr_spoof(void); 106 | inline void dump_packet(unsigned char *); 107 | void handle_pcap_error(const std::string, pcap_t *, int); 108 | 109 | public: 110 | bbheader_source_impl(dvb_standard_t standard, dvb_framesize_t framesize, dvb_code_rate_t rate, dvbs2_rolloff_factor_t rolloff, dvbt2_inband_t inband, int fecblocks, int tsrate, test_ping_reply_t ping_reply, test_ipaddr_spoof_t ipaddr_spoof, char *src_address, char *dst_address, gse_padding_packet_t padding_len); 111 | ~bbheader_source_impl(); 112 | 113 | int work(int noutput_items, 114 | gr_vector_const_void_star &input_items, 115 | gr_vector_void_star &output_items); 116 | }; 117 | 118 | } // namespace dvbgse 119 | } // namespace gr 120 | 121 | #endif /* INCLUDED_DVBGSE_BBHEADER_SOURCE_IMPL_H */ 122 | 123 | -------------------------------------------------------------------------------- /python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2011 Free Software Foundation, Inc. 2 | # 3 | # This file was generated by gr_modtool, a tool from the GNU Radio framework 4 | # This file is a part of gr-dvbgse 5 | # 6 | # SPDX-License-Identifier: GPL-3.0-or-later 7 | # 8 | 9 | ######################################################################## 10 | # Include python install macros 11 | ######################################################################## 12 | include(GrPython) 13 | if(NOT PYTHONINTERP_FOUND) 14 | return() 15 | endif() 16 | 17 | add_subdirectory(bindings) 18 | 19 | ######################################################################## 20 | # Install python sources 21 | ######################################################################## 22 | GR_PYTHON_INSTALL( 23 | FILES 24 | __init__.py 25 | DESTINATION ${GR_PYTHON_DIR}/dvbgse 26 | ) 27 | 28 | ######################################################################## 29 | # Handle the unit tests 30 | ######################################################################## 31 | include(GrTest) 32 | 33 | set(GR_TEST_TARGET_DEPS gnuradio-dvbgse) 34 | GR_ADD_TEST(qa_bbheader_source ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_bbheader_source.py) 35 | GR_ADD_TEST(qa_bbheader_sink ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/qa_bbheader_sink.py) 36 | -------------------------------------------------------------------------------- /python/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2008,2009 Free Software Foundation, Inc. 3 | # 4 | # SPDX-License-Identifier: GPL-3.0-or-later 5 | # 6 | 7 | # The presence of this file turns this directory into a Python package 8 | 9 | ''' 10 | This is the GNU Radio DVBGSE module. Place your Python package 11 | description here (python/__init__.py). 12 | ''' 13 | import os 14 | 15 | # import pybind11 generated symbols into the dvbgse namespace 16 | try: 17 | # this might fail if the module is python-only 18 | from .dvbgse_python import * 19 | except ModuleNotFoundError: 20 | pass 21 | 22 | # import any pure python here 23 | # 24 | -------------------------------------------------------------------------------- /python/bindings/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Free Software Foundation, Inc. 2 | # 3 | # This file is part of GNU Radio 4 | # 5 | # SPDX-License-Identifier: GPL-3.0-or-later 6 | # 7 | 8 | ######################################################################## 9 | # Check if there is C++ code at all 10 | ######################################################################## 11 | if(NOT dvbgse_sources) 12 | MESSAGE(STATUS "No C++ sources... skipping python bindings") 13 | return() 14 | endif(NOT dvbgse_sources) 15 | 16 | ######################################################################## 17 | # Check for pygccxml 18 | ######################################################################## 19 | GR_PYTHON_CHECK_MODULE_RAW( 20 | "pygccxml" 21 | "import pygccxml" 22 | PYGCCXML_FOUND 23 | ) 24 | 25 | include(GrPybind) 26 | 27 | ######################################################################## 28 | # Python Bindings 29 | ######################################################################## 30 | 31 | list(APPEND dvbgse_python_files 32 | bbheader_source_python.cc 33 | bbheader_sink_python.cc 34 | dvb_config_python.cc python_bindings.cc) 35 | 36 | GR_PYBIND_MAKE_OOT(dvbgse 37 | ../.. 38 | gr::dvbgse 39 | "${dvbgse_python_files}") 40 | 41 | install(TARGETS dvbgse_python DESTINATION ${GR_PYTHON_DIR}/dvbgse COMPONENT pythonapi) 42 | -------------------------------------------------------------------------------- /python/bindings/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drmpeg/gr-dvbgse/e921ac2b2f7f5253757a3ce961c7945800892e99/python/bindings/README.md -------------------------------------------------------------------------------- /python/bindings/bbheader_sink_python.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | 10 | /***********************************************************************************/ 11 | /* This file is automatically generated using bindtool and can be manually edited */ 12 | /* The following lines can be configured to regenerate this file during cmake */ 13 | /* If manual edits are made, the following tags should be modified accordingly. */ 14 | /* BINDTOOL_GEN_AUTOMATIC(0) */ 15 | /* BINDTOOL_USE_PYGCCXML(0) */ 16 | /* BINDTOOL_HEADER_FILE(bbheader_sink.h) */ 17 | /* BINDTOOL_HEADER_FILE_HASH(03ac7752aecbfdd8341a8da486b01fe5) */ 18 | /***********************************************************************************/ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace py = pybind11; 25 | 26 | #include 27 | // pydoc.h is automatically generated in the build directory 28 | #include 29 | 30 | void bind_bbheader_sink(py::module& m) 31 | { 32 | 33 | using bbheader_sink = ::gr::dvbgse::bbheader_sink; 34 | 35 | 36 | py::class_>(m, "bbheader_sink", D(bbheader_sink)) 38 | 39 | .def(py::init(&bbheader_sink::make), 40 | py::arg("standard"), 41 | py::arg("framesize"), 42 | py::arg("rate"), 43 | D(bbheader_sink,make) 44 | ) 45 | 46 | 47 | 48 | 49 | ; 50 | 51 | 52 | 53 | 54 | } 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /python/bindings/bbheader_source_python.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | 10 | /***********************************************************************************/ 11 | /* This file is automatically generated using bindtool and can be manually edited */ 12 | /* The following lines can be configured to regenerate this file during cmake */ 13 | /* If manual edits are made, the following tags should be modified accordingly. */ 14 | /* BINDTOOL_GEN_AUTOMATIC(0) */ 15 | /* BINDTOOL_USE_PYGCCXML(0) */ 16 | /* BINDTOOL_HEADER_FILE(bbheader_source.h) */ 17 | /* BINDTOOL_HEADER_FILE_HASH(8d4cb9ffd681e83e2a59a7dc5d6bafa7) */ 18 | /***********************************************************************************/ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace py = pybind11; 25 | 26 | #include 27 | // pydoc.h is automatically generated in the build directory 28 | #include 29 | 30 | void bind_bbheader_source(py::module& m) 31 | { 32 | 33 | using bbheader_source = ::gr::dvbgse::bbheader_source; 34 | 35 | 36 | py::class_>(m, "bbheader_source", D(bbheader_source)) 38 | 39 | .def(py::init(&bbheader_source::make), 40 | py::arg("standard"), 41 | py::arg("framesize"), 42 | py::arg("rate"), 43 | py::arg("rolloff"), 44 | py::arg("inband"), 45 | py::arg("fecblocks"), 46 | py::arg("tsrate"), 47 | py::arg("ping_reply"), 48 | py::arg("ipaddr_spoof"), 49 | py::arg("src_address"), 50 | py::arg("dst_address"), 51 | py::arg("padding_len"), 52 | D(bbheader_source,make) 53 | ) 54 | 55 | 56 | 57 | 58 | ; 59 | 60 | 61 | 62 | 63 | } 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /python/bindings/bind_oot_file.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | import argparse 3 | import os 4 | from gnuradio.bindtool import BindingGenerator 5 | import pathlib 6 | import sys 7 | 8 | parser = argparse.ArgumentParser(description='Bind a GR Out of Tree Block') 9 | parser.add_argument('--module', type=str, 10 | help='Name of gr module containing file to bind (e.g. fft digital analog)') 11 | 12 | parser.add_argument('--output_dir', default='/tmp', 13 | help='Output directory of generated bindings') 14 | parser.add_argument('--prefix', help='Prefix of Installed GNU Radio') 15 | parser.add_argument('--src', help='Directory of gnuradio source tree', 16 | default=os.path.dirname(os.path.abspath(__file__))+'/../../..') 17 | 18 | parser.add_argument( 19 | '--filename', help="File to be parsed") 20 | 21 | parser.add_argument( 22 | '--defines', help='Set additional defines for precompiler',default=(), nargs='*') 23 | parser.add_argument( 24 | '--include', help='Additional Include Dirs, separated', default=(), nargs='*') 25 | 26 | parser.add_argument( 27 | '--status', help='Location of output file for general status (used during cmake)', default=None 28 | ) 29 | parser.add_argument( 30 | '--flag_automatic', default='0' 31 | ) 32 | parser.add_argument( 33 | '--flag_pygccxml', default='0' 34 | ) 35 | 36 | args = parser.parse_args() 37 | 38 | prefix = args.prefix 39 | output_dir = args.output_dir 40 | defines = tuple(','.join(args.defines).split(',')) 41 | includes = ','.join(args.include) 42 | name = args.module 43 | 44 | namespace = ['gr', name] 45 | prefix_include_root = name 46 | 47 | 48 | with warnings.catch_warnings(): 49 | warnings.filterwarnings("ignore", category=DeprecationWarning) 50 | 51 | bg = BindingGenerator(prefix, namespace, 52 | prefix_include_root, output_dir, define_symbols=defines, addl_includes=includes, 53 | catch_exceptions=False, write_json_output=False, status_output=args.status, 54 | flag_automatic=True if args.flag_automatic.lower() in [ 55 | '1', 'true'] else False, 56 | flag_pygccxml=True if args.flag_pygccxml.lower() in ['1', 'true'] else False) 57 | bg.gen_file_binding(args.filename) 58 | -------------------------------------------------------------------------------- /python/bindings/docstrings/README.md: -------------------------------------------------------------------------------- 1 | This directory stores templates for docstrings that are scraped from the include header files for each block -------------------------------------------------------------------------------- /python/bindings/docstrings/bbheader_sink_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr,dvbgse, __VA_ARGS__ ) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | 18 | 19 | static const char *__doc_gr_dvbgse_bbheader_sink = R"doc()doc"; 20 | 21 | 22 | static const char *__doc_gr_dvbgse_bbheader_sink_bbheader_sink = R"doc()doc"; 23 | 24 | 25 | static const char *__doc_gr_dvbgse_bbheader_sink_make = R"doc()doc"; 26 | 27 | 28 | -------------------------------------------------------------------------------- /python/bindings/docstrings/bbheader_source_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr,dvbgse, __VA_ARGS__ ) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | 18 | 19 | static const char *__doc_gr_dvbgse_bbheader_source = R"doc()doc"; 20 | 21 | 22 | static const char *__doc_gr_dvbgse_bbheader_source_bbheader_source = R"doc()doc"; 23 | 24 | 25 | static const char *__doc_gr_dvbgse_bbheader_source_make = R"doc()doc"; 26 | 27 | 28 | -------------------------------------------------------------------------------- /python/bindings/docstrings/dvb_config_pydoc_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | #include "pydoc_macros.h" 10 | #define D(...) DOC(gr,dvbgse, __VA_ARGS__ ) 11 | /* 12 | This file contains placeholders for docstrings for the Python bindings. 13 | Do not edit! These were automatically extracted during the binding process 14 | and will be overwritten during the build process 15 | */ 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /python/bindings/dvb_config_python.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | 10 | /***********************************************************************************/ 11 | /* This file is automatically generated using bindtool and can be manually edited */ 12 | /* The following lines can be configured to regenerate this file during cmake */ 13 | /* If manual edits are made, the following tags should be modified accordingly. */ 14 | /* BINDTOOL_GEN_AUTOMATIC(0) */ 15 | /* BINDTOOL_USE_PYGCCXML(0) */ 16 | /* BINDTOOL_HEADER_FILE(dvb_config.h) */ 17 | /* BINDTOOL_HEADER_FILE_HASH(31d512c63e6ac63201fe6857cb5c7c5c) */ 18 | /***********************************************************************************/ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace py = pybind11; 25 | 26 | #include 27 | // pydoc.h is automatically generated in the build directory 28 | #include 29 | 30 | void bind_dvb_config(py::module& m) 31 | { 32 | 33 | 34 | py::enum_<::gr::dvbgse::dvb_standard_t>(m,"dvb_standard_t") 35 | .value("STANDARD_DVBS2", ::gr::dvbgse::dvb_standard_t::STANDARD_DVBS2) // 0 36 | .value("STANDARD_DVBT2", ::gr::dvbgse::dvb_standard_t::STANDARD_DVBT2) // 1 37 | .export_values() 38 | ; 39 | 40 | py::implicitly_convertible(); 41 | py::enum_<::gr::dvbgse::dvb_code_rate_t>(m,"dvb_code_rate_t") 42 | .value("C1_4", ::gr::dvbgse::dvb_code_rate_t::C1_4) // 0 43 | .value("C1_3", ::gr::dvbgse::dvb_code_rate_t::C1_3) // 1 44 | .value("C2_5", ::gr::dvbgse::dvb_code_rate_t::C2_5) // 2 45 | .value("C1_2", ::gr::dvbgse::dvb_code_rate_t::C1_2) // 3 46 | .value("C3_5", ::gr::dvbgse::dvb_code_rate_t::C3_5) // 4 47 | .value("C2_3", ::gr::dvbgse::dvb_code_rate_t::C2_3) // 5 48 | .value("C3_4", ::gr::dvbgse::dvb_code_rate_t::C3_4) // 6 49 | .value("C4_5", ::gr::dvbgse::dvb_code_rate_t::C4_5) // 7 50 | .value("C5_6", ::gr::dvbgse::dvb_code_rate_t::C5_6) // 8 51 | .value("C7_8", ::gr::dvbgse::dvb_code_rate_t::C7_8) // 9 52 | .value("C8_9", ::gr::dvbgse::dvb_code_rate_t::C8_9) // 10 53 | .value("C9_10", ::gr::dvbgse::dvb_code_rate_t::C9_10) // 11 54 | .value("C13_45", ::gr::dvbgse::dvb_code_rate_t::C13_45) // 12 55 | .value("C9_20", ::gr::dvbgse::dvb_code_rate_t::C9_20) // 13 56 | .value("C90_180", ::gr::dvbgse::dvb_code_rate_t::C90_180) // 14 57 | .value("C96_180", ::gr::dvbgse::dvb_code_rate_t::C96_180) // 15 58 | .value("C11_20", ::gr::dvbgse::dvb_code_rate_t::C11_20) // 16 59 | .value("C100_180", ::gr::dvbgse::dvb_code_rate_t::C100_180) // 17 60 | .value("C104_180", ::gr::dvbgse::dvb_code_rate_t::C104_180) // 18 61 | .value("C26_45", ::gr::dvbgse::dvb_code_rate_t::C26_45) // 19 62 | .value("C18_30", ::gr::dvbgse::dvb_code_rate_t::C18_30) // 20 63 | .value("C28_45", ::gr::dvbgse::dvb_code_rate_t::C28_45) // 21 64 | .value("C23_36", ::gr::dvbgse::dvb_code_rate_t::C23_36) // 22 65 | .value("C116_180", ::gr::dvbgse::dvb_code_rate_t::C116_180) // 23 66 | .value("C20_30", ::gr::dvbgse::dvb_code_rate_t::C20_30) // 24 67 | .value("C124_180", ::gr::dvbgse::dvb_code_rate_t::C124_180) // 25 68 | .value("C25_36", ::gr::dvbgse::dvb_code_rate_t::C25_36) // 26 69 | .value("C128_180", ::gr::dvbgse::dvb_code_rate_t::C128_180) // 27 70 | .value("C13_18", ::gr::dvbgse::dvb_code_rate_t::C13_18) // 28 71 | .value("C132_180", ::gr::dvbgse::dvb_code_rate_t::C132_180) // 29 72 | .value("C22_30", ::gr::dvbgse::dvb_code_rate_t::C22_30) // 30 73 | .value("C135_180", ::gr::dvbgse::dvb_code_rate_t::C135_180) // 31 74 | .value("C140_180", ::gr::dvbgse::dvb_code_rate_t::C140_180) // 32 75 | .value("C7_9", ::gr::dvbgse::dvb_code_rate_t::C7_9) // 33 76 | .value("C154_180", ::gr::dvbgse::dvb_code_rate_t::C154_180) // 34 77 | .value("C11_45", ::gr::dvbgse::dvb_code_rate_t::C11_45) // 35 78 | .value("C4_15", ::gr::dvbgse::dvb_code_rate_t::C4_15) // 36 79 | .value("C14_45", ::gr::dvbgse::dvb_code_rate_t::C14_45) // 37 80 | .value("C7_15", ::gr::dvbgse::dvb_code_rate_t::C7_15) // 38 81 | .value("C8_15", ::gr::dvbgse::dvb_code_rate_t::C8_15) // 39 82 | .value("C32_45", ::gr::dvbgse::dvb_code_rate_t::C32_45) // 40 83 | .value("C2_9_VLSNR", ::gr::dvbgse::dvb_code_rate_t::C2_9_VLSNR) // 41 84 | .value("C1_5_MEDIUM", ::gr::dvbgse::dvb_code_rate_t::C1_5_MEDIUM) // 42 85 | .value("C11_45_MEDIUM", ::gr::dvbgse::dvb_code_rate_t::C11_45_MEDIUM) // 43 86 | .value("C1_3_MEDIUM", ::gr::dvbgse::dvb_code_rate_t::C1_3_MEDIUM) // 44 87 | .value("C1_5_VLSNR_SF2", ::gr::dvbgse::dvb_code_rate_t::C1_5_VLSNR_SF2) // 45 88 | .value("C11_45_VLSNR_SF2", ::gr::dvbgse::dvb_code_rate_t::C11_45_VLSNR_SF2) // 46 89 | .value("C1_5_VLSNR", ::gr::dvbgse::dvb_code_rate_t::C1_5_VLSNR) // 47 90 | .value("C4_15_VLSNR", ::gr::dvbgse::dvb_code_rate_t::C4_15_VLSNR) // 48 91 | .value("C1_3_VLSNR", ::gr::dvbgse::dvb_code_rate_t::C1_3_VLSNR) // 49 92 | .value("C_OTHER", ::gr::dvbgse::dvb_code_rate_t::C_OTHER) // 50 93 | .export_values() 94 | ; 95 | 96 | py::implicitly_convertible(); 97 | py::enum_<::gr::dvbgse::dvb_framesize_t>(m,"dvb_framesize_t") 98 | .value("FECFRAME_SHORT", ::gr::dvbgse::dvb_framesize_t::FECFRAME_SHORT) // 0 99 | .value("FECFRAME_NORMAL", ::gr::dvbgse::dvb_framesize_t::FECFRAME_NORMAL) // 1 100 | .value("FECFRAME_MEDIUM", ::gr::dvbgse::dvb_framesize_t::FECFRAME_MEDIUM) // 2 101 | .export_values() 102 | ; 103 | 104 | py::implicitly_convertible(); 105 | py::enum_<::gr::dvbgse::dvbs2_rolloff_factor_t>(m,"dvbs2_rolloff_factor_t") 106 | .value("RO_0_35", ::gr::dvbgse::dvbs2_rolloff_factor_t::RO_0_35) // 0 107 | .value("RO_0_25", ::gr::dvbgse::dvbs2_rolloff_factor_t::RO_0_25) // 1 108 | .value("RO_0_20", ::gr::dvbgse::dvbs2_rolloff_factor_t::RO_0_20) // 2 109 | .value("RO_RESERVED", ::gr::dvbgse::dvbs2_rolloff_factor_t::RO_RESERVED) // 3 110 | .value("RO_0_15", ::gr::dvbgse::dvbs2_rolloff_factor_t::RO_0_15) // 4 111 | .value("RO_0_10", ::gr::dvbgse::dvbs2_rolloff_factor_t::RO_0_10) // 5 112 | .value("RO_0_05", ::gr::dvbgse::dvbs2_rolloff_factor_t::RO_0_05) // 6 113 | .export_values() 114 | ; 115 | 116 | py::implicitly_convertible(); 117 | py::enum_<::gr::dvbgse::dvbt2_inband_t>(m,"dvbt2_inband_t") 118 | .value("INBAND_OFF", ::gr::dvbgse::dvbt2_inband_t::INBAND_OFF) // 0 119 | .value("INBAND_ON", ::gr::dvbgse::dvbt2_inband_t::INBAND_ON) // 1 120 | .export_values() 121 | ; 122 | 123 | py::implicitly_convertible(); 124 | py::enum_<::gr::dvbgse::test_ping_reply_t>(m,"test_ping_reply_t") 125 | .value("PING_REPLY_OFF", ::gr::dvbgse::test_ping_reply_t::PING_REPLY_OFF) // 0 126 | .value("PING_REPLY_ON", ::gr::dvbgse::test_ping_reply_t::PING_REPLY_ON) // 1 127 | .export_values() 128 | ; 129 | 130 | py::implicitly_convertible(); 131 | py::enum_<::gr::dvbgse::test_ipaddr_spoof_t>(m,"test_ipaddr_spoof_t") 132 | .value("IPADDR_SPOOF_OFF", ::gr::dvbgse::test_ipaddr_spoof_t::IPADDR_SPOOF_OFF) // 0 133 | .value("IPADDR_SPOOF_ON", ::gr::dvbgse::test_ipaddr_spoof_t::IPADDR_SPOOF_ON) // 1 134 | .export_values() 135 | ; 136 | 137 | py::implicitly_convertible(); 138 | py::enum_<::gr::dvbgse::gse_padding_packet_t>(m,"gse_padding_packet_t") 139 | .value("PADDING_PACKET_LENGTH_0", ::gr::dvbgse::gse_padding_packet_t::PADDING_PACKET_LENGTH_0) // 0 140 | .value("PADDING_PACKET_LENGTH_1", ::gr::dvbgse::gse_padding_packet_t::PADDING_PACKET_LENGTH_1) // 1 141 | .export_values() 142 | ; 143 | 144 | py::implicitly_convertible(); 145 | 146 | 147 | 148 | } 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /python/bindings/header_utils.py: -------------------------------------------------------------------------------- 1 | # Utilities for reading values in header files 2 | 3 | from argparse import ArgumentParser 4 | import re 5 | 6 | 7 | class PybindHeaderParser: 8 | def __init__(self, pathname): 9 | with open(pathname,'r') as f: 10 | self.file_txt = f.read() 11 | 12 | def get_flag_automatic(self): 13 | # p = re.compile(r'BINDTOOL_GEN_AUTOMATIC\(([^\s])\)') 14 | # m = p.search(self.file_txt) 15 | m = re.search(r'BINDTOOL_GEN_AUTOMATIC\(([^\s])\)', self.file_txt) 16 | if (m and m.group(1) == '1'): 17 | return True 18 | else: 19 | return False 20 | 21 | def get_flag_pygccxml(self): 22 | # p = re.compile(r'BINDTOOL_USE_PYGCCXML\(([^\s])\)') 23 | # m = p.search(self.file_txt) 24 | m = re.search(r'BINDTOOL_USE_PYGCCXML\(([^\s])\)', self.file_txt) 25 | if (m and m.group(1) == '1'): 26 | return True 27 | else: 28 | return False 29 | 30 | def get_header_filename(self): 31 | # p = re.compile(r'BINDTOOL_HEADER_FILE\(([^\s]*)\)') 32 | # m = p.search(self.file_txt) 33 | m = re.search(r'BINDTOOL_HEADER_FILE\(([^\s]*)\)', self.file_txt) 34 | if (m): 35 | return m.group(1) 36 | else: 37 | return None 38 | 39 | def get_header_file_hash(self): 40 | # p = re.compile(r'BINDTOOL_HEADER_FILE_HASH\(([^\s]*)\)') 41 | # m = p.search(self.file_txt) 42 | m = re.search(r'BINDTOOL_HEADER_FILE_HASH\(([^\s]*)\)', self.file_txt) 43 | if (m): 44 | return m.group(1) 45 | else: 46 | return None 47 | 48 | def get_flags(self): 49 | return f'{self.get_flag_automatic()};{self.get_flag_pygccxml()};{self.get_header_filename()};{self.get_header_file_hash()};' 50 | 51 | 52 | 53 | def argParse(): 54 | """Parses commandline args.""" 55 | desc='Reads the parameters from the comment block in the pybind files' 56 | parser = ArgumentParser(description=desc) 57 | 58 | parser.add_argument("function", help="Operation to perform on comment block of pybind file", choices=["flag_auto","flag_pygccxml","header_filename","header_file_hash","all"]) 59 | parser.add_argument("pathname", help="Pathname of pybind c++ file to read, e.g. blockname_python.cc") 60 | 61 | return parser.parse_args() 62 | 63 | if __name__ == "__main__": 64 | # Parse command line options and set up doxyxml. 65 | args = argParse() 66 | 67 | pbhp = PybindHeaderParser(args.pathname) 68 | 69 | if args.function == "flag_auto": 70 | print(pbhp.get_flag_automatic()) 71 | elif args.function == "flag_pygccxml": 72 | print(pbhp.get_flag_pygccxml()) 73 | elif args.function == "header_filename": 74 | print(pbhp.get_header_filename()) 75 | elif args.function == "header_file_hash": 76 | print(pbhp.get_header_file_hash()) 77 | elif args.function == "all": 78 | print(pbhp.get_flags()) -------------------------------------------------------------------------------- /python/bindings/python_bindings.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Free Software Foundation, Inc. 3 | * 4 | * This file is part of GNU Radio 5 | * 6 | * SPDX-License-Identifier: GPL-3.0-or-later 7 | * 8 | */ 9 | 10 | #include 11 | 12 | #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION 13 | #include 14 | 15 | namespace py = pybind11; 16 | 17 | // Headers for binding functions 18 | /**************************************/ 19 | // The following comment block is used for 20 | // gr_modtool to insert function prototypes 21 | // Please do not delete 22 | /**************************************/ 23 | // BINDING_FUNCTION_PROTOTYPES( 24 | void bind_bbheader_source(py::module& m); 25 | void bind_bbheader_sink(py::module& m); 26 | void bind_dvb_config(py::module& m); 27 | // ) END BINDING_FUNCTION_PROTOTYPES 28 | 29 | 30 | // We need this hack because import_array() returns NULL 31 | // for newer Python versions. 32 | // This function is also necessary because it ensures access to the C API 33 | // and removes a warning. 34 | void* init_numpy() 35 | { 36 | import_array(); 37 | return NULL; 38 | } 39 | 40 | PYBIND11_MODULE(dvbgse_python, m) 41 | { 42 | // Initialize the numpy C API 43 | // (otherwise we will see segmentation faults) 44 | init_numpy(); 45 | 46 | // Allow access to base block methods 47 | py::module::import("gnuradio.gr"); 48 | 49 | /**************************************/ 50 | // The following comment block is used for 51 | // gr_modtool to insert binding function calls 52 | // Please do not delete 53 | /**************************************/ 54 | // BINDING_FUNCTION_CALLS( 55 | bind_bbheader_source(m); 56 | bind_bbheader_sink(m); 57 | bind_dvb_config(m); 58 | // ) END BINDING_FUNCTION_CALLS 59 | } 60 | -------------------------------------------------------------------------------- /python/qa_bbheader_sink.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright 2021 Ron Economos. 5 | # 6 | # SPDX-License-Identifier: GPL-3.0-or-later 7 | # 8 | 9 | from gnuradio import gr, gr_unittest 10 | # from gnuradio import blocks 11 | try: 12 | from dvbgse import bbheader_sink 13 | except ImportError: 14 | import os 15 | import sys 16 | dirname, filename = os.path.split(os.path.abspath(__file__)) 17 | sys.path.append(os.path.join(dirname, "bindings")) 18 | from dvbgse import bbheader_sink 19 | 20 | class qa_bbheader_sink(gr_unittest.TestCase): 21 | 22 | def setUp(self): 23 | self.tb = gr.top_block() 24 | 25 | def tearDown(self): 26 | self.tb = None 27 | 28 | def test_instance(self): 29 | # FIXME: Test will fail until you pass sensible arguments to the constructor 30 | instance = bbheader_sink() 31 | 32 | def test_001_descriptive_test_name(self): 33 | # set up fg 34 | self.tb.run() 35 | # check data 36 | 37 | 38 | if __name__ == '__main__': 39 | gr_unittest.run(qa_bbheader_sink) 40 | -------------------------------------------------------------------------------- /python/qa_bbheader_source.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright 2021 Ron Economos. 5 | # 6 | # SPDX-License-Identifier: GPL-3.0-or-later 7 | # 8 | 9 | from gnuradio import gr, gr_unittest 10 | # from gnuradio import blocks 11 | try: 12 | from dvbgse import bbheader_source 13 | except ImportError: 14 | import os 15 | import sys 16 | dirname, filename = os.path.split(os.path.abspath(__file__)) 17 | sys.path.append(os.path.join(dirname, "bindings")) 18 | from dvbgse import bbheader_source 19 | 20 | class qa_bbheader_source(gr_unittest.TestCase): 21 | 22 | def setUp(self): 23 | self.tb = gr.top_block() 24 | 25 | def tearDown(self): 26 | self.tb = None 27 | 28 | def test_instance(self): 29 | # FIXME: Test will fail until you pass sensible arguments to the constructor 30 | instance = bbheader_source() 31 | 32 | def test_001_descriptive_test_name(self): 33 | # set up fg 34 | self.tb.run() 35 | # check data 36 | 37 | 38 | if __name__ == '__main__': 39 | gr_unittest.run(qa_bbheader_source) 40 | --------------------------------------------------------------------------------