13 Commits

Author SHA1 Message Date
Bastian Bloessl 064f80bb2e Readme: fix git clone links 2023-10-03 12:04:46 +02:00
Itaru OGAWA a1e1f53e41 Fix for insufficient initialization for generic decoder. 2022-09-02 08:39:14 +02:00
Bastian Bloessl 5e02723e67 parse_mac: add missing include 2022-06-07 12:52:53 +02:00
Benjamin Menkuec a0e81851b0 add missing include boost/format.hpp 2022-05-02 19:37:16 +02:00
Bastian Bloessl 0c0fca8ec9 decode_mac: add include 2021-11-24 17:47:04 +01:00
Bastian Bloessl dec30cbed4 chunks_to_symbols: remove unused include 2021-11-24 17:25:12 +01:00
Bastian Bloessl c19b0ad2b5 Merge branch 'maint-3.8' into maint-3.9 2021-08-05 16:30:57 +02:00
Bastian Bloessl cba532a33f Merge branch 'maint-3.8' into maint-3.9 2021-07-20 12:19:14 +02:00
Bastian Bloessl 586ba0a85e update flowgraphs 2021-07-20 12:19:04 +02:00
Bastian Bloessl ef14207914 fix python bindings 2021-07-20 12:19:04 +02:00
Bastian Bloessl 983bf13b7f update flowgraphs 2021-07-20 12:19:04 +02:00
Bastian Bloessl afe85e2c71 python bindings 2021-07-20 12:19:04 +02:00
Bastian Bloessl cd0bb1fafd start porting to 3.9 2021-07-20 12:19:04 +02:00
100 changed files with 14695 additions and 685 deletions
+5 -2
View File
@@ -1,9 +1,12 @@
build
examples/*.py
.cproject
.project
.pydevproject
.settings
*.pyc
**/.DS_Store
.clang_complete
*~
*.pyc
*.pyo
build*/
examples/grc/*.py
+44 -22
View File
@@ -1,24 +1,16 @@
# Copyright 2011-2020 Free Software Foundation, Inc.
#
# This file is a part of gr-ieee802-11
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-ieee802_11
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# SPDX-License-Identifier: GPL-3.0-or-later
#
########################################################################
# Project setup
########################################################################
cmake_minimum_required(VERSION 3.8)
project(gr-ieee802-11 CXX C)
project(gr-ieee802_11 CXX C)
enable_testing()
# Install to PyBOMBS target prefix if defined
@@ -59,11 +51,11 @@ if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
endif()
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD 14)
ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD 14)
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD 14)
ELSE()
message(WARNING "C++ standard could not be set because compiler is not GNU, Clang or MSVC.")
ENDIF()
@@ -81,7 +73,9 @@ ENDIF()
########################################################################
# Install directories
########################################################################
find_package(Gnuradio "3.8" REQUIRED COMPONENTS filter fft digital analog blocks)
include(FindPkgConfig)
find_package(Volk)
find_package(Gnuradio "3.9" REQUIRED COMPONENTS filter fft digital analog blocks)
include(GrVersion)
include(GrPlatform) #define LIB_SUFFIX
@@ -117,6 +111,20 @@ if(APPLE)
endif(NOT CMAKE_BUILD_WITH_INSTALL_RPATH)
endif(APPLE)
########################################################################
# Find gnuradio build dependencies
########################################################################
find_package(Doxygen)
########################################################################
# Setup doxygen option
########################################################################
if(DOXYGEN_FOUND)
option(ENABLE_DOXYGEN "Build docs using Doxygen" ON)
else(DOXYGEN_FOUND)
option(ENABLE_DOXYGEN "Build docs using Doxygen" OFF)
endif(DOXYGEN_FOUND)
########################################################################
# Create uninstall target
########################################################################
@@ -129,12 +137,26 @@ add_custom_target(uninstall
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
)
########################################################################
# Add subdirectories
########################################################################
add_subdirectory(include/ieee802_11)
add_subdirectory(lib)
add_subdirectory(swig)
add_subdirectory(python)
add_subdirectory(grc)
add_subdirectory(apps)
add_subdirectory(docs)
# NOTE: manually update below to use GRC to generate C++ flowgraphs w/o python
if(ENABLE_PYTHON)
message(STATUS "PYTHON and GRC components are enabled")
add_subdirectory(python)
add_subdirectory(grc)
else(ENABLE_PYTHON)
message(STATUS "PYTHON and GRC components are disabled")
endif(ENABLE_PYTHON)
########################################################################
# Install cmake search helper for this library
########################################################################
install(FILES cmake/Modules/ieee802_11Config.cmake
DESTINATION ${CMAKE_MODULES_DIR}/ieee802_11
)
+2 -2
View File
@@ -46,7 +46,7 @@ needed. For example the Wireshark connector. You can find these blocks at
[https://github.com/bastibl/gr-foo](https://github.com/bastibl/gr-foo). They are
installed with the typical command sequence:
git clone https://github.com/bastibl/gr-foo.git
git clone https://github.com/bastibl/gr-foo
cd gr-foo
mkdir build
cd build
@@ -60,7 +60,7 @@ installed with the typical command sequence:
To actually install the blocks do
git clone git://github.com/bastibl/gr-ieee802-11.git
git clone https://github.com/bastibl/gr-ieee802-11
cd gr-ieee802-11
mkdir build
cd build
+14
View File
@@ -0,0 +1,14 @@
# Copyright 2011 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-ieee802_11
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
include(GrPython)
GR_PYTHON_INSTALL(
PROGRAMS
DESTINATION bin
)
+4 -2
View File
@@ -1,9 +1,11 @@
INCLUDE(FindPkgConfig)
if(NOT PKG_CONFIG_FOUND)
INCLUDE(FindPkgConfig)
endif()
PKG_CHECK_MODULES(PC_IEEE802_11 ieee802_11)
FIND_PATH(
IEEE802_11_INCLUDE_DIRS
NAMES ieee802-11/api.h
NAMES ieee802_11/api.h
HINTS $ENV{IEEE802_11_DIR}/include
${PC_IEEE802_11_INCLUDEDIR}
PATHS ${CMAKE_INSTALL_PREFIX}/include
+1 -13
View File
@@ -2,20 +2,8 @@
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# SPDX-License-Identifier: GPL-3.0-or-later
#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
include(CMakeFindDependencyMacro)
+24
View File
@@ -0,0 +1,24 @@
# Copyright 2011 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-ieee802_11
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
########################################################################
# Setup dependencies
########################################################################
find_package(Doxygen)
########################################################################
# Begin conditional configuration
########################################################################
if(ENABLE_DOXYGEN)
########################################################################
# Add subdirectories
########################################################################
add_subdirectory(doxygen)
endif(ENABLE_DOXYGEN)
+11
View File
@@ -0,0 +1,11 @@
This is the ieee802_11-write-a-block package meant as a guide to building
out-of-tree packages. To use the ieee802_11 blocks, the Python namespaces
is in 'ieee802_11', which is imported as:
import ieee802_11
See the Doxygen documentation for details about the blocks available
in this package. A quick listing of the details can be found in Python
after importing by using:
help(ieee802_11)
+42
View File
@@ -0,0 +1,42 @@
# Copyright 2011 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-ieee802_11
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
########################################################################
# Create the doxygen configuration file
########################################################################
file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} top_srcdir)
file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} top_builddir)
file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} abs_top_srcdir)
file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} abs_top_builddir)
set(HAVE_DOT ${DOXYGEN_DOT_FOUND})
set(enable_html_docs YES)
set(enable_latex_docs NO)
set(enable_mathjax NO)
set(enable_xml_docs YES)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
@ONLY)
set(BUILT_DIRS ${CMAKE_CURRENT_BINARY_DIR}/xml ${CMAKE_CURRENT_BINARY_DIR}/html)
########################################################################
# Make and install doxygen docs
########################################################################
add_custom_command(
OUTPUT ${BUILT_DIRS}
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating documentation with doxygen"
)
add_custom_target(doxygen_target ALL DEPENDS ${BUILT_DIRS})
install(DIRECTORY ${BUILT_DIRS} DESTINATION ${GR_PKG_DOC_DIR})
File diff suppressed because it is too large Load Diff
+71
View File
@@ -0,0 +1,71 @@
#
# Copyright 2010 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-ieee802_11
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
Python interface to contents of doxygen xml documentation.
Example use:
See the contents of the example folder for the C++ and
doxygen-generated xml used in this example.
>>> # Parse the doxygen docs.
>>> import os
>>> this_dir = os.path.dirname(globals()['__file__'])
>>> xml_path = this_dir + "/example/xml/"
>>> di = DoxyIndex(xml_path)
Get a list of all top-level objects.
>>> print([mem.name() for mem in di.members()])
[u'Aadvark', u'aadvarky_enough', u'main']
Get all functions.
>>> print([mem.name() for mem in di.in_category(DoxyFunction)])
[u'aadvarky_enough', u'main']
Check if an object is present.
>>> di.has_member(u'Aadvark')
True
>>> di.has_member(u'Fish')
False
Get an item by name and check its properties.
>>> aad = di.get_member(u'Aadvark')
>>> print(aad.brief_description)
Models the mammal Aadvark.
>>> print(aad.detailed_description)
Sadly the model is incomplete and cannot capture all aspects of an aadvark yet.
<BLANKLINE>
This line is uninformative and is only to test line breaks in the comments.
>>> [mem.name() for mem in aad.members()]
[u'aadvarkness', u'print', u'Aadvark', u'get_aadvarkness']
>>> aad.get_member(u'print').brief_description
u'Outputs the vital aadvark statistics.'
"""
from .doxyindex import DoxyIndex, DoxyFunction, DoxyParam, DoxyClass, DoxyFile, DoxyNamespace, DoxyGroup, DoxyFriend, DoxyOther
def _test():
import os
this_dir = os.path.dirname(globals()['__file__'])
xml_path = this_dir + "/example/xml/"
di = DoxyIndex(xml_path)
# Get the Aadvark class
aad = di.get_member('Aadvark')
aad.brief_description
import doctest
return doctest.testmod()
if __name__ == "__main__":
_test()
+208
View File
@@ -0,0 +1,208 @@
#
# Copyright 2010 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-ieee802_11
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
A base class is created.
Classes based upon this are used to make more user-friendly interfaces
to the doxygen xml docs than the generated classes provide.
"""
import os
import pdb
from xml.parsers.expat import ExpatError
from .generated import compound
class Base(object):
class Duplicate(Exception):
pass
class NoSuchMember(Exception):
pass
class ParsingError(Exception):
pass
def __init__(self, parse_data, top=None):
self._parsed = False
self._error = False
self._parse_data = parse_data
self._members = []
self._dict_members = {}
self._in_category = {}
self._data = {}
if top is not None:
self._xml_path = top._xml_path
# Set up holder of references
else:
top = self
self._refs = {}
self._xml_path = parse_data
self.top = top
@classmethod
def from_refid(cls, refid, top=None):
""" Instantiate class from a refid rather than parsing object. """
# First check to see if its already been instantiated.
if top is not None and refid in top._refs:
return top._refs[refid]
# Otherwise create a new instance and set refid.
inst = cls(None, top=top)
inst.refid = refid
inst.add_ref(inst)
return inst
@classmethod
def from_parse_data(cls, parse_data, top=None):
refid = getattr(parse_data, 'refid', None)
if refid is not None and top is not None and refid in top._refs:
return top._refs[refid]
inst = cls(parse_data, top=top)
if refid is not None:
inst.refid = refid
inst.add_ref(inst)
return inst
def add_ref(self, obj):
if hasattr(obj, 'refid'):
self.top._refs[obj.refid] = obj
mem_classes = []
def get_cls(self, mem):
for cls in self.mem_classes:
if cls.can_parse(mem):
return cls
raise Exception(("Did not find a class for object '%s'." \
% (mem.get_name())))
def convert_mem(self, mem):
try:
cls = self.get_cls(mem)
converted = cls.from_parse_data(mem, self.top)
if converted is None:
raise Exception('No class matched this object.')
self.add_ref(converted)
return converted
except Exception as e:
print(e)
@classmethod
def includes(cls, inst):
return isinstance(inst, cls)
@classmethod
def can_parse(cls, obj):
return False
def _parse(self):
self._parsed = True
def _get_dict_members(self, cat=None):
"""
For given category a dictionary is returned mapping member names to
members of that category. For names that are duplicated the name is
mapped to None.
"""
self.confirm_no_error()
if cat not in self._dict_members:
new_dict = {}
for mem in self.in_category(cat):
if mem.name() not in new_dict:
new_dict[mem.name()] = mem
else:
new_dict[mem.name()] = self.Duplicate
self._dict_members[cat] = new_dict
return self._dict_members[cat]
def in_category(self, cat):
self.confirm_no_error()
if cat is None:
return self._members
if cat not in self._in_category:
self._in_category[cat] = [mem for mem in self._members
if cat.includes(mem)]
return self._in_category[cat]
def get_member(self, name, cat=None):
self.confirm_no_error()
# Check if it's in a namespace or class.
bits = name.split('::')
first = bits[0]
rest = '::'.join(bits[1:])
member = self._get_dict_members(cat).get(first, self.NoSuchMember)
# Raise any errors that are returned.
if member in set([self.NoSuchMember, self.Duplicate]):
raise member()
if rest:
return member.get_member(rest, cat=cat)
return member
def has_member(self, name, cat=None):
try:
mem = self.get_member(name, cat=cat)
return True
except self.NoSuchMember:
return False
def data(self):
self.confirm_no_error()
return self._data
def members(self):
self.confirm_no_error()
return self._members
def process_memberdefs(self):
mdtss = []
for sec in self._retrieved_data.compounddef.sectiondef:
mdtss += sec.memberdef
# At the moment we lose all information associated with sections.
# Sometimes a memberdef is in several sectiondef.
# We make sure we don't get duplicates here.
uniques = set([])
for mem in mdtss:
converted = self.convert_mem(mem)
pair = (mem.name, mem.__class__)
if pair not in uniques:
uniques.add(pair)
self._members.append(converted)
def retrieve_data(self):
filename = os.path.join(self._xml_path, self.refid + '.xml')
try:
self._retrieved_data = compound.parse(filename)
except ExpatError:
print('Error in xml in file %s' % filename)
self._error = True
self._retrieved_data = None
def check_parsed(self):
if not self._parsed:
self._parse()
def confirm_no_error(self):
self.check_parsed()
if self._error:
raise self.ParsingError()
def error(self):
self.check_parsed()
return self._error
def name(self):
# first see if we can do it without processing.
if self._parse_data is not None:
return self._parse_data.name
self.check_parsed()
return self._retrieved_data.compounddef.name
+282
View File
@@ -0,0 +1,282 @@
#
# Copyright 2010 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-ieee802_11
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
Classes providing more user-friendly interfaces to the doxygen xml
docs than the generated classes provide.
"""
import os
from .generated import index
from .base import Base
from .text import description
class DoxyIndex(Base):
"""
Parses a doxygen xml directory.
"""
__module__ = "gnuradio.utils.doxyxml"
def _parse(self):
if self._parsed:
return
super(DoxyIndex, self)._parse()
self._root = index.parse(os.path.join(self._xml_path, 'index.xml'))
for mem in self._root.compound:
converted = self.convert_mem(mem)
# For files and namespaces we want the contents to be
# accessible directly from the parent rather than having
# to go through the file object.
if self.get_cls(mem) == DoxyFile:
if mem.name.endswith('.h'):
self._members += converted.members()
self._members.append(converted)
elif self.get_cls(mem) == DoxyNamespace:
self._members += converted.members()
self._members.append(converted)
else:
self._members.append(converted)
class DoxyCompMem(Base):
kind = None
def __init__(self, *args, **kwargs):
super(DoxyCompMem, self).__init__(*args, **kwargs)
@classmethod
def can_parse(cls, obj):
return obj.kind == cls.kind
def set_descriptions(self, parse_data):
bd = description(getattr(parse_data, 'briefdescription', None))
dd = description(getattr(parse_data, 'detaileddescription', None))
self._data['brief_description'] = bd
self._data['detailed_description'] = dd
def set_parameters(self, data):
vs = [ddc.value for ddc in data.detaileddescription.content_]
pls = []
for v in vs:
if hasattr(v, 'parameterlist'):
pls += v.parameterlist
pis = []
for pl in pls:
pis += pl.parameteritem
dpis = []
for pi in pis:
dpi = DoxyParameterItem(pi)
dpi._parse()
dpis.append(dpi)
self._data['params'] = dpis
class DoxyCompound(DoxyCompMem):
pass
class DoxyMember(DoxyCompMem):
pass
class DoxyFunction(DoxyMember):
__module__ = "gnuradio.utils.doxyxml"
kind = 'function'
def _parse(self):
if self._parsed:
return
super(DoxyFunction, self)._parse()
self.set_descriptions(self._parse_data)
self.set_parameters(self._parse_data)
if not self._data['params']:
# If the params weren't set by a comment then just grab the names.
self._data['params'] = []
prms = self._parse_data.param
for prm in prms:
self._data['params'].append(DoxyParam(prm))
brief_description = property(lambda self: self.data()['brief_description'])
detailed_description = property(lambda self: self.data()['detailed_description'])
params = property(lambda self: self.data()['params'])
Base.mem_classes.append(DoxyFunction)
class DoxyParam(DoxyMember):
__module__ = "gnuradio.utils.doxyxml"
def _parse(self):
if self._parsed:
return
super(DoxyParam, self)._parse()
self.set_descriptions(self._parse_data)
self._data['declname'] = self._parse_data.declname
@property
def description(self):
descriptions = []
if self.brief_description:
descriptions.append(self.brief_description)
if self.detailed_description:
descriptions.append(self.detailed_description)
return '\n\n'.join(descriptions)
brief_description = property(lambda self: self.data()['brief_description'])
detailed_description = property(lambda self: self.data()['detailed_description'])
name = property(lambda self: self.data()['declname'])
class DoxyParameterItem(DoxyMember):
"""A different representation of a parameter in Doxygen."""
def _parse(self):
if self._parsed:
return
super(DoxyParameterItem, self)._parse()
names = []
for nl in self._parse_data.parameternamelist:
for pn in nl.parametername:
names.append(description(pn))
# Just take first name
self._data['name'] = names[0]
# Get description
pd = description(self._parse_data.get_parameterdescription())
self._data['description'] = pd
description = property(lambda self: self.data()['description'])
name = property(lambda self: self.data()['name'])
class DoxyClass(DoxyCompound):
__module__ = "gnuradio.utils.doxyxml"
kind = 'class'
def _parse(self):
if self._parsed:
return
super(DoxyClass, self)._parse()
self.retrieve_data()
if self._error:
return
self.set_descriptions(self._retrieved_data.compounddef)
self.set_parameters(self._retrieved_data.compounddef)
# Sectiondef.kind tells about whether private or public.
# We just ignore this for now.
self.process_memberdefs()
brief_description = property(lambda self: self.data()['brief_description'])
detailed_description = property(lambda self: self.data()['detailed_description'])
params = property(lambda self: self.data()['params'])
Base.mem_classes.append(DoxyClass)
class DoxyFile(DoxyCompound):
__module__ = "gnuradio.utils.doxyxml"
kind = 'file'
def _parse(self):
if self._parsed:
return
super(DoxyFile, self)._parse()
self.retrieve_data()
self.set_descriptions(self._retrieved_data.compounddef)
if self._error:
return
self.process_memberdefs()
brief_description = property(lambda self: self.data()['brief_description'])
detailed_description = property(lambda self: self.data()['detailed_description'])
Base.mem_classes.append(DoxyFile)
class DoxyNamespace(DoxyCompound):
__module__ = "gnuradio.utils.doxyxml"
kind = 'namespace'
def _parse(self):
if self._parsed:
return
super(DoxyNamespace, self)._parse()
self.retrieve_data()
self.set_descriptions(self._retrieved_data.compounddef)
if self._error:
return
self.process_memberdefs()
Base.mem_classes.append(DoxyNamespace)
class DoxyGroup(DoxyCompound):
__module__ = "gnuradio.utils.doxyxml"
kind = 'group'
def _parse(self):
if self._parsed:
return
super(DoxyGroup, self)._parse()
self.retrieve_data()
if self._error:
return
cdef = self._retrieved_data.compounddef
self._data['title'] = description(cdef.title)
# Process inner groups
grps = cdef.innergroup
for grp in grps:
converted = DoxyGroup.from_refid(grp.refid, top=self.top)
self._members.append(converted)
# Process inner classes
klasses = cdef.innerclass
for kls in klasses:
converted = DoxyClass.from_refid(kls.refid, top=self.top)
self._members.append(converted)
# Process normal members
self.process_memberdefs()
title = property(lambda self: self.data()['title'])
Base.mem_classes.append(DoxyGroup)
class DoxyFriend(DoxyMember):
__module__ = "gnuradio.utils.doxyxml"
kind = 'friend'
Base.mem_classes.append(DoxyFriend)
class DoxyOther(Base):
__module__ = "gnuradio.utils.doxyxml"
kinds = set(['variable', 'struct', 'union', 'define', 'typedef', 'enum',
'dir', 'page', 'signal', 'slot', 'property'])
@classmethod
def can_parse(cls, obj):
return obj.kind in cls.kinds
Base.mem_classes.append(DoxyOther)
@@ -0,0 +1,7 @@
"""
Contains generated files produced by generateDS.py.
These do the real work of parsing the doxygen xml files but the
resultant classes are not very friendly to navigate so the rest of the
doxyxml module processes them further.
"""
+503
View File
@@ -0,0 +1,503 @@
#!/usr/bin/env python
"""
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
"""
from xml.dom import minidom
from xml.dom import Node
import sys
from . import compoundsuper as supermod
from .compoundsuper import MixedContainer
class DoxygenTypeSub(supermod.DoxygenType):
def __init__(self, version=None, compounddef=None):
supermod.DoxygenType.__init__(self, version, compounddef)
def find(self, details):
return self.compounddef.find(details)
supermod.DoxygenType.subclass = DoxygenTypeSub
# end class DoxygenTypeSub
class compounddefTypeSub(supermod.compounddefType):
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):
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)
def find(self, details):
if self.id == details.refid:
return self
for sectiondef in self.sectiondef:
result = sectiondef.find(details)
if result:
return result
supermod.compounddefType.subclass = compounddefTypeSub
# end class compounddefTypeSub
class listofallmembersTypeSub(supermod.listofallmembersType):
def __init__(self, member=None):
supermod.listofallmembersType.__init__(self, member)
supermod.listofallmembersType.subclass = listofallmembersTypeSub
# end class listofallmembersTypeSub
class memberRefTypeSub(supermod.memberRefType):
def __init__(self, virt=None, prot=None, refid=None, ambiguityscope=None, scope='', name=''):
supermod.memberRefType.__init__(self, virt, prot, refid, ambiguityscope, scope, name)
supermod.memberRefType.subclass = memberRefTypeSub
# end class memberRefTypeSub
class compoundRefTypeSub(supermod.compoundRefType):
def __init__(self, virt=None, prot=None, refid=None, valueOf_='', mixedclass_=None, content_=None):
supermod.compoundRefType.__init__(self, mixedclass_, content_)
supermod.compoundRefType.subclass = compoundRefTypeSub
# end class compoundRefTypeSub
class reimplementTypeSub(supermod.reimplementType):
def __init__(self, refid=None, valueOf_='', mixedclass_=None, content_=None):
supermod.reimplementType.__init__(self, mixedclass_, content_)
supermod.reimplementType.subclass = reimplementTypeSub
# end class reimplementTypeSub
class incTypeSub(supermod.incType):
def __init__(self, local=None, refid=None, valueOf_='', mixedclass_=None, content_=None):
supermod.incType.__init__(self, mixedclass_, content_)
supermod.incType.subclass = incTypeSub
# end class incTypeSub
class refTypeSub(supermod.refType):
def __init__(self, prot=None, refid=None, valueOf_='', mixedclass_=None, content_=None):
supermod.refType.__init__(self, mixedclass_, content_)
supermod.refType.subclass = refTypeSub
# end class refTypeSub
class refTextTypeSub(supermod.refTextType):
def __init__(self, refid=None, kindref=None, external=None, valueOf_='', mixedclass_=None, content_=None):
supermod.refTextType.__init__(self, mixedclass_, content_)
supermod.refTextType.subclass = refTextTypeSub
# end class refTextTypeSub
class sectiondefTypeSub(supermod.sectiondefType):
def __init__(self, kind=None, header='', description=None, memberdef=None):
supermod.sectiondefType.__init__(self, kind, header, description, memberdef)
def find(self, details):
for memberdef in self.memberdef:
if memberdef.id == details.refid:
return memberdef
return None
supermod.sectiondefType.subclass = sectiondefTypeSub
# end class sectiondefTypeSub
class memberdefTypeSub(supermod.memberdefType):
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):
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)
supermod.memberdefType.subclass = memberdefTypeSub
# end class memberdefTypeSub
class descriptionTypeSub(supermod.descriptionType):
def __init__(self, title='', para=None, sect1=None, internal=None, mixedclass_=None, content_=None):
supermod.descriptionType.__init__(self, mixedclass_, content_)
supermod.descriptionType.subclass = descriptionTypeSub
# end class descriptionTypeSub
class enumvalueTypeSub(supermod.enumvalueType):
def __init__(self, prot=None, id=None, name='', initializer=None, briefdescription=None, detaileddescription=None, mixedclass_=None, content_=None):
supermod.enumvalueType.__init__(self, mixedclass_, content_)
supermod.enumvalueType.subclass = enumvalueTypeSub
# end class enumvalueTypeSub
class templateparamlistTypeSub(supermod.templateparamlistType):
def __init__(self, param=None):
supermod.templateparamlistType.__init__(self, param)
supermod.templateparamlistType.subclass = templateparamlistTypeSub
# end class templateparamlistTypeSub
class paramTypeSub(supermod.paramType):
def __init__(self, type_=None, declname='', defname='', array='', defval=None, briefdescription=None):
supermod.paramType.__init__(self, type_, declname, defname, array, defval, briefdescription)
supermod.paramType.subclass = paramTypeSub
# end class paramTypeSub
class linkedTextTypeSub(supermod.linkedTextType):
def __init__(self, ref=None, mixedclass_=None, content_=None):
supermod.linkedTextType.__init__(self, mixedclass_, content_)
supermod.linkedTextType.subclass = linkedTextTypeSub
# end class linkedTextTypeSub
class graphTypeSub(supermod.graphType):
def __init__(self, node=None):
supermod.graphType.__init__(self, node)
supermod.graphType.subclass = graphTypeSub
# end class graphTypeSub
class nodeTypeSub(supermod.nodeType):
def __init__(self, id=None, label='', link=None, childnode=None):
supermod.nodeType.__init__(self, id, label, link, childnode)
supermod.nodeType.subclass = nodeTypeSub
# end class nodeTypeSub
class childnodeTypeSub(supermod.childnodeType):
def __init__(self, relation=None, refid=None, edgelabel=None):
supermod.childnodeType.__init__(self, relation, refid, edgelabel)
supermod.childnodeType.subclass = childnodeTypeSub
# end class childnodeTypeSub
class linkTypeSub(supermod.linkType):
def __init__(self, refid=None, external=None, valueOf_=''):
supermod.linkType.__init__(self, refid, external)
supermod.linkType.subclass = linkTypeSub
# end class linkTypeSub
class listingTypeSub(supermod.listingType):
def __init__(self, codeline=None):
supermod.listingType.__init__(self, codeline)
supermod.listingType.subclass = listingTypeSub
# end class listingTypeSub
class codelineTypeSub(supermod.codelineType):
def __init__(self, external=None, lineno=None, refkind=None, refid=None, highlight=None):
supermod.codelineType.__init__(self, external, lineno, refkind, refid, highlight)
supermod.codelineType.subclass = codelineTypeSub
# end class codelineTypeSub
class highlightTypeSub(supermod.highlightType):
def __init__(self, class_=None, sp=None, ref=None, mixedclass_=None, content_=None):
supermod.highlightType.__init__(self, mixedclass_, content_)
supermod.highlightType.subclass = highlightTypeSub
# end class highlightTypeSub
class referenceTypeSub(supermod.referenceType):
def __init__(self, endline=None, startline=None, refid=None, compoundref=None, valueOf_='', mixedclass_=None, content_=None):
supermod.referenceType.__init__(self, mixedclass_, content_)
supermod.referenceType.subclass = referenceTypeSub
# end class referenceTypeSub
class locationTypeSub(supermod.locationType):
def __init__(self, bodystart=None, line=None, bodyend=None, bodyfile=None, file=None, valueOf_=''):
supermod.locationType.__init__(self, bodystart, line, bodyend, bodyfile, file)
supermod.locationType.subclass = locationTypeSub
# end class locationTypeSub
class docSect1TypeSub(supermod.docSect1Type):
def __init__(self, id=None, title='', para=None, sect2=None, internal=None, mixedclass_=None, content_=None):
supermod.docSect1Type.__init__(self, mixedclass_, content_)
supermod.docSect1Type.subclass = docSect1TypeSub
# end class docSect1TypeSub
class docSect2TypeSub(supermod.docSect2Type):
def __init__(self, id=None, title='', para=None, sect3=None, internal=None, mixedclass_=None, content_=None):
supermod.docSect2Type.__init__(self, mixedclass_, content_)
supermod.docSect2Type.subclass = docSect2TypeSub
# end class docSect2TypeSub
class docSect3TypeSub(supermod.docSect3Type):
def __init__(self, id=None, title='', para=None, sect4=None, internal=None, mixedclass_=None, content_=None):
supermod.docSect3Type.__init__(self, mixedclass_, content_)
supermod.docSect3Type.subclass = docSect3TypeSub
# end class docSect3TypeSub
class docSect4TypeSub(supermod.docSect4Type):
def __init__(self, id=None, title='', para=None, internal=None, mixedclass_=None, content_=None):
supermod.docSect4Type.__init__(self, mixedclass_, content_)
supermod.docSect4Type.subclass = docSect4TypeSub
# end class docSect4TypeSub
class docInternalTypeSub(supermod.docInternalType):
def __init__(self, para=None, sect1=None, mixedclass_=None, content_=None):
supermod.docInternalType.__init__(self, mixedclass_, content_)
supermod.docInternalType.subclass = docInternalTypeSub
# end class docInternalTypeSub
class docInternalS1TypeSub(supermod.docInternalS1Type):
def __init__(self, para=None, sect2=None, mixedclass_=None, content_=None):
supermod.docInternalS1Type.__init__(self, mixedclass_, content_)
supermod.docInternalS1Type.subclass = docInternalS1TypeSub
# end class docInternalS1TypeSub
class docInternalS2TypeSub(supermod.docInternalS2Type):
def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None):
supermod.docInternalS2Type.__init__(self, mixedclass_, content_)
supermod.docInternalS2Type.subclass = docInternalS2TypeSub
# end class docInternalS2TypeSub
class docInternalS3TypeSub(supermod.docInternalS3Type):
def __init__(self, para=None, sect3=None, mixedclass_=None, content_=None):
supermod.docInternalS3Type.__init__(self, mixedclass_, content_)
supermod.docInternalS3Type.subclass = docInternalS3TypeSub
# end class docInternalS3TypeSub
class docInternalS4TypeSub(supermod.docInternalS4Type):
def __init__(self, para=None, mixedclass_=None, content_=None):
supermod.docInternalS4Type.__init__(self, mixedclass_, content_)
supermod.docInternalS4Type.subclass = docInternalS4TypeSub
# end class docInternalS4TypeSub
class docURLLinkSub(supermod.docURLLink):
def __init__(self, url=None, valueOf_='', mixedclass_=None, content_=None):
supermod.docURLLink.__init__(self, mixedclass_, content_)
supermod.docURLLink.subclass = docURLLinkSub
# end class docURLLinkSub
class docAnchorTypeSub(supermod.docAnchorType):
def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None):
supermod.docAnchorType.__init__(self, mixedclass_, content_)
supermod.docAnchorType.subclass = docAnchorTypeSub
# end class docAnchorTypeSub
class docFormulaTypeSub(supermod.docFormulaType):
def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None):
supermod.docFormulaType.__init__(self, mixedclass_, content_)
supermod.docFormulaType.subclass = docFormulaTypeSub
# end class docFormulaTypeSub
class docIndexEntryTypeSub(supermod.docIndexEntryType):
def __init__(self, primaryie='', secondaryie=''):
supermod.docIndexEntryType.__init__(self, primaryie, secondaryie)
supermod.docIndexEntryType.subclass = docIndexEntryTypeSub
# end class docIndexEntryTypeSub
class docListTypeSub(supermod.docListType):
def __init__(self, listitem=None):
supermod.docListType.__init__(self, listitem)
supermod.docListType.subclass = docListTypeSub
# end class docListTypeSub
class docListItemTypeSub(supermod.docListItemType):
def __init__(self, para=None):
supermod.docListItemType.__init__(self, para)
supermod.docListItemType.subclass = docListItemTypeSub
# end class docListItemTypeSub
class docSimpleSectTypeSub(supermod.docSimpleSectType):
def __init__(self, kind=None, title=None, para=None):
supermod.docSimpleSectType.__init__(self, kind, title, para)
supermod.docSimpleSectType.subclass = docSimpleSectTypeSub
# end class docSimpleSectTypeSub
class docVarListEntryTypeSub(supermod.docVarListEntryType):
def __init__(self, term=None):
supermod.docVarListEntryType.__init__(self, term)
supermod.docVarListEntryType.subclass = docVarListEntryTypeSub
# end class docVarListEntryTypeSub
class docRefTextTypeSub(supermod.docRefTextType):
def __init__(self, refid=None, kindref=None, external=None, valueOf_='', mixedclass_=None, content_=None):
supermod.docRefTextType.__init__(self, mixedclass_, content_)
supermod.docRefTextType.subclass = docRefTextTypeSub
# end class docRefTextTypeSub
class docTableTypeSub(supermod.docTableType):
def __init__(self, rows=None, cols=None, row=None, caption=None):
supermod.docTableType.__init__(self, rows, cols, row, caption)
supermod.docTableType.subclass = docTableTypeSub
# end class docTableTypeSub
class docRowTypeSub(supermod.docRowType):
def __init__(self, entry=None):
supermod.docRowType.__init__(self, entry)
supermod.docRowType.subclass = docRowTypeSub
# end class docRowTypeSub
class docEntryTypeSub(supermod.docEntryType):
def __init__(self, thead=None, para=None):
supermod.docEntryType.__init__(self, thead, para)
supermod.docEntryType.subclass = docEntryTypeSub
# end class docEntryTypeSub
class docHeadingTypeSub(supermod.docHeadingType):
def __init__(self, level=None, valueOf_='', mixedclass_=None, content_=None):
supermod.docHeadingType.__init__(self, mixedclass_, content_)
supermod.docHeadingType.subclass = docHeadingTypeSub
# end class docHeadingTypeSub
class docImageTypeSub(supermod.docImageType):
def __init__(self, width=None, type_=None, name=None, height=None, valueOf_='', mixedclass_=None, content_=None):
supermod.docImageType.__init__(self, mixedclass_, content_)
supermod.docImageType.subclass = docImageTypeSub
# end class docImageTypeSub
class docDotFileTypeSub(supermod.docDotFileType):
def __init__(self, name=None, valueOf_='', mixedclass_=None, content_=None):
supermod.docDotFileType.__init__(self, mixedclass_, content_)
supermod.docDotFileType.subclass = docDotFileTypeSub
# end class docDotFileTypeSub
class docTocItemTypeSub(supermod.docTocItemType):
def __init__(self, id=None, valueOf_='', mixedclass_=None, content_=None):
supermod.docTocItemType.__init__(self, mixedclass_, content_)
supermod.docTocItemType.subclass = docTocItemTypeSub
# end class docTocItemTypeSub
class docTocListTypeSub(supermod.docTocListType):
def __init__(self, tocitem=None):
supermod.docTocListType.__init__(self, tocitem)
supermod.docTocListType.subclass = docTocListTypeSub
# end class docTocListTypeSub
class docLanguageTypeSub(supermod.docLanguageType):
def __init__(self, langid=None, para=None):
supermod.docLanguageType.__init__(self, langid, para)
supermod.docLanguageType.subclass = docLanguageTypeSub
# end class docLanguageTypeSub
class docParamListTypeSub(supermod.docParamListType):
def __init__(self, kind=None, parameteritem=None):
supermod.docParamListType.__init__(self, kind, parameteritem)
supermod.docParamListType.subclass = docParamListTypeSub
# end class docParamListTypeSub
class docParamListItemSub(supermod.docParamListItem):
def __init__(self, parameternamelist=None, parameterdescription=None):
supermod.docParamListItem.__init__(self, parameternamelist, parameterdescription)
supermod.docParamListItem.subclass = docParamListItemSub
# end class docParamListItemSub
class docParamNameListSub(supermod.docParamNameList):
def __init__(self, parametername=None):
supermod.docParamNameList.__init__(self, parametername)
supermod.docParamNameList.subclass = docParamNameListSub
# end class docParamNameListSub
class docParamNameSub(supermod.docParamName):
def __init__(self, direction=None, ref=None, mixedclass_=None, content_=None):
supermod.docParamName.__init__(self, mixedclass_, content_)
supermod.docParamName.subclass = docParamNameSub
# end class docParamNameSub
class docXRefSectTypeSub(supermod.docXRefSectType):
def __init__(self, id=None, xreftitle=None, xrefdescription=None):
supermod.docXRefSectType.__init__(self, id, xreftitle, xrefdescription)
supermod.docXRefSectType.subclass = docXRefSectTypeSub
# end class docXRefSectTypeSub
class docCopyTypeSub(supermod.docCopyType):
def __init__(self, link=None, para=None, sect1=None, internal=None):
supermod.docCopyType.__init__(self, link, para, sect1, internal)
supermod.docCopyType.subclass = docCopyTypeSub
# end class docCopyTypeSub
class docCharTypeSub(supermod.docCharType):
def __init__(self, char=None, valueOf_=''):
supermod.docCharType.__init__(self, char)
supermod.docCharType.subclass = docCharTypeSub
# end class docCharTypeSub
class docParaTypeSub(supermod.docParaType):
def __init__(self, char=None, valueOf_=''):
supermod.docParaType.__init__(self, char)
self.parameterlist = []
self.simplesects = []
self.content = []
def buildChildren(self, child_, nodeName_):
supermod.docParaType.buildChildren(self, child_, nodeName_)
if child_.nodeType == Node.TEXT_NODE:
obj_ = self.mixedclass_(MixedContainer.CategoryText,
MixedContainer.TypeNone, '', child_.nodeValue)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and \
nodeName_ == "ref":
obj_ = supermod.docRefTextType.factory()
obj_.build(child_)
self.content.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and \
nodeName_ == 'parameterlist':
obj_ = supermod.docParamListType.factory()
obj_.build(child_)
self.parameterlist.append(obj_)
elif child_.nodeType == Node.ELEMENT_NODE and \
nodeName_ == 'simplesect':
obj_ = supermod.docSimpleSectType.factory()
obj_.build(child_)
self.simplesects.append(obj_)
supermod.docParaType.subclass = docParaTypeSub
# end class docParaTypeSub
def parse(inFilename):
doc = minidom.parse(inFilename)
rootNode = doc.documentElement
rootObj = supermod.DoxygenType.factory()
rootObj.build(rootNode)
return rootObj
File diff suppressed because it is too large Load Diff
+77
View File
@@ -0,0 +1,77 @@
#!/usr/bin/env python
"""
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
"""
from xml.dom import minidom
import os
import sys
from . import compound
from . import indexsuper as supermod
class DoxygenTypeSub(supermod.DoxygenType):
def __init__(self, version=None, compound=None):
supermod.DoxygenType.__init__(self, version, compound)
def find_compounds_and_members(self, details):
"""
Returns a list of all compounds and their members which match details
"""
results = []
for compound in self.compound:
members = compound.find_members(details)
if members:
results.append([compound, members])
else:
if details.match(compound):
results.append([compound, []])
return results
supermod.DoxygenType.subclass = DoxygenTypeSub
# end class DoxygenTypeSub
class CompoundTypeSub(supermod.CompoundType):
def __init__(self, kind=None, refid=None, name='', member=None):
supermod.CompoundType.__init__(self, kind, refid, name, member)
def find_members(self, details):
"""
Returns a list of all members which match details
"""
results = []
for member in self.member:
if details.match(member):
results.append(member)
return results
supermod.CompoundType.subclass = CompoundTypeSub
# end class CompoundTypeSub
class MemberTypeSub(supermod.MemberType):
def __init__(self, kind=None, refid=None, name=''):
supermod.MemberType.__init__(self, kind, refid, name)
supermod.MemberType.subclass = MemberTypeSub
# end class MemberTypeSub
def parse(inFilename):
doc = minidom.parse(inFilename)
rootNode = doc.documentElement
rootObj = supermod.DoxygenType.factory()
rootObj.build(rootNode)
return rootObj
@@ -0,0 +1,522 @@
#!/usr/bin/env python
#
# Generated Thu Jun 11 18:43:54 2009 by generateDS.py.
#
import sys
from xml.dom import minidom
from xml.dom import Node
#
# User methods
#
# Calls to the methods in these classes are generated by generateDS.py.
# You can replace these methods by re-implementing the following class
# in a module named generatedssuper.py.
try:
from generatedssuper import GeneratedsSuper
except ImportError as exp:
class GeneratedsSuper(object):
def format_string(self, input_data, input_name=''):
return input_data
def format_integer(self, input_data, input_name=''):
return '%d' % input_data
def format_float(self, input_data, input_name=''):
return '%f' % input_data
def format_double(self, input_data, input_name=''):
return '%e' % input_data
def format_boolean(self, input_data, input_name=''):
return '%s' % input_data
#
# If you have installed IPython you can uncomment and use the following.
# IPython is available from http://ipython.scipy.org/.
#
## from IPython.Shell import IPShellEmbed
## args = ''
## ipshell = IPShellEmbed(args,
## banner = 'Dropping into IPython',
## exit_msg = 'Leaving Interpreter, back to program.')
# Then use the following line where and when you want to drop into the
# IPython shell:
# ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit')
#
# Globals
#
ExternalEncoding = 'ascii'
#
# Support/utility functions.
#
def showIndent(outfile, level):
for idx in range(level):
outfile.write(' ')
def quote_xml(inStr):
s1 = (isinstance(inStr, str) and inStr or
'%s' % inStr)
s1 = s1.replace('&', '&amp;')
s1 = s1.replace('<', '&lt;')
s1 = s1.replace('>', '&gt;')
return s1
def quote_attrib(inStr):
s1 = (isinstance(inStr, str) and inStr or
'%s' % inStr)
s1 = s1.replace('&', '&amp;')
s1 = s1.replace('<', '&lt;')
s1 = s1.replace('>', '&gt;')
if '"' in s1:
if "'" in s1:
s1 = '"%s"' % s1.replace('"', "&quot;")
else:
s1 = "'%s'" % s1
else:
s1 = '"%s"' % s1
return s1
def quote_python(inStr):
s1 = inStr
if s1.find("'") == -1:
if s1.find('\n') == -1:
return "'%s'" % s1
else:
return "'''%s'''" % s1
else:
if s1.find('"') != -1:
s1 = s1.replace('"', '\\"')
if s1.find('\n') == -1:
return '"%s"' % s1
else:
return '"""%s"""' % s1
class MixedContainer(object):
# Constants for category:
CategoryNone = 0
CategoryText = 1
CategorySimple = 2
CategoryComplex = 3
# Constants for content_type:
TypeNone = 0
TypeText = 1
TypeString = 2
TypeInteger = 3
TypeFloat = 4
TypeDecimal = 5
TypeDouble = 6
TypeBoolean = 7
def __init__(self, category, content_type, name, value):
self.category = category
self.content_type = content_type
self.name = name
self.value = value
def getCategory(self):
return self.category
def getContenttype(self, content_type):
return self.content_type
def getValue(self):
return self.value
def getName(self):
return self.name
def export(self, outfile, level, name, namespace):
if self.category == MixedContainer.CategoryText:
outfile.write(self.value)
elif self.category == MixedContainer.CategorySimple:
self.exportSimple(outfile, level, name)
else: # category == MixedContainer.CategoryComplex
self.value.export(outfile, level, namespace,name)
def exportSimple(self, outfile, level, name):
if self.content_type == MixedContainer.TypeString:
outfile.write('<%s>%s</%s>' % (self.name, self.value, self.name))
elif self.content_type == MixedContainer.TypeInteger or \
self.content_type == MixedContainer.TypeBoolean:
outfile.write('<%s>%d</%s>' % (self.name, self.value, self.name))
elif self.content_type == MixedContainer.TypeFloat or \
self.content_type == MixedContainer.TypeDecimal:
outfile.write('<%s>%f</%s>' % (self.name, self.value, self.name))
elif self.content_type == MixedContainer.TypeDouble:
outfile.write('<%s>%g</%s>' % (self.name, self.value, self.name))
def exportLiteral(self, outfile, level, name):
if self.category == MixedContainer.CategoryText:
showIndent(outfile, level)
outfile.write('MixedContainer(%d, %d, "%s", "%s"),\n' % \
(self.category, self.content_type, self.name, self.value))
elif self.category == MixedContainer.CategorySimple:
showIndent(outfile, level)
outfile.write('MixedContainer(%d, %d, "%s", "%s"),\n' % \
(self.category, self.content_type, self.name, self.value))
else: # category == MixedContainer.CategoryComplex
showIndent(outfile, level)
outfile.write('MixedContainer(%d, %d, "%s",\n' % \
(self.category, self.content_type, self.name,))
self.value.exportLiteral(outfile, level + 1)
showIndent(outfile, level)
outfile.write(')\n')
class _MemberSpec(object):
def __init__(self, name='', data_type='', container=0):
self.name = name
self.data_type = data_type
self.container = container
def set_name(self, name): self.name = name
def get_name(self): return self.name
def set_data_type(self, data_type): self.data_type = data_type
def get_data_type(self): return self.data_type
def set_container(self, container): self.container = container
def get_container(self): return self.container
#
# Data representation classes.
#
class DoxygenType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, version=None, compound=None):
self.version = version
if compound is None:
self.compound = []
else:
self.compound = compound
def factory(*args_, **kwargs_):
if DoxygenType.subclass:
return DoxygenType.subclass(*args_, **kwargs_)
else:
return DoxygenType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_compound(self): return self.compound
def set_compound(self, compound): self.compound = compound
def add_compound(self, value): self.compound.append(value)
def insert_compound(self, index, value): self.compound[index] = value
def get_version(self): return self.version
def set_version(self, version): self.version = version
def export(self, outfile, level, namespace_='', name_='DoxygenType', namespacedef_=''):
showIndent(outfile, level)
outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))
self.exportAttributes(outfile, level, namespace_, name_='DoxygenType')
if self.hasContent_():
outfile.write('>\n')
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write('</%s%s>\n' % (namespace_, name_))
else:
outfile.write(' />\n')
def exportAttributes(self, outfile, level, namespace_='', name_='DoxygenType'):
outfile.write(' version=%s' % (self.format_string(quote_attrib(self.version).encode(ExternalEncoding), input_name='version'), ))
def exportChildren(self, outfile, level, namespace_='', name_='DoxygenType'):
for compound_ in self.compound:
compound_.export(outfile, level, namespace_, name_='compound')
def hasContent_(self):
if (
self.compound is not None
):
return True
else:
return False
def exportLiteral(self, outfile, level, name_='DoxygenType'):
level += 1
self.exportLiteralAttributes(outfile, level, name_)
if self.hasContent_():
self.exportLiteralChildren(outfile, level, name_)
def exportLiteralAttributes(self, outfile, level, name_):
if self.version is not None:
showIndent(outfile, level)
outfile.write('version = %s,\n' % (self.version,))
def exportLiteralChildren(self, outfile, level, name_):
showIndent(outfile, level)
outfile.write('compound=[\n')
level += 1
for compound in self.compound:
showIndent(outfile, level)
outfile.write('model_.compound(\n')
compound.exportLiteral(outfile, level, name_='compound')
showIndent(outfile, level)
outfile.write('),\n')
level -= 1
showIndent(outfile, level)
outfile.write('],\n')
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(':')[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get('version'):
self.version = attrs.get('version').value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and \
nodeName_ == 'compound':
obj_ = CompoundType.factory()
obj_.build(child_)
self.compound.append(obj_)
# end class DoxygenType
class CompoundType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, kind=None, refid=None, name=None, member=None):
self.kind = kind
self.refid = refid
self.name = name
if member is None:
self.member = []
else:
self.member = member
def factory(*args_, **kwargs_):
if CompoundType.subclass:
return CompoundType.subclass(*args_, **kwargs_)
else:
return CompoundType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_name(self): return self.name
def set_name(self, name): self.name = name
def get_member(self): return self.member
def set_member(self, member): self.member = member
def add_member(self, value): self.member.append(value)
def insert_member(self, index, value): self.member[index] = value
def get_kind(self): return self.kind
def set_kind(self, kind): self.kind = kind
def get_refid(self): return self.refid
def set_refid(self, refid): self.refid = refid
def export(self, outfile, level, namespace_='', name_='CompoundType', namespacedef_=''):
showIndent(outfile, level)
outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))
self.exportAttributes(outfile, level, namespace_, name_='CompoundType')
if self.hasContent_():
outfile.write('>\n')
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write('</%s%s>\n' % (namespace_, name_))
else:
outfile.write(' />\n')
def exportAttributes(self, outfile, level, namespace_='', name_='CompoundType'):
outfile.write(' kind=%s' % (quote_attrib(self.kind), ))
outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))
def exportChildren(self, outfile, level, namespace_='', name_='CompoundType'):
if self.name is not None:
showIndent(outfile, level)
outfile.write('<%sname>%s</%sname>\n' % (namespace_, self.format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_))
for member_ in self.member:
member_.export(outfile, level, namespace_, name_='member')
def hasContent_(self):
if (
self.name is not None or
self.member is not None
):
return True
else:
return False
def exportLiteral(self, outfile, level, name_='CompoundType'):
level += 1
self.exportLiteralAttributes(outfile, level, name_)
if self.hasContent_():
self.exportLiteralChildren(outfile, level, name_)
def exportLiteralAttributes(self, outfile, level, name_):
if self.kind is not None:
showIndent(outfile, level)
outfile.write('kind = "%s",\n' % (self.kind,))
if self.refid is not None:
showIndent(outfile, level)
outfile.write('refid = %s,\n' % (self.refid,))
def exportLiteralChildren(self, outfile, level, name_):
showIndent(outfile, level)
outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding))
showIndent(outfile, level)
outfile.write('member=[\n')
level += 1
for member in self.member:
showIndent(outfile, level)
outfile.write('model_.member(\n')
member.exportLiteral(outfile, level, name_='member')
showIndent(outfile, level)
outfile.write('),\n')
level -= 1
showIndent(outfile, level)
outfile.write('],\n')
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(':')[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get('kind'):
self.kind = attrs.get('kind').value
if attrs.get('refid'):
self.refid = attrs.get('refid').value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and \
nodeName_ == 'name':
name_ = ''
for text__content_ in child_.childNodes:
name_ += text__content_.nodeValue
self.name = name_
elif child_.nodeType == Node.ELEMENT_NODE and \
nodeName_ == 'member':
obj_ = MemberType.factory()
obj_.build(child_)
self.member.append(obj_)
# end class CompoundType
class MemberType(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, kind=None, refid=None, name=None):
self.kind = kind
self.refid = refid
self.name = name
def factory(*args_, **kwargs_):
if MemberType.subclass:
return MemberType.subclass(*args_, **kwargs_)
else:
return MemberType(*args_, **kwargs_)
factory = staticmethod(factory)
def get_name(self): return self.name
def set_name(self, name): self.name = name
def get_kind(self): return self.kind
def set_kind(self, kind): self.kind = kind
def get_refid(self): return self.refid
def set_refid(self, refid): self.refid = refid
def export(self, outfile, level, namespace_='', name_='MemberType', namespacedef_=''):
showIndent(outfile, level)
outfile.write('<%s%s %s' % (namespace_, name_, namespacedef_, ))
self.exportAttributes(outfile, level, namespace_, name_='MemberType')
if self.hasContent_():
outfile.write('>\n')
self.exportChildren(outfile, level + 1, namespace_, name_)
showIndent(outfile, level)
outfile.write('</%s%s>\n' % (namespace_, name_))
else:
outfile.write(' />\n')
def exportAttributes(self, outfile, level, namespace_='', name_='MemberType'):
outfile.write(' kind=%s' % (quote_attrib(self.kind), ))
outfile.write(' refid=%s' % (self.format_string(quote_attrib(self.refid).encode(ExternalEncoding), input_name='refid'), ))
def exportChildren(self, outfile, level, namespace_='', name_='MemberType'):
if self.name is not None:
showIndent(outfile, level)
outfile.write('<%sname>%s</%sname>\n' % (namespace_, self.format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_))
def hasContent_(self):
if (
self.name is not None
):
return True
else:
return False
def exportLiteral(self, outfile, level, name_='MemberType'):
level += 1
self.exportLiteralAttributes(outfile, level, name_)
if self.hasContent_():
self.exportLiteralChildren(outfile, level, name_)
def exportLiteralAttributes(self, outfile, level, name_):
if self.kind is not None:
showIndent(outfile, level)
outfile.write('kind = "%s",\n' % (self.kind,))
if self.refid is not None:
showIndent(outfile, level)
outfile.write('refid = %s,\n' % (self.refid,))
def exportLiteralChildren(self, outfile, level, name_):
showIndent(outfile, level)
outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding))
def build(self, node_):
attrs = node_.attributes
self.buildAttributes(attrs)
for child_ in node_.childNodes:
nodeName_ = child_.nodeName.split(':')[-1]
self.buildChildren(child_, nodeName_)
def buildAttributes(self, attrs):
if attrs.get('kind'):
self.kind = attrs.get('kind').value
if attrs.get('refid'):
self.refid = attrs.get('refid').value
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and \
nodeName_ == 'name':
name_ = ''
for text__content_ in child_.childNodes:
name_ += text__content_.nodeValue
self.name = name_
# end class MemberType
USAGE_TEXT = """
Usage: python <Parser>.py [ -s ] <in_xml_file>
Options:
-s Use the SAX parser, not the minidom parser.
"""
def usage():
print(USAGE_TEXT)
sys.exit(1)
def parse(inFileName):
doc = minidom.parse(inFileName)
rootNode = doc.documentElement
rootObj = DoxygenType.factory()
rootObj.build(rootNode)
# Enable Python to collect the space used by the DOM.
doc = None
sys.stdout.write('<?xml version="1.0" ?>\n')
rootObj.export(sys.stdout, 0, name_="doxygenindex",
namespacedef_='')
return rootObj
def parseString(inString):
doc = minidom.parseString(inString)
rootNode = doc.documentElement
rootObj = DoxygenType.factory()
rootObj.build(rootNode)
# Enable Python to collect the space used by the DOM.
doc = None
sys.stdout.write('<?xml version="1.0" ?>\n')
rootObj.export(sys.stdout, 0, name_="doxygenindex",
namespacedef_='')
return rootObj
def parseLiteral(inFileName):
doc = minidom.parse(inFileName)
rootNode = doc.documentElement
rootObj = DoxygenType.factory()
rootObj.build(rootNode)
# Enable Python to collect the space used by the DOM.
doc = None
sys.stdout.write('from index import *\n\n')
sys.stdout.write('rootObj = doxygenindex(\n')
rootObj.exportLiteral(sys.stdout, 0, name_="doxygenindex")
sys.stdout.write(')\n')
return rootObj
def main():
args = sys.argv[1:]
if len(args) == 1:
parse(args[0])
else:
usage()
if __name__ == '__main__':
main()
#import pdb
#pdb.run('main()')
+45
View File
@@ -0,0 +1,45 @@
#
# Copyright 2010 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-ieee802_11
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
Utilities for extracting text from generated classes.
"""
def is_string(txt):
if isinstance(txt, str):
return True
try:
if isinstance(txt, str):
return True
except NameError:
pass
return False
def description(obj):
if obj is None:
return None
return description_bit(obj).strip()
def description_bit(obj):
if hasattr(obj, 'content'):
contents = [description_bit(item) for item in obj.content]
result = ''.join(contents)
elif hasattr(obj, 'content_'):
contents = [description_bit(item) for item in obj.content_]
result = ''.join(contents)
elif hasattr(obj, 'value'):
result = description_bit(obj.value)
elif is_string(obj):
return obj
else:
raise Exception('Expecting a string or something with content, content_ or value attribute')
# If this bit is a paragraph then add one some line breaks.
if hasattr(obj, 'name') and obj.name == 'para':
result += "\n\n"
return result
+7
View File
@@ -0,0 +1,7 @@
/*!
* \defgroup block GNU Radio IEEE802_11 C++ Signal Processing Blocks
* \brief All C++ blocks that can be used from the IEEE802_11 GNU Radio
* module are listed here or in the subcategories below.
*
*/
+10
View File
@@ -0,0 +1,10 @@
/*! \mainpage
Welcome to the GNU Radio IEEE802_11 Block
This is the intro page for the Doxygen manual generated for the IEEE802_11
block (docs/doxygen/other/main_page.dox). Edit it to add more detailed
documentation about the new GNU Radio modules contained in this
project.
*/
+19
View File
@@ -0,0 +1,19 @@
#ifndef PYDOC_MACROS_H
#define PYDOC_MACROS_H
#define __EXPAND(x) x
#define __COUNT(_1, _2, _3, _4, _5, _6, _7, COUNT, ...) COUNT
#define __VA_SIZE(...) __EXPAND(__COUNT(__VA_ARGS__, 7, 6, 5, 4, 3, 2, 1))
#define __CAT1(a, b) a##b
#define __CAT2(a, b) __CAT1(a, b)
#define __DOC1(n1) __doc_##n1
#define __DOC2(n1, n2) __doc_##n1##_##n2
#define __DOC3(n1, n2, n3) __doc_##n1##_##n2##_##n3
#define __DOC4(n1, n2, n3, n4) __doc_##n1##_##n2##_##n3##_##n4
#define __DOC5(n1, n2, n3, n4, n5) __doc_##n1##_##n2##_##n3##_##n4##_##n5
#define __DOC6(n1, n2, n3, n4, n5, n6) __doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6
#define __DOC7(n1, n2, n3, n4, n5, n6, n7) \
__doc_##n1##_##n2##_##n3##_##n4##_##n5##_##n6##_##n7
#define DOC(...) __EXPAND(__EXPAND(__CAT2(__DOC, __VA_SIZE(__VA_ARGS__)))(__VA_ARGS__))
#endif // PYDOC_MACROS_H
+346
View File
@@ -0,0 +1,346 @@
#
# Copyright 2010-2012 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gnuradio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
Updates the *pydoc_h files for a module
Execute using: python update_pydoc.py xml_path outputfilename
The file instructs Pybind11 to transfer the doxygen comments into the
python docstrings.
"""
import os, sys, time, glob, re, json
from argparse import ArgumentParser
from doxyxml import DoxyIndex, DoxyClass, DoxyFriend, DoxyFunction, DoxyFile
from doxyxml import DoxyOther, base
def py_name(name):
bits = name.split('_')
return '_'.join(bits[1:])
def make_name(name):
bits = name.split('_')
return bits[0] + '_make_' + '_'.join(bits[1:])
class Block(object):
"""
Checks if doxyxml produced objects correspond to a gnuradio block.
"""
@classmethod
def includes(cls, item):
if not isinstance(item, DoxyClass):
return False
# Check for a parsing error.
if item.error():
return False
friendname = make_name(item.name())
is_a_block = item.has_member(friendname, DoxyFriend)
# But now sometimes the make function isn't a friend so check again.
if not is_a_block:
is_a_block = di.has_member(friendname, DoxyFunction)
return is_a_block
class Block2(object):
"""
Checks if doxyxml produced objects correspond to a new style
gnuradio block.
"""
@classmethod
def includes(cls, item):
if not isinstance(item, DoxyClass):
return False
# Check for a parsing error.
if item.error():
return False
is_a_block2 = item.has_member('make', DoxyFunction) and item.has_member('sptr', DoxyOther)
return is_a_block2
def utoascii(text):
"""
Convert unicode text into ascii and escape quotes and backslashes.
"""
if text is None:
return ''
out = text.encode('ascii', 'replace')
# swig will require us to replace blackslash with 4 backslashes
# TODO: evaluate what this should be for pybind11
out = out.replace(b'\\', b'\\\\\\\\')
out = out.replace(b'"', b'\\"').decode('ascii')
return str(out)
def combine_descriptions(obj):
"""
Combines the brief and detailed descriptions of an object together.
"""
description = []
bd = obj.brief_description.strip()
dd = obj.detailed_description.strip()
if bd:
description.append(bd)
if dd:
description.append(dd)
return utoascii('\n\n'.join(description)).strip()
def format_params(parameteritems):
output = ['Args:']
template = ' {0} : {1}'
for pi in parameteritems:
output.append(template.format(pi.name, pi.description))
return '\n'.join(output)
entry_templ = '%feature("docstring") {name} "{docstring}"'
def make_entry(obj, name=None, templ="{description}", description=None, params=[]):
"""
Create a docstring key/value pair, where the key is the object name.
obj - a doxyxml object from which documentation will be extracted.
name - the name of the C object (defaults to obj.name())
templ - an optional template for the docstring containing only one
variable named 'description'.
description - if this optional variable is set then it's value is
used as the description instead of extracting it from obj.
"""
if name is None:
name=obj.name()
if hasattr(obj,'_parse_data') and hasattr(obj._parse_data,'definition'):
name=obj._parse_data.definition.split(' ')[-1]
if "operator " in name:
return ''
if description is None:
description = combine_descriptions(obj)
if params:
description += '\n\n'
description += utoascii(format_params(params))
docstring = templ.format(description=description)
return {name: docstring}
def make_class_entry(klass, description=None, ignored_methods=[], params=None):
"""
Create a class docstring key/value pair.
"""
if params is None:
params = klass.params
output = {}
output.update(make_entry(klass, description=description, params=params))
for func in klass.in_category(DoxyFunction):
if func.name() not in ignored_methods:
name = klass.name() + '::' + func.name()
output.update(make_entry(func, name=name))
return output
def make_block_entry(di, block):
"""
Create class and function docstrings of a gnuradio block
"""
descriptions = []
# Get the documentation associated with the class.
class_desc = combine_descriptions(block)
if class_desc:
descriptions.append(class_desc)
# Get the documentation associated with the make function
make_func = di.get_member(make_name(block.name()), DoxyFunction)
make_func_desc = combine_descriptions(make_func)
if make_func_desc:
descriptions.append(make_func_desc)
# Get the documentation associated with the file
try:
block_file = di.get_member(block.name() + ".h", DoxyFile)
file_desc = combine_descriptions(block_file)
if file_desc:
descriptions.append(file_desc)
except base.Base.NoSuchMember:
# Don't worry if we can't find a matching file.
pass
# And join them all together to make a super duper description.
super_description = "\n\n".join(descriptions)
# Associate the combined description with the class and
# the make function.
output = {}
output.update(make_class_entry(block, description=super_description))
output.update(make_entry(make_func, description=super_description,
params=block.params))
return output
def make_block2_entry(di, block):
"""
Create class and function docstrings of a new style gnuradio block
"""
# For new style blocks all the relevant documentation should be
# associated with the 'make' method.
class_description = combine_descriptions(block)
make_func = block.get_member('make', DoxyFunction)
make_description = combine_descriptions(make_func)
description = class_description + "\n\nConstructor Specific Documentation:\n\n" + make_description
# Associate the combined description with the class and
# the make function.
output = {}
output.update(make_class_entry(
block, description=description,
ignored_methods=['make'], params=make_func.params))
makename = block.name() + '::make'
output.update(make_entry(
make_func, name=makename, description=description,
params=make_func.params))
return output
def get_docstrings_dict(di, custom_output=None):
output = {}
if custom_output:
output.update(custom_output)
# Create docstrings for the blocks.
blocks = di.in_category(Block)
blocks2 = di.in_category(Block2)
make_funcs = set([])
for block in blocks:
try:
make_func = di.get_member(make_name(block.name()), DoxyFunction)
# Don't want to risk writing to output twice.
if make_func.name() not in make_funcs:
make_funcs.add(make_func.name())
output.update(make_block_entry(di, block))
except block.ParsingError:
sys.stderr.write('Parsing error for block {0}\n'.format(block.name()))
raise
for block in blocks2:
try:
make_func = block.get_member('make', DoxyFunction)
make_func_name = block.name() +'::make'
# Don't want to risk writing to output twice.
if make_func_name not in make_funcs:
make_funcs.add(make_func_name)
output.update(make_block2_entry(di, block))
except block.ParsingError:
sys.stderr.write('Parsing error for block {0}\n'.format(block.name()))
raise
# Create docstrings for functions
# Don't include the make functions since they have already been dealt with.
funcs = [f for f in di.in_category(DoxyFunction)
if f.name() not in make_funcs and not f.name().startswith('std::')]
for f in funcs:
try:
output.update(make_entry(f))
except f.ParsingError:
sys.stderr.write('Parsing error for function {0}\n'.format(f.name()))
# Create docstrings for classes
block_names = [block.name() for block in blocks]
block_names += [block.name() for block in blocks2]
klasses = [k for k in di.in_category(DoxyClass)
if k.name() not in block_names and not k.name().startswith('std::')]
for k in klasses:
try:
output.update(make_class_entry(k))
except k.ParsingError:
sys.stderr.write('Parsing error for class {0}\n'.format(k.name()))
# Docstrings are not created for anything that is not a function or a class.
# If this excludes anything important please add it here.
return output
def sub_docstring_in_pydoc_h(pydoc_files, docstrings_dict, output_dir, filter_str=None):
if filter_str:
docstrings_dict = {k: v for k, v in docstrings_dict.items() if k.startswith(filter_str)}
with open(os.path.join(output_dir,'docstring_status'),'w') as status_file:
for pydoc_file in pydoc_files:
if filter_str:
filter_str2 = "::".join((filter_str,os.path.split(pydoc_file)[-1].split('_pydoc_template.h')[0]))
docstrings_dict2 = {k: v for k, v in docstrings_dict.items() if k.startswith(filter_str2)}
else:
docstrings_dict2 = docstrings_dict
file_in = open(pydoc_file,'r').read()
for key, value in docstrings_dict2.items():
file_in_tmp = file_in
try:
doc_key = key.split("::")
# if 'gr' in doc_key:
# doc_key.remove('gr')
doc_key = '_'.join(doc_key)
regexp = r'(__doc_{} =\sR\"doc\()[^)]*(\)doc\")'.format(doc_key)
regexp = re.compile(regexp, re.MULTILINE)
(file_in, nsubs) = regexp.subn(r'\1'+value+r'\2', file_in, count=1)
if nsubs == 1:
status_file.write("PASS: " + pydoc_file + "\n")
except KeyboardInterrupt:
raise KeyboardInterrupt
except: # be permissive, TODO log, but just leave the docstring blank
status_file.write("FAIL: " + pydoc_file + "\n")
file_in = file_in_tmp
output_pathname = os.path.join(output_dir, os.path.basename(pydoc_file).replace('_template.h','.h'))
# FIXME: Remove this debug print
print('output docstrings to {}'.format(output_pathname))
with open(output_pathname,'w') as file_out:
file_out.write(file_in)
def copy_docstring_templates(pydoc_files, output_dir):
with open(os.path.join(output_dir,'docstring_status'),'w') as status_file:
for pydoc_file in pydoc_files:
file_in = open(pydoc_file,'r').read()
output_pathname = os.path.join(output_dir, os.path.basename(pydoc_file).replace('_template.h','.h'))
# FIXME: Remove this debug print
print('copy docstrings to {}'.format(output_pathname))
with open(output_pathname,'w') as file_out:
file_out.write(file_in)
status_file.write("DONE")
def argParse():
"""Parses commandline args."""
desc='Scrape the doxygen generated xml for docstrings to insert into python bindings'
parser = ArgumentParser(description=desc)
parser.add_argument("function", help="Operation to perform on docstrings", choices=["scrape","sub","copy"])
parser.add_argument("--xml_path")
parser.add_argument("--bindings_dir")
parser.add_argument("--output_dir")
parser.add_argument("--json_path")
parser.add_argument("--filter", default=None)
return parser.parse_args()
if __name__ == "__main__":
# Parse command line options and set up doxyxml.
args = argParse()
if args.function.lower() == 'scrape':
di = DoxyIndex(args.xml_path)
docstrings_dict = get_docstrings_dict(di)
with open(args.json_path, 'w') as fp:
json.dump(docstrings_dict, fp)
elif args.function.lower() == 'sub':
with open(args.json_path, 'r') as fp:
docstrings_dict = json.load(fp)
pydoc_files = glob.glob(os.path.join(args.bindings_dir,'*_pydoc_template.h'))
sub_docstring_in_pydoc_h(pydoc_files, docstrings_dict, args.output_dir, args.filter)
elif args.function.lower() == 'copy':
pydoc_files = glob.glob(os.path.join(args.bindings_dir,'*_pydoc_template.h'))
copy_docstring_templates(pydoc_files, args.output_dir)
+14 -14
View File
@@ -1,6 +1,7 @@
options:
parameters:
author: ''
catch_exceptions: 'True'
category: Custom
cmake_opt: ''
comment: ''
@@ -22,7 +23,6 @@ options:
sizing_mode: fixed
thread_safe_setters: ''
title: ''
window_size: 1280, 1024
states:
bus_sink: false
bus_source: false
@@ -43,18 +43,18 @@ blocks:
label2: ''
label3: ''
label4: ''
labels: '["LS", "LMS", "STA", "Linear Comb"]'
labels: '["LS", "LMS", "Linear Comb", "STA"]'
num_opts: '0'
option0: '0'
option1: '1'
option2: '2'
option3: '3'
option0: ''
option1: ''
option2: ''
option3: ''
option4: '4'
options: '[ieee802_11.LS, ieee802_11.LMS, ieee802_11.STA, ieee802_11.COMB]'
options: '[0, 1, 2, 3]'
orient: Qt.QHBoxLayout
type: int
value: '0'
widget: combo_box
widget: radio_buttons
states:
bus_sink: false
bus_source: false
@@ -100,7 +100,7 @@ blocks:
gui_hint: 3,1,1,1
label: ''
min_len: '200'
orient: Qt.Horizontal
orient: QtCore.Qt.Horizontal
rangeType: float
start: -20e-6
step: 1e-6
@@ -121,7 +121,7 @@ blocks:
gui_hint: 2,1,1,1
label: ''
min_len: '200'
orient: Qt.Horizontal
orient: QtCore.Qt.Horizontal
rangeType: int
start: '10'
step: '1'
@@ -154,7 +154,7 @@ blocks:
gui_hint: 3,0,1,1
label: ''
min_len: '200'
orient: Qt.Horizontal
orient: QtCore.Qt.Horizontal
rangeType: int
start: '0'
step: '1'
@@ -175,7 +175,7 @@ blocks:
gui_hint: 2,0,1,1
label: ''
min_len: '200'
orient: Qt.Horizontal
orient: QtCore.Qt.Horizontal
rangeType: float
start: '-15'
step: '0.1'
@@ -649,9 +649,9 @@ blocks:
affinity: ''
alias: ''
bandwidth: 10e6
chan_est: chan_est
chan_est: ieee802_11.Equalizer(chan_est)
comment: ''
encoding: encoding
encoding: ieee802_11.Encoding(encoding)
frequency: 5.9e6
maxoutbuf: '0'
minoutbuf: '0'
+9 -9
View File
@@ -1,6 +1,7 @@
options:
parameters:
author: ''
catch_exceptions: 'True'
category: '[IEEE802.11]'
cmake_opt: ''
comment: ''
@@ -22,7 +23,6 @@ options:
sizing_mode: fixed
thread_safe_setters: ''
title: WiFi PHY Hier
window_size: 1280, 1024
states:
bus_sink: false
bus_source: false
@@ -53,7 +53,7 @@ blocks:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [528, 12]
coordinate: [584, 12.0]
rotation: 0
state: enabled
- name: sync_length
@@ -94,7 +94,7 @@ blocks:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [1008, 12]
coordinate: [1064, 12.0]
rotation: 0
state: enabled
- name: blocks_complex_to_mag_0
@@ -310,7 +310,7 @@ blocks:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [640, 12]
coordinate: [688, 12.0]
rotation: 0
state: enabled
- name: digital_chunks_to_symbols_xx_0
@@ -447,13 +447,13 @@ blocks:
hide: none
label: ''
short_id: ''
type: intx
type: ''
value: ieee802_11.BPSK_1_2
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [728, 12]
coordinate: [808, 12.0]
rotation: 0
state: enabled
- name: fft_vxx_0_0
@@ -512,7 +512,7 @@ blocks:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [920, 12]
coordinate: [960, 12.0]
rotation: 0
state: enabled
- name: ieee802_11_chunks_to_symbols_xx_0
@@ -675,7 +675,7 @@ blocks:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [424, 116]
coordinate: [456, 116.0]
rotation: 180
state: enabled
- name: sensitivity
@@ -692,7 +692,7 @@ blocks:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [824, 12]
coordinate: [1152, 12.0]
rotation: 0
state: enabled
- name: sync_long
+283 -124
View File
@@ -1,6 +1,7 @@
options:
parameters:
author: ''
catch_exceptions: 'True'
category: Custom
cmake_opt: ''
comment: ''
@@ -22,8 +23,10 @@ options:
sizing_mode: fixed
thread_safe_setters: ''
title: ''
window_size: 1280, 2048
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [8, 12.0]
rotation: 0
state: enabled
@@ -40,19 +43,23 @@ blocks:
label2: ''
label3: ''
label4: ''
labels: '["LS", "LMS", "STA", "Linear Comb"]'
labels: '["LS", "LMS", "Linear Comb", "STA"]'
num_opts: '0'
option0: '0'
option1: '1'
option2: '2'
option3: '3'
option4: '4'
options: '[ieee802_11.LS, ieee802_11.LMS, ieee802_11.STA, ieee802_11.COMB]'
options: '[0, 1, 2, 3]'
orient: Qt.QHBoxLayout
type: int
value: '0'
widget: radio_buttons
states:
coordinate: [312, 12.0]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [296, 12.0]
rotation: 0
state: enabled
- name: freq
@@ -88,6 +95,7 @@ blocks:
11p'', ''174 | 5870.0 | 11p'', ''176 | 5880.0 | 11p'', ''178 | 5890.0 | 11p'',
''180 | 5900.0 | 11p'', ''182 | 5910.0 | 11p'', ''184 | 5920.0 | 11p'']'
num_opts: '0'
option0: '0'
option1: '1'
option2: '2'
option3: '3'
@@ -109,7 +117,10 @@ blocks:
value: '5890000000'
widget: combo_box
states:
coordinate: [624, 12.0]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [608, 12.0]
rotation: 0
state: enabled
- name: gain
@@ -119,7 +130,7 @@ blocks:
gui_hint: ''
label: ''
min_len: '200'
orient: Qt.Horizontal
orient: QtCore.Qt.Horizontal
rangeType: float
start: '0'
step: '0.01'
@@ -127,7 +138,10 @@ blocks:
value: '0.75'
widget: counter_slider
states:
coordinate: [488, 12.0]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [472, 12.0]
rotation: 0
state: enabled
- name: lo_offset
@@ -143,6 +157,7 @@ blocks:
label4: ''
labels: '[]'
num_opts: '3'
option0: '0'
option1: 6e6
option2: 11e6
option3: '3'
@@ -153,6 +168,9 @@ blocks:
value: '0'
widget: combo_box
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [176, 12.0]
rotation: 0
state: enabled
@@ -169,6 +187,7 @@ blocks:
label4: ''
labels: '["5 MHz", "10 MHz", "20 MHz"]'
num_opts: '0'
option0: '0'
option1: '1'
option2: '2'
option3: '3'
@@ -179,7 +198,10 @@ blocks:
value: 10e6
widget: combo_box
states:
coordinate: [800, 12.0]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [784, 12.0]
rotation: 0
state: enabled
- name: sync_length
@@ -188,7 +210,10 @@ blocks:
comment: ''
value: '320'
states:
coordinate: [8, 133]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [8, 148.0]
rotation: 0
state: enabled
- name: window_size
@@ -197,6 +222,9 @@ blocks:
comment: ''
value: '48'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [8, 84.0]
rotation: 0
state: enabled
@@ -210,6 +238,9 @@ blocks:
minoutbuf: '0'
vlen: '1'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [1016, 312]
rotation: 0
state: enabled
@@ -223,6 +254,9 @@ blocks:
minoutbuf: '0'
vlen: '1'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [496, 208.0]
rotation: 0
state: enabled
@@ -235,7 +269,10 @@ blocks:
maxoutbuf: '0'
minoutbuf: '0'
states:
coordinate: [424, 328]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [440, 328.0]
rotation: 0
state: enabled
- name: blocks_delay_0
@@ -251,6 +288,9 @@ blocks:
type: complex
vlen: '1'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [536, 540.0]
rotation: 0
state: enabled
@@ -267,7 +307,10 @@ blocks:
type: complex
vlen: '1'
states:
coordinate: [264, 324]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [280, 312.0]
rotation: 0
state: enabled
- name: blocks_divide_xx_0
@@ -282,6 +325,9 @@ blocks:
type: float
vlen: '1'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [1168, 400]
rotation: 270
state: enabled
@@ -297,6 +343,9 @@ blocks:
unbuffered: 'True'
vlen: '1'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [768, 908]
rotation: 180
state: disabled
@@ -314,9 +363,12 @@ blocks:
type: float
vlen: '1'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [944, 180.0]
rotation: 0
state: true
state: enabled
- name: blocks_moving_average_xx_1
id: blocks_moving_average_xx
parameters:
@@ -331,9 +383,12 @@ blocks:
type: complex
vlen: '1'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [808, 284.0]
rotation: 0
state: true
state: enabled
- name: blocks_multiply_xx_0
id: blocks_multiply_xx
parameters:
@@ -346,6 +401,9 @@ blocks:
type: complex
vlen: '1'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [664, 296]
rotation: 0
state: enabled
@@ -360,6 +418,9 @@ blocks:
tag: packet_len
type: complex
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [584, 836]
rotation: 180
state: enabled
@@ -375,7 +436,10 @@ blocks:
type: complex
vlen: '1'
states:
coordinate: [944, 536.0]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [944, 528.0]
rotation: 0
state: enabled
- name: fft_vxx_0
@@ -393,6 +457,9 @@ blocks:
type: complex
window: window.rectangular(64)
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [168, 672]
rotation: 0
state: enabled
@@ -407,6 +474,9 @@ blocks:
minoutbuf: '0'
tech: '127'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [952, 916]
rotation: 180
state: disabled
@@ -421,6 +491,9 @@ blocks:
maxoutbuf: '0'
minoutbuf: '0'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [864, 676]
rotation: 0
state: enabled
@@ -428,7 +501,7 @@ blocks:
id: ieee802_11_frame_equalizer
parameters:
affinity: ''
algo: chan_est
algo: ieee802_11.Equalizer(chan_est)
alias: ''
bw: samp_rate
comment: ''
@@ -438,6 +511,9 @@ blocks:
maxoutbuf: '0'
minoutbuf: '0'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [432, 672]
rotation: 0
state: enabled
@@ -448,11 +524,14 @@ blocks:
alias: ''
comment: ''
debug: 'True'
log: 'True'
log: 'False'
maxoutbuf: '0'
minoutbuf: '0'
states:
coordinate: [984, 804]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [872, 796.0]
rotation: 180
state: enabled
- name: ieee802_11_sync_long_0
@@ -462,11 +541,14 @@ blocks:
alias: ''
comment: ''
debug: 'False'
log: 'True'
log: 'False'
maxoutbuf: '0'
minoutbuf: '0'
sync_length: sync_length
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [744, 508.0]
rotation: 0
state: enabled
@@ -483,6 +565,9 @@ blocks:
minoutbuf: '0'
threshold: '0.56'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [304, 488.0]
rotation: 0
state: enabled
@@ -572,6 +657,9 @@ blocks:
ymax: '2'
ymin: '-2'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [344, 828]
rotation: 180
state: enabled
@@ -592,16 +680,16 @@ blocks:
alpha9: '1.0'
autoscale: 'False'
axislabels: 'True'
color1: '"blue"'
color10: '"blue"'
color2: '"red"'
color3: '"green"'
color4: '"black"'
color5: '"cyan"'
color6: '"magenta"'
color7: '"yellow"'
color8: '"dark red"'
color9: '"dark green"'
color1: blue
color10: dark blue
color2: red
color3: green
color4: black
color5: cyan
color6: magenta
color7: yellow
color8: dark red
color9: dark green
comment: ''
ctrlpanel: 'False'
entags: 'True'
@@ -666,6 +754,9 @@ blocks:
ymin: '-1'
yunit: '""'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [1164, 520]
rotation: 270
state: enabled
@@ -780,38 +871,70 @@ blocks:
clock_source6: ''
clock_source7: ''
comment: ''
dc_offs_enb0: '""'
dc_offs_enb1: '""'
dc_offs_enb10: '""'
dc_offs_enb11: '""'
dc_offs_enb12: '""'
dc_offs_enb13: '""'
dc_offs_enb14: '""'
dc_offs_enb15: '""'
dc_offs_enb16: '""'
dc_offs_enb17: '""'
dc_offs_enb18: '""'
dc_offs_enb19: '""'
dc_offs_enb2: '""'
dc_offs_enb20: '""'
dc_offs_enb21: '""'
dc_offs_enb22: '""'
dc_offs_enb23: '""'
dc_offs_enb24: '""'
dc_offs_enb25: '""'
dc_offs_enb26: '""'
dc_offs_enb27: '""'
dc_offs_enb28: '""'
dc_offs_enb29: '""'
dc_offs_enb3: '""'
dc_offs_enb30: '""'
dc_offs_enb31: '""'
dc_offs_enb4: '""'
dc_offs_enb5: '""'
dc_offs_enb6: '""'
dc_offs_enb7: '""'
dc_offs_enb8: '""'
dc_offs_enb9: '""'
dc_offs0: 0+0j
dc_offs1: 0+0j
dc_offs10: 0+0j
dc_offs11: 0+0j
dc_offs12: 0+0j
dc_offs13: 0+0j
dc_offs14: 0+0j
dc_offs15: 0+0j
dc_offs16: 0+0j
dc_offs17: 0+0j
dc_offs18: 0+0j
dc_offs19: 0+0j
dc_offs2: 0+0j
dc_offs20: 0+0j
dc_offs21: 0+0j
dc_offs22: 0+0j
dc_offs23: 0+0j
dc_offs24: 0+0j
dc_offs25: 0+0j
dc_offs26: 0+0j
dc_offs27: 0+0j
dc_offs28: 0+0j
dc_offs29: 0+0j
dc_offs3: 0+0j
dc_offs30: 0+0j
dc_offs31: 0+0j
dc_offs4: 0+0j
dc_offs5: 0+0j
dc_offs6: 0+0j
dc_offs7: 0+0j
dc_offs8: 0+0j
dc_offs9: 0+0j
dc_offs_enb0: default
dc_offs_enb1: default
dc_offs_enb10: default
dc_offs_enb11: default
dc_offs_enb12: default
dc_offs_enb13: default
dc_offs_enb14: default
dc_offs_enb15: default
dc_offs_enb16: default
dc_offs_enb17: default
dc_offs_enb18: default
dc_offs_enb19: default
dc_offs_enb2: default
dc_offs_enb20: default
dc_offs_enb21: default
dc_offs_enb22: default
dc_offs_enb23: default
dc_offs_enb24: default
dc_offs_enb25: default
dc_offs_enb26: default
dc_offs_enb27: default
dc_offs_enb28: default
dc_offs_enb29: default
dc_offs_enb3: default
dc_offs_enb30: default
dc_offs_enb31: default
dc_offs_enb4: default
dc_offs_enb5: default
dc_offs_enb6: default
dc_offs_enb7: default
dc_offs_enb8: default
dc_offs_enb9: default
dev_addr: ''
dev_args: '""'
gain0: gain
@@ -846,38 +969,102 @@ blocks:
gain7: '0'
gain8: '0'
gain9: '0'
iq_imbal_enb0: '""'
iq_imbal_enb1: '""'
iq_imbal_enb10: '""'
iq_imbal_enb11: '""'
iq_imbal_enb12: '""'
iq_imbal_enb13: '""'
iq_imbal_enb14: '""'
iq_imbal_enb15: '""'
iq_imbal_enb16: '""'
iq_imbal_enb17: '""'
iq_imbal_enb18: '""'
iq_imbal_enb19: '""'
iq_imbal_enb2: '""'
iq_imbal_enb20: '""'
iq_imbal_enb21: '""'
iq_imbal_enb22: '""'
iq_imbal_enb23: '""'
iq_imbal_enb24: '""'
iq_imbal_enb25: '""'
iq_imbal_enb26: '""'
iq_imbal_enb27: '""'
iq_imbal_enb28: '""'
iq_imbal_enb29: '""'
iq_imbal_enb3: '""'
iq_imbal_enb30: '""'
iq_imbal_enb31: '""'
iq_imbal_enb4: '""'
iq_imbal_enb5: '""'
iq_imbal_enb6: '""'
iq_imbal_enb7: '""'
iq_imbal_enb8: '""'
iq_imbal_enb9: '""'
gain_type0: normalized
gain_type1: default
gain_type10: default
gain_type11: default
gain_type12: default
gain_type13: default
gain_type14: default
gain_type15: default
gain_type16: default
gain_type17: default
gain_type18: default
gain_type19: default
gain_type2: default
gain_type20: default
gain_type21: default
gain_type22: default
gain_type23: default
gain_type24: default
gain_type25: default
gain_type26: default
gain_type27: default
gain_type28: default
gain_type29: default
gain_type3: default
gain_type30: default
gain_type31: default
gain_type4: default
gain_type5: default
gain_type6: default
gain_type7: default
gain_type8: default
gain_type9: default
iq_imbal0: 0+0j
iq_imbal1: 0+0j
iq_imbal10: 0+0j
iq_imbal11: 0+0j
iq_imbal12: 0+0j
iq_imbal13: 0+0j
iq_imbal14: 0+0j
iq_imbal15: 0+0j
iq_imbal16: 0+0j
iq_imbal17: 0+0j
iq_imbal18: 0+0j
iq_imbal19: 0+0j
iq_imbal2: 0+0j
iq_imbal20: 0+0j
iq_imbal21: 0+0j
iq_imbal22: 0+0j
iq_imbal23: 0+0j
iq_imbal24: 0+0j
iq_imbal25: 0+0j
iq_imbal26: 0+0j
iq_imbal27: 0+0j
iq_imbal28: 0+0j
iq_imbal29: 0+0j
iq_imbal3: 0+0j
iq_imbal30: 0+0j
iq_imbal31: 0+0j
iq_imbal4: 0+0j
iq_imbal5: 0+0j
iq_imbal6: 0+0j
iq_imbal7: 0+0j
iq_imbal8: 0+0j
iq_imbal9: 0+0j
iq_imbal_enb0: default
iq_imbal_enb1: default
iq_imbal_enb10: default
iq_imbal_enb11: default
iq_imbal_enb12: default
iq_imbal_enb13: default
iq_imbal_enb14: default
iq_imbal_enb15: default
iq_imbal_enb16: default
iq_imbal_enb17: default
iq_imbal_enb18: default
iq_imbal_enb19: default
iq_imbal_enb2: default
iq_imbal_enb20: default
iq_imbal_enb21: default
iq_imbal_enb22: default
iq_imbal_enb23: default
iq_imbal_enb24: default
iq_imbal_enb25: default
iq_imbal_enb26: default
iq_imbal_enb27: default
iq_imbal_enb28: default
iq_imbal_enb29: default
iq_imbal_enb3: default
iq_imbal_enb30: default
iq_imbal_enb31: default
iq_imbal_enb4: default
iq_imbal_enb5: default
iq_imbal_enb6: default
iq_imbal_enb7: default
iq_imbal_enb8: default
iq_imbal_enb9: default
lo_export0: 'False'
lo_export1: 'False'
lo_export10: 'False'
@@ -945,38 +1132,6 @@ blocks:
maxoutbuf: '0'
minoutbuf: '0'
nchan: '1'
norm_gain0: 'True'
norm_gain1: 'False'
norm_gain10: 'False'
norm_gain11: 'False'
norm_gain12: 'False'
norm_gain13: 'False'
norm_gain14: 'False'
norm_gain15: 'False'
norm_gain16: 'False'
norm_gain17: 'False'
norm_gain18: 'False'
norm_gain19: 'False'
norm_gain2: 'False'
norm_gain20: 'False'
norm_gain21: 'False'
norm_gain22: 'False'
norm_gain23: 'False'
norm_gain24: 'False'
norm_gain25: 'False'
norm_gain26: 'False'
norm_gain27: 'False'
norm_gain28: 'False'
norm_gain29: 'False'
norm_gain3: 'False'
norm_gain30: 'False'
norm_gain31: 'False'
norm_gain4: 'False'
norm_gain5: 'False'
norm_gain6: 'False'
norm_gain7: 'False'
norm_gain8: 'False'
norm_gain9: 'False'
num_mboards: '1'
otw: ''
rx_agc0: Default
@@ -1021,6 +1176,7 @@ blocks:
sd_spec6: ''
sd_spec7: ''
show_lo_controls: 'False'
start_time: '-1.0'
stream_args: ''
stream_chans: '[]'
sync: sync
@@ -1034,6 +1190,9 @@ blocks:
time_source7: ''
type: fc32
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [32, 216]
rotation: 0
state: enabled
+289 -155
View File
@@ -1,6 +1,7 @@
options:
parameters:
author: ''
catch_exceptions: 'True'
category: Custom
cmake_opt: ''
comment: ''
@@ -22,8 +23,10 @@ options:
sizing_mode: fixed
thread_safe_setters: ''
title: ''
window_size: 1280, 1024
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [8, 12.0]
rotation: 0
state: enabled
@@ -40,19 +43,23 @@ blocks:
label2: ''
label3: ''
label4: ''
labels: '["LS", "LMS", "STA", "Linear Comb"]'
labels: '["LS", "LMS", "Linear Comb", "STA"]'
num_opts: '0'
option0: '0'
option1: '1'
option2: '2'
option3: '3'
option4: '4'
options: '[ieee802_11.LS, ieee802_11.LMS, ieee802_11.STA, ieee802_11.COMB]'
options: '[0, 1, 2, 3]'
orient: Qt.QHBoxLayout
type: int
value: '0'
widget: radio_buttons
states:
coordinate: [312, 12.0]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [296, 12.0]
rotation: 0
state: enabled
- name: encoding
@@ -69,6 +76,7 @@ blocks:
labels: '["BPSK 1/2", "BPSK 3/4", "QPSK 1/2", "QPSK 3/4", "16QAM 1/2", "16QAM
3/4", "64QAM 2/3", "64QAM 3/4"]'
num_opts: '0'
option0: '0'
option1: '1'
option2: '2'
option3: '3'
@@ -79,7 +87,10 @@ blocks:
value: '0'
widget: radio_buttons
states:
coordinate: [488, 12.0]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [472, 12.0]
rotation: 0
state: enabled
- name: freq
@@ -115,6 +126,7 @@ blocks:
11p'', ''174 | 5870.0 | 11p'', ''176 | 5880.0 | 11p'', ''178 | 5890.0 | 11p'',
''180 | 5900.0 | 11p'', ''182 | 5910.0 | 11p'', ''184 | 5920.0 | 11p'']'
num_opts: '0'
option0: '0'
option1: '1'
option2: '2'
option3: '3'
@@ -136,7 +148,10 @@ blocks:
value: '5890000000'
widget: combo_box
states:
coordinate: [656, 12.0]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [640, 12.0]
rotation: 0
state: enabled
- name: lo_offset
@@ -152,6 +167,7 @@ blocks:
label4: ''
labels: '[]'
num_opts: '3'
option0: '0'
option1: 6e6
option2: 11e6
option3: '3'
@@ -162,6 +178,9 @@ blocks:
value: '0'
widget: combo_box
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [176, 12.0]
rotation: 0
state: enabled
@@ -172,7 +191,7 @@ blocks:
gui_hint: ''
label: ''
min_len: '200'
orient: Qt.Horizontal
orient: QtCore.Qt.Horizontal
rangeType: float
start: '0'
step: '0.01'
@@ -180,7 +199,10 @@ blocks:
value: '0.75'
widget: counter_slider
states:
coordinate: [1016, 108.0]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [1136, 12.0]
rotation: 0
state: enabled
- name: samp_rate
@@ -196,6 +218,7 @@ blocks:
label4: ''
labels: '["5 MHz", "10 MHz", "20 MHz"]'
num_opts: '0'
option0: '0'
option1: '1'
option2: '2'
option3: '3'
@@ -206,7 +229,10 @@ blocks:
value: 10e6
widget: combo_box
states:
coordinate: [832, 12.0]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [816, 12.0]
rotation: 0
state: enabled
- name: tx_gain
@@ -216,7 +242,7 @@ blocks:
gui_hint: ''
label: ''
min_len: '200'
orient: Qt.Horizontal
orient: QtCore.Qt.Horizontal
rangeType: float
start: '0'
step: '0.01'
@@ -224,7 +250,10 @@ blocks:
value: '0.75'
widget: counter_slider
states:
coordinate: [1016, 12.0]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [1000, 12.0]
rotation: 0
state: enabled
- name: blocks_file_sink_0
@@ -239,7 +268,10 @@ blocks:
unbuffered: 'True'
vlen: '1'
states:
coordinate: [48, 403]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [48, 412.0]
rotation: 180
state: enabled
- name: blocks_multiply_const_vxx_0
@@ -254,8 +286,11 @@ blocks:
type: complex
vlen: '1'
states:
coordinate: [480, 564]
rotation: 180
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [476.0, 568]
rotation: 270
state: enabled
- name: blocks_pdu_to_tagged_stream_0_0
id: blocks_pdu_to_tagged_stream
@@ -268,7 +303,10 @@ blocks:
tag: packet_len
type: complex
states:
coordinate: [116, 592]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [124.0, 560]
rotation: 270
state: enabled
- name: blocks_tuntap_pdu_0
@@ -283,9 +321,12 @@ blocks:
minoutbuf: '0'
mtu: '440'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [616, 157]
rotation: 180
state: enabled
state: disabled
- name: foo_packet_pad2_0
id: foo_packet_pad2
parameters:
@@ -300,7 +341,10 @@ blocks:
pad_front: '10000'
pad_tail: '10000'
states:
coordinate: [424, 752]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [600, 676.0]
rotation: 0
state: enabled
- name: foo_wireshark_connector_0
@@ -314,7 +358,10 @@ blocks:
minoutbuf: '0'
tech: '127'
states:
coordinate: [232, 411]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [232, 420.0]
rotation: 180
state: enabled
- name: ieee802_11_ether_encap_0
@@ -327,9 +374,12 @@ blocks:
maxoutbuf: '0'
minoutbuf: '0'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [616, 265]
rotation: 0
state: enabled
state: disabled
- name: ieee802_11_mac_0
id: ieee802_11_mac
parameters:
@@ -342,6 +392,9 @@ blocks:
minoutbuf: '0'
src_mac: '[0x12, 0x34, 0x56, 0x78, 0x90, 0xab]'
states:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [608, 379]
rotation: 0
state: enabled
@@ -356,7 +409,10 @@ blocks:
maxoutbuf: '0'
minoutbuf: '0'
states:
coordinate: [328, 492]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [264, 340.0]
rotation: 180
state: enabled
- name: qtgui_const_sink_x_0
@@ -445,7 +501,10 @@ blocks:
ymax: '2'
ymin: '-2'
states:
coordinate: [192, 788.0]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [208, 756.0]
rotation: 0
state: enabled
- name: uhd_usrp_sink_0
@@ -593,6 +652,38 @@ blocks:
gain7: '0'
gain8: '0'
gain9: '0'
gain_type0: normalized
gain_type1: default
gain_type10: default
gain_type11: default
gain_type12: default
gain_type13: default
gain_type14: default
gain_type15: default
gain_type16: default
gain_type17: default
gain_type18: default
gain_type19: default
gain_type2: default
gain_type20: default
gain_type21: default
gain_type22: default
gain_type23: default
gain_type24: default
gain_type25: default
gain_type26: default
gain_type27: default
gain_type28: default
gain_type29: default
gain_type3: default
gain_type30: default
gain_type31: default
gain_type4: default
gain_type5: default
gain_type6: default
gain_type7: default
gain_type8: default
gain_type9: default
len_tag_name: packet_len
lo_export0: 'False'
lo_export1: 'False'
@@ -661,38 +752,6 @@ blocks:
maxoutbuf: '0'
minoutbuf: '0'
nchan: '1'
norm_gain0: 'True'
norm_gain1: 'False'
norm_gain10: 'False'
norm_gain11: 'False'
norm_gain12: 'False'
norm_gain13: 'False'
norm_gain14: 'False'
norm_gain15: 'False'
norm_gain16: 'False'
norm_gain17: 'False'
norm_gain18: 'False'
norm_gain19: 'False'
norm_gain2: 'False'
norm_gain20: 'False'
norm_gain21: 'False'
norm_gain22: 'False'
norm_gain23: 'False'
norm_gain24: 'False'
norm_gain25: 'False'
norm_gain26: 'False'
norm_gain27: 'False'
norm_gain28: 'False'
norm_gain29: 'False'
norm_gain3: 'False'
norm_gain30: 'False'
norm_gain31: 'False'
norm_gain4: 'False'
norm_gain5: 'False'
norm_gain6: 'False'
norm_gain7: 'False'
norm_gain8: 'False'
norm_gain9: 'False'
num_mboards: '1'
otw: ''
samp_rate: samp_rate
@@ -705,6 +764,7 @@ blocks:
sd_spec6: ''
sd_spec7: ''
show_lo_controls: 'False'
start_time: '-1.0'
stream_args: ''
stream_chans: '[]'
sync: pc_clock
@@ -718,7 +778,10 @@ blocks:
time_source7: ''
type: fc32
states:
coordinate: [592, 728]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [768, 652.0]
rotation: 0
state: enabled
- name: uhd_usrp_source_0
@@ -832,38 +895,70 @@ blocks:
clock_source6: ''
clock_source7: ''
comment: ''
dc_offs_enb0: '""'
dc_offs_enb1: '""'
dc_offs_enb10: '""'
dc_offs_enb11: '""'
dc_offs_enb12: '""'
dc_offs_enb13: '""'
dc_offs_enb14: '""'
dc_offs_enb15: '""'
dc_offs_enb16: '""'
dc_offs_enb17: '""'
dc_offs_enb18: '""'
dc_offs_enb19: '""'
dc_offs_enb2: '""'
dc_offs_enb20: '""'
dc_offs_enb21: '""'
dc_offs_enb22: '""'
dc_offs_enb23: '""'
dc_offs_enb24: '""'
dc_offs_enb25: '""'
dc_offs_enb26: '""'
dc_offs_enb27: '""'
dc_offs_enb28: '""'
dc_offs_enb29: '""'
dc_offs_enb3: '""'
dc_offs_enb30: '""'
dc_offs_enb31: '""'
dc_offs_enb4: '""'
dc_offs_enb5: '""'
dc_offs_enb6: '""'
dc_offs_enb7: '""'
dc_offs_enb8: '""'
dc_offs_enb9: '""'
dc_offs0: 0+0j
dc_offs1: 0+0j
dc_offs10: 0+0j
dc_offs11: 0+0j
dc_offs12: 0+0j
dc_offs13: 0+0j
dc_offs14: 0+0j
dc_offs15: 0+0j
dc_offs16: 0+0j
dc_offs17: 0+0j
dc_offs18: 0+0j
dc_offs19: 0+0j
dc_offs2: 0+0j
dc_offs20: 0+0j
dc_offs21: 0+0j
dc_offs22: 0+0j
dc_offs23: 0+0j
dc_offs24: 0+0j
dc_offs25: 0+0j
dc_offs26: 0+0j
dc_offs27: 0+0j
dc_offs28: 0+0j
dc_offs29: 0+0j
dc_offs3: 0+0j
dc_offs30: 0+0j
dc_offs31: 0+0j
dc_offs4: 0+0j
dc_offs5: 0+0j
dc_offs6: 0+0j
dc_offs7: 0+0j
dc_offs8: 0+0j
dc_offs9: 0+0j
dc_offs_enb0: default
dc_offs_enb1: default
dc_offs_enb10: default
dc_offs_enb11: default
dc_offs_enb12: default
dc_offs_enb13: default
dc_offs_enb14: default
dc_offs_enb15: default
dc_offs_enb16: default
dc_offs_enb17: default
dc_offs_enb18: default
dc_offs_enb19: default
dc_offs_enb2: default
dc_offs_enb20: default
dc_offs_enb21: default
dc_offs_enb22: default
dc_offs_enb23: default
dc_offs_enb24: default
dc_offs_enb25: default
dc_offs_enb26: default
dc_offs_enb27: default
dc_offs_enb28: default
dc_offs_enb29: default
dc_offs_enb3: default
dc_offs_enb30: default
dc_offs_enb31: default
dc_offs_enb4: default
dc_offs_enb5: default
dc_offs_enb6: default
dc_offs_enb7: default
dc_offs_enb8: default
dc_offs_enb9: default
dev_addr: ''
dev_args: '""'
gain0: rx_gain
@@ -898,38 +993,102 @@ blocks:
gain7: '0'
gain8: '0'
gain9: '0'
iq_imbal_enb0: '""'
iq_imbal_enb1: '""'
iq_imbal_enb10: '""'
iq_imbal_enb11: '""'
iq_imbal_enb12: '""'
iq_imbal_enb13: '""'
iq_imbal_enb14: '""'
iq_imbal_enb15: '""'
iq_imbal_enb16: '""'
iq_imbal_enb17: '""'
iq_imbal_enb18: '""'
iq_imbal_enb19: '""'
iq_imbal_enb2: '""'
iq_imbal_enb20: '""'
iq_imbal_enb21: '""'
iq_imbal_enb22: '""'
iq_imbal_enb23: '""'
iq_imbal_enb24: '""'
iq_imbal_enb25: '""'
iq_imbal_enb26: '""'
iq_imbal_enb27: '""'
iq_imbal_enb28: '""'
iq_imbal_enb29: '""'
iq_imbal_enb3: '""'
iq_imbal_enb30: '""'
iq_imbal_enb31: '""'
iq_imbal_enb4: '""'
iq_imbal_enb5: '""'
iq_imbal_enb6: '""'
iq_imbal_enb7: '""'
iq_imbal_enb8: '""'
iq_imbal_enb9: '""'
gain_type0: normalized
gain_type1: default
gain_type10: default
gain_type11: default
gain_type12: default
gain_type13: default
gain_type14: default
gain_type15: default
gain_type16: default
gain_type17: default
gain_type18: default
gain_type19: default
gain_type2: default
gain_type20: default
gain_type21: default
gain_type22: default
gain_type23: default
gain_type24: default
gain_type25: default
gain_type26: default
gain_type27: default
gain_type28: default
gain_type29: default
gain_type3: default
gain_type30: default
gain_type31: default
gain_type4: default
gain_type5: default
gain_type6: default
gain_type7: default
gain_type8: default
gain_type9: default
iq_imbal0: 0+0j
iq_imbal1: 0+0j
iq_imbal10: 0+0j
iq_imbal11: 0+0j
iq_imbal12: 0+0j
iq_imbal13: 0+0j
iq_imbal14: 0+0j
iq_imbal15: 0+0j
iq_imbal16: 0+0j
iq_imbal17: 0+0j
iq_imbal18: 0+0j
iq_imbal19: 0+0j
iq_imbal2: 0+0j
iq_imbal20: 0+0j
iq_imbal21: 0+0j
iq_imbal22: 0+0j
iq_imbal23: 0+0j
iq_imbal24: 0+0j
iq_imbal25: 0+0j
iq_imbal26: 0+0j
iq_imbal27: 0+0j
iq_imbal28: 0+0j
iq_imbal29: 0+0j
iq_imbal3: 0+0j
iq_imbal30: 0+0j
iq_imbal31: 0+0j
iq_imbal4: 0+0j
iq_imbal5: 0+0j
iq_imbal6: 0+0j
iq_imbal7: 0+0j
iq_imbal8: 0+0j
iq_imbal9: 0+0j
iq_imbal_enb0: default
iq_imbal_enb1: default
iq_imbal_enb10: default
iq_imbal_enb11: default
iq_imbal_enb12: default
iq_imbal_enb13: default
iq_imbal_enb14: default
iq_imbal_enb15: default
iq_imbal_enb16: default
iq_imbal_enb17: default
iq_imbal_enb18: default
iq_imbal_enb19: default
iq_imbal_enb2: default
iq_imbal_enb20: default
iq_imbal_enb21: default
iq_imbal_enb22: default
iq_imbal_enb23: default
iq_imbal_enb24: default
iq_imbal_enb25: default
iq_imbal_enb26: default
iq_imbal_enb27: default
iq_imbal_enb28: default
iq_imbal_enb29: default
iq_imbal_enb3: default
iq_imbal_enb30: default
iq_imbal_enb31: default
iq_imbal_enb4: default
iq_imbal_enb5: default
iq_imbal_enb6: default
iq_imbal_enb7: default
iq_imbal_enb8: default
iq_imbal_enb9: default
lo_export0: 'False'
lo_export1: 'False'
lo_export10: 'False'
@@ -997,38 +1156,6 @@ blocks:
maxoutbuf: '0'
minoutbuf: '0'
nchan: '1'
norm_gain0: 'True'
norm_gain1: 'False'
norm_gain10: 'False'
norm_gain11: 'False'
norm_gain12: 'False'
norm_gain13: 'False'
norm_gain14: 'False'
norm_gain15: 'False'
norm_gain16: 'False'
norm_gain17: 'False'
norm_gain18: 'False'
norm_gain19: 'False'
norm_gain2: 'False'
norm_gain20: 'False'
norm_gain21: 'False'
norm_gain22: 'False'
norm_gain23: 'False'
norm_gain24: 'False'
norm_gain25: 'False'
norm_gain26: 'False'
norm_gain27: 'False'
norm_gain28: 'False'
norm_gain29: 'False'
norm_gain3: 'False'
norm_gain30: 'False'
norm_gain31: 'False'
norm_gain4: 'False'
norm_gain5: 'False'
norm_gain6: 'False'
norm_gain7: 'False'
norm_gain8: 'False'
norm_gain9: 'False'
num_mboards: '1'
otw: ''
rx_agc0: Default
@@ -1073,6 +1200,7 @@ blocks:
sd_spec6: ''
sd_spec7: ''
show_lo_controls: 'False'
start_time: '-1.0'
stream_args: ''
stream_chans: '[]'
sync: pc_clock
@@ -1086,8 +1214,11 @@ blocks:
time_source7: ''
type: fc32
states:
coordinate: [816, 744]
rotation: 0
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [880, 452.0]
rotation: 180
state: enabled
- name: wifi_phy_hier_0
id: wifi_phy_hier
@@ -1095,15 +1226,18 @@ blocks:
affinity: ''
alias: ''
bandwidth: samp_rate
chan_est: chan_est
chan_est: ieee802_11.Equalizer(chan_est)
comment: ''
encoding: encoding
encoding: ieee802_11.Encoding(encoding)
frequency: freq
maxoutbuf: '0'
minoutbuf: '0'
sensitivity: '0.56'
states:
coordinate: [664, 504]
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [600, 476.0]
rotation: 180
state: enabled
+40 -40
View File
@@ -1,6 +1,7 @@
options:
parameters:
author: ''
catch_exceptions: 'True'
category: Custom
cmake_opt: ''
comment: ''
@@ -22,7 +23,6 @@ options:
sizing_mode: fixed
thread_safe_setters: ''
title: ''
window_size: 1280, 1024
states:
bus_sink: false
bus_source: false
@@ -131,7 +131,7 @@ blocks:
gui_hint: ''
label: ''
min_len: '200'
orient: Qt.Horizontal
orient: QtCore.Qt.Horizontal
rangeType: int
start: '10'
step: '1'
@@ -194,7 +194,7 @@ blocks:
gui_hint: ''
label: ''
min_len: '200'
orient: Qt.Horizontal
orient: QtCore.Qt.Horizontal
rangeType: int
start: '0'
step: '1'
@@ -245,7 +245,7 @@ blocks:
gui_hint: ''
label: ''
min_len: '200'
orient: Qt.Horizontal
orient: QtCore.Qt.Horizontal
rangeType: float
start: '0'
step: '0.01'
@@ -331,7 +331,7 @@ blocks:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [664, 396.0]
coordinate: [704, 396.0]
rotation: 180
state: true
- name: foo_packet_pad2_0
@@ -778,6 +778,38 @@ blocks:
gain7: '0'
gain8: '0'
gain9: '0'
gain_type0: normalized
gain_type1: default
gain_type10: default
gain_type11: default
gain_type12: default
gain_type13: default
gain_type14: default
gain_type15: default
gain_type16: default
gain_type17: default
gain_type18: default
gain_type19: default
gain_type2: default
gain_type20: default
gain_type21: default
gain_type22: default
gain_type23: default
gain_type24: default
gain_type25: default
gain_type26: default
gain_type27: default
gain_type28: default
gain_type29: default
gain_type3: default
gain_type30: default
gain_type31: default
gain_type4: default
gain_type5: default
gain_type6: default
gain_type7: default
gain_type8: default
gain_type9: default
len_tag_name: packet_len
lo_export0: 'False'
lo_export1: 'False'
@@ -846,38 +878,6 @@ blocks:
maxoutbuf: '0'
minoutbuf: '0'
nchan: '1'
norm_gain0: 'True'
norm_gain1: 'False'
norm_gain10: 'False'
norm_gain11: 'False'
norm_gain12: 'False'
norm_gain13: 'False'
norm_gain14: 'False'
norm_gain15: 'False'
norm_gain16: 'False'
norm_gain17: 'False'
norm_gain18: 'False'
norm_gain19: 'False'
norm_gain2: 'False'
norm_gain20: 'False'
norm_gain21: 'False'
norm_gain22: 'False'
norm_gain23: 'False'
norm_gain24: 'False'
norm_gain25: 'False'
norm_gain26: 'False'
norm_gain27: 'False'
norm_gain28: 'False'
norm_gain29: 'False'
norm_gain3: 'False'
norm_gain30: 'False'
norm_gain31: 'False'
norm_gain4: 'False'
norm_gain5: 'False'
norm_gain6: 'False'
norm_gain7: 'False'
norm_gain8: 'False'
norm_gain9: 'False'
num_mboards: '1'
otw: ''
samp_rate: samp_rate
@@ -916,9 +916,9 @@ blocks:
affinity: ''
alias: ''
bandwidth: samp_rate
chan_est: '0'
chan_est: ieee802_11.LS
comment: ''
encoding: encoding
encoding: ieee802_11.Encoding(encoding)
frequency: freq
maxoutbuf: '0'
minoutbuf: '0'
@@ -927,7 +927,7 @@ blocks:
bus_sink: false
bus_source: false
bus_structure: null
coordinate: [464, 396.0]
coordinate: [440, 396.0]
rotation: 180
state: enabled
+1 -13
View File
@@ -3,20 +3,8 @@
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-ieee802_11
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# SPDX-License-Identifier: GPL-3.0-or-later
#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
install(FILES
ieee802_11_chunks_to_symbols.block.yml
+1 -3
View File
@@ -7,10 +7,8 @@ category: '[IEEE802.11]'
parameters:
- id: algo
label: Algorithm
dtype: int
dtype: raw
default: ieee802_11.LS
options: [ieee802_11.LS, ieee802_11.LMS, ieee802_11.COMB, ieee802_11.STA]
option_labels: [LS, LMS, Comb, STA]
- id: freq
label: Frequency
dtype: real
+1 -7
View File
@@ -7,12 +7,8 @@ category: '[IEEE802.11]'
parameters:
- id: encoding
label: Encoding
dtype: int
dtype: raw
default: ieee802_11.BPSK_1_2
options: [ieee802_11.BPSK_1_2, ieee802_11.BPSK_3_4, ieee802_11.QPSK_1_2, ieee802_11.QPSK_3_4,
ieee802_11.16QAM_1_2, ieee802_11.16QAM_3_4, ieee802_11.64QAM_2_3, ieee802_11.64QAM_3_4]
option_labels: [BPSK 1/2, BPSK 3/4, QPSK 1/2, QPSK 3/4, 16QAM 1/2, 16QAM 3/4,
64QAM 2/3, 64QAM 3/4]
- id: debug
label: Debug
dtype: bool
@@ -28,8 +24,6 @@ outputs:
- domain: stream
dtype: byte
multiplicity: '1'
asserts:
- ${ encoding in range(8) }
templates:
imports: import ieee802_11
+6 -21
View File
@@ -1,25 +1,15 @@
# Copyright 2011,2012 Free Software Foundation, Inc.
#
# Copyright (C) 2013, 2016 Bastian Bloessl <bloessl@ccs-labs.org>
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-ieee802_11
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# SPDX-License-Identifier: GPL-3.0-or-later
#
########################################################################
# Install public header files
########################################################################
list(APPEND include_sources
install(FILES
api.h
chunks_to_symbols.h
constellations.h
@@ -33,10 +23,5 @@ list(APPEND include_sources
signal_field.h
sync_long.h
sync_short.h
)
install(
FILES ${include_sources}
DESTINATION ${GR_INCLUDE_DIR}
COMPONENT "ieee802_11_devel"
DESTINATION include/ieee802_11
)
+5 -11
View File
@@ -1,19 +1,13 @@
/*
* Copyright (C) 2013 Bastian Bloessl <bloessl@ccs-labs.org>
* Copyright 2011 Free Software Foundation, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This file was generated by gr_modtool, a tool from the GNU Radio framework
* This file is a part of gr-ieee802_11
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* SPDX-License-Identifier: GPL-3.0-or-later
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INCLUDED_IEEE802_11_API_H
#define INCLUDED_IEEE802_11_API_H
+1 -1
View File
@@ -26,7 +26,7 @@ namespace ieee802_11 {
class IEEE802_11_API chunks_to_symbols : virtual public tagged_stream_block
{
public:
typedef boost::shared_ptr<chunks_to_symbols> sptr;
typedef std::shared_ptr<chunks_to_symbols> sptr;
static sptr make();
};
+8 -4
View File
@@ -27,8 +27,9 @@ namespace ieee802_11 {
class IEEE802_11_API constellation_bpsk : virtual public digital::constellation
{
public:
typedef boost::shared_ptr<gr::ieee802_11::constellation_bpsk> sptr;
typedef std::shared_ptr<gr::ieee802_11::constellation_bpsk> sptr;
static sptr make();
sptr base() { return std::dynamic_pointer_cast<gr::ieee802_11::constellation_bpsk>(shared_from_this()); }
protected:
constellation_bpsk();
@@ -37,8 +38,9 @@ protected:
class IEEE802_11_API constellation_qpsk : virtual public digital::constellation
{
public:
typedef boost::shared_ptr<gr::ieee802_11::constellation_qpsk> sptr;
typedef std::shared_ptr<gr::ieee802_11::constellation_qpsk> sptr;
static sptr make();
sptr base() { return std::dynamic_pointer_cast<gr::ieee802_11::constellation_qpsk>(shared_from_this()); }
protected:
constellation_qpsk();
@@ -47,8 +49,9 @@ protected:
class IEEE802_11_API constellation_16qam : virtual public digital::constellation
{
public:
typedef boost::shared_ptr<gr::ieee802_11::constellation_16qam> sptr;
typedef std::shared_ptr<gr::ieee802_11::constellation_16qam> sptr;
static sptr make();
sptr base() { return std::dynamic_pointer_cast<gr::ieee802_11::constellation_16qam>(shared_from_this()); }
protected:
constellation_16qam();
@@ -57,8 +60,9 @@ protected:
class IEEE802_11_API constellation_64qam : virtual public digital::constellation
{
public:
typedef boost::shared_ptr<gr::ieee802_11::constellation_64qam> sptr;
typedef std::shared_ptr<gr::ieee802_11::constellation_64qam> sptr;
static sptr make();
sptr base() { return std::dynamic_pointer_cast<gr::ieee802_11::constellation_64qam>(shared_from_this()); }
protected:
constellation_64qam();
+1 -1
View File
@@ -26,7 +26,7 @@ namespace ieee802_11 {
class IEEE802_11_API decode_mac : virtual public block
{
public:
typedef boost::shared_ptr<decode_mac> sptr;
typedef std::shared_ptr<decode_mac> sptr;
static sptr make(bool log = false, bool debug = false);
};
+1 -1
View File
@@ -26,7 +26,7 @@ namespace ieee802_11 {
class IEEE802_11_API ether_encap : virtual public block
{
public:
typedef boost::shared_ptr<ether_encap> sptr;
typedef std::shared_ptr<ether_encap> sptr;
static sptr make(bool debug);
};
+1 -1
View File
@@ -30,7 +30,7 @@ namespace ieee802_11 {
class IEEE802_11_API extract_csi : virtual public gr::sync_block
{
public:
typedef boost::shared_ptr<extract_csi> sptr;
typedef std::shared_ptr<extract_csi> sptr;
static sptr make();
};
+4 -3
View File
@@ -23,6 +23,9 @@
#include <gnuradio/block.h>
#include <ieee802_11/api.h>
namespace gr {
namespace ieee802_11 {
enum Equalizer {
LS = 0,
LMS = 1,
@@ -30,14 +33,12 @@ enum Equalizer {
STA = 3,
};
namespace gr {
namespace ieee802_11 {
class IEEE802_11_API frame_equalizer : virtual public gr::block
{
public:
typedef boost::shared_ptr<frame_equalizer> sptr;
typedef std::shared_ptr<frame_equalizer> sptr;
static sptr make(Equalizer algo, double freq, double bw, bool log, bool debug);
virtual void set_algorithm(Equalizer algo) = 0;
virtual void set_bandwidth(double bw) = 0;
+1 -1
View File
@@ -26,7 +26,7 @@ namespace ieee802_11 {
class IEEE802_11_API mac : virtual public block
{
public:
typedef boost::shared_ptr<mac> sptr;
typedef std::shared_ptr<mac> sptr;
static sptr make(std::vector<uint8_t> src_mac,
std::vector<uint8_t> dst_mac,
std::vector<uint8_t> bss_mac);
+4 -4
View File
@@ -20,6 +20,9 @@
#include <gnuradio/block.h>
#include <ieee802_11/api.h>
namespace gr {
namespace ieee802_11 {
enum Encoding {
BPSK_1_2 = 0,
BPSK_3_4 = 1,
@@ -31,13 +34,10 @@ enum Encoding {
QAM64_3_4 = 7,
};
namespace gr {
namespace ieee802_11 {
class IEEE802_11_API mapper : virtual public block
{
public:
typedef boost::shared_ptr<mapper> sptr;
typedef std::shared_ptr<mapper> sptr;
static sptr make(Encoding mcs, bool debug = false);
virtual void set_encoding(Encoding mcs) = 0;
};
+1 -1
View File
@@ -26,7 +26,7 @@ namespace ieee802_11 {
class IEEE802_11_API parse_mac : virtual public block
{
public:
typedef boost::shared_ptr<parse_mac> sptr;
typedef std::shared_ptr<parse_mac> sptr;
static sptr make(bool log = false, bool debug = false);
};
+2 -1
View File
@@ -20,6 +20,7 @@
#include <gnuradio/digital/packet_header_default.h>
#include <ieee802_11/api.h>
#include <memory>
namespace gr {
namespace ieee802_11 {
@@ -27,7 +28,7 @@ namespace ieee802_11 {
class IEEE802_11_API signal_field : virtual public digital::packet_header_default
{
public:
typedef boost::shared_ptr<signal_field> sptr;
typedef std::shared_ptr<signal_field> sptr;
static sptr make();
protected:
+1 -1
View File
@@ -26,7 +26,7 @@ namespace ieee802_11 {
class IEEE802_11_API sync_long : virtual public block
{
public:
typedef boost::shared_ptr<sync_long> sptr;
typedef std::shared_ptr<sync_long> sptr;
static sptr make(unsigned int sync_length, bool log = false, bool debug = false);
};
+1 -1
View File
@@ -26,7 +26,7 @@ namespace ieee802_11 {
class IEEE802_11_API sync_short : virtual public block
{
public:
typedef boost::shared_ptr<sync_short> sptr;
typedef std::shared_ptr<sync_short> sptr;
static sptr make(double threshold,
unsigned int min_plateau,
bool log = false,
+7 -14
View File
@@ -1,18 +1,9 @@
# Copyright 2011,2012,2016,2018,2019 Free Software Foundation, Inc.
#
# Copyright (C) 2013, 2016 Bastian Bloessl <bloessl@ccs-labs.org>
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-ieee802_11
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# SPDX-License-Identifier: GPL-3.0-or-later
#
########################################################################
@@ -75,7 +66,9 @@ target_link_libraries(gnuradio-ieee802_11
gnuradio::gnuradio-blocks
gnuradio::gnuradio-analog
gnuradio::gnuradio-fft
gnuradio::gnuradio-digital)
gnuradio::gnuradio-digital
Volk::volk
)
target_include_directories(gnuradio-ieee802_11
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
PUBLIC $<INSTALL_INTERFACE:include>
-1
View File
@@ -17,7 +17,6 @@
#include "chunks_to_symbols_impl.h"
#include "utils.h"
#include <gnuradio/io_signature.h>
#include <gnuradio/tag_checker.h>
#include <assert.h>
using namespace gr::ieee802_11;
+1 -1
View File
@@ -35,7 +35,7 @@ public:
gr_vector_void_star& output_items);
private:
boost::shared_ptr<gr::digital::constellation> d_mapping;
std::shared_ptr<gr::digital::constellation> d_mapping;
constellation_bpsk::sptr d_bpsk;
constellation_qpsk::sptr d_qpsk;
constellation_16qam::sptr d_16qam;
+2
View File
@@ -21,6 +21,8 @@
#include <gnuradio/io_signature.h>
#include <boost/crc.hpp>
#include <boost/format.hpp>
#include <iomanip>
using namespace gr::ieee802_11;
+1 -1
View File
@@ -33,7 +33,7 @@ public:
int n,
gr_complex* symbols,
uint8_t* bits,
boost::shared_ptr<gr::digital::constellation> mod) = 0;
std::shared_ptr<gr::digital::constellation> mod) = 0;
virtual double get_snr() = 0;
static const gr_complex POLARITY[127];
+1 -1
View File
@@ -23,7 +23,7 @@ void comb::equalize(gr_complex* in,
int n,
gr_complex* symbols,
uint8_t* bits,
boost::shared_ptr<gr::digital::constellation> mod)
std::shared_ptr<gr::digital::constellation> mod)
{
gr_complex pilot[4];
+1 -1
View File
@@ -31,7 +31,7 @@ public:
int n,
gr_complex* symbols,
uint8_t* bits,
boost::shared_ptr<gr::digital::constellation> mod);
std::shared_ptr<gr::digital::constellation> mod);
double get_snr();
private:
+1 -1
View File
@@ -25,7 +25,7 @@ void lms::equalize(gr_complex* in,
int n,
gr_complex* symbols,
uint8_t* bits,
boost::shared_ptr<gr::digital::constellation> mod)
std::shared_ptr<gr::digital::constellation> mod)
{
if (n == 0) {
+1 -1
View File
@@ -32,7 +32,7 @@ public:
int n,
gr_complex* symbols,
uint8_t* bits,
boost::shared_ptr<gr::digital::constellation> mod);
std::shared_ptr<gr::digital::constellation> mod);
private:
double get_snr();
+1 -1
View File
@@ -25,7 +25,7 @@ void ls::equalize(gr_complex* in,
int n,
gr_complex* symbols,
uint8_t* bits,
boost::shared_ptr<gr::digital::constellation> mod)
std::shared_ptr<gr::digital::constellation> mod)
{
if (n == 0) {
+1 -1
View File
@@ -32,7 +32,7 @@ public:
int n,
gr_complex* symbols,
uint8_t* bits,
boost::shared_ptr<gr::digital::constellation> mod);
std::shared_ptr<gr::digital::constellation> mod);
virtual double get_snr();
private:
+1 -1
View File
@@ -25,7 +25,7 @@ void sta::equalize(gr_complex* in,
int n,
gr_complex* symbols,
uint8_t* bits,
boost::shared_ptr<gr::digital::constellation> mod)
std::shared_ptr<gr::digital::constellation> mod)
{
if (n == 0) {
+1 -1
View File
@@ -32,7 +32,7 @@ public:
int n,
gr_complex* symbols,
uint8_t* bits,
boost::shared_ptr<gr::digital::constellation> mod);
std::shared_ptr<gr::digital::constellation> mod);
double get_snr();
private:
+1
View File
@@ -23,6 +23,7 @@
#include "frame_equalizer_impl.h"
#include "utils.h"
#include <gnuradio/io_signature.h>
#include <boost/format.hpp>
namespace gr {
namespace ieee802_11 {
+1 -1
View File
@@ -71,7 +71,7 @@ private:
uint8_t d_deinterleaved[48];
gr_complex symbols[48];
boost::shared_ptr<gr::digital::constellation> d_frame_mod;
std::shared_ptr<gr::digital::constellation> d_frame_mod;
constellation_bpsk::sptr d_bpsk;
constellation_qpsk::sptr d_qpsk;
constellation_16qam::sptr d_16qam;
+2
View File
@@ -20,6 +20,8 @@
#include <gnuradio/block_detail.h>
#include <gnuradio/io_signature.h>
#include <string>
#include <iomanip>
#include <boost/format.hpp>
using namespace gr::ieee802_11;
+7 -5
View File
@@ -19,9 +19,11 @@
#include <gnuradio/filter/fir_filter.h>
#include <gnuradio/io_signature.h>
#include <ieee802_11/sync_long.h>
#include <volk/volk.h>
#include <list>
#include <tuple>
#include <boost/format.hpp>
using namespace gr::ieee802_11;
using namespace std;
@@ -41,7 +43,7 @@ public:
: block("sync_long",
gr::io_signature::make2(2, 2, sizeof(gr_complex), sizeof(gr_complex)),
gr::io_signature::make(1, 1, sizeof(gr_complex))),
d_fir(gr::filter::kernel::fir_filter_ccc(1, LONG)),
d_fir(gr::filter::kernel::fir_filter_ccc(LONG)),
d_log(log),
d_debug(debug),
d_offset(0),
@@ -50,10 +52,12 @@ public:
{
set_tag_propagation_policy(block::TPP_DONT);
d_correlation = gr::fft::malloc_complex(8192);
d_correlation = (gr_complex*)volk_malloc(sizeof(gr_complex) * 8192, volk_get_alignment());
}
~sync_long_impl() { gr::fft::free(d_correlation); }
~sync_long_impl() {
volk_free(d_correlation);
}
int general_work(int noutput,
gr_vector_int& ninput_items,
@@ -252,7 +256,6 @@ sync_long::sptr sync_long::make(unsigned int sync_length, bool log, bool debug)
}
const std::vector<gr_complex> sync_long_impl::LONG = {
gr_complex(-0.0455, -1.0679), gr_complex(0.3528, -0.9865),
gr_complex(0.8594, 0.7348), gr_complex(0.1874, 0.2475),
gr_complex(0.5309, -0.7784), gr_complex(-1.0218, -0.4897),
@@ -285,5 +288,4 @@ const std::vector<gr_complex> sync_long_impl::LONG = {
gr_complex(0.5309, 0.7784), gr_complex(0.1874, -0.2475),
gr_complex(0.8594, -0.7348), gr_complex(0.3528, 0.9865),
gr_complex(-0.0455, 1.0679), gr_complex(1.3868, -0.0000),
};
+1
View File
@@ -19,6 +19,7 @@
#include <ieee802_11/sync_short.h>
#include <iostream>
#include <boost/format.hpp>
using namespace gr::ieee802_11;
+9
View File
@@ -20,6 +20,15 @@
#include <cassert>
#include <cstring>
using gr::ieee802_11::BPSK_1_2;
using gr::ieee802_11::BPSK_3_4;
using gr::ieee802_11::QPSK_1_2;
using gr::ieee802_11::QPSK_3_4;
using gr::ieee802_11::QAM16_1_2;
using gr::ieee802_11::QAM16_3_4;
using gr::ieee802_11::QAM64_2_3;
using gr::ieee802_11::QAM64_3_4;
ofdm_param::ofdm_param(Encoding e)
{
encoding = e;
+2
View File
@@ -23,6 +23,8 @@
#include <cinttypes>
#include <iostream>
using gr::ieee802_11::Encoding;
#define MAX_PAYLOAD_SIZE 1500
#define MAX_PSDU_SIZE (MAX_PAYLOAD_SIZE + 28) // MAC, CRC
#define MAX_SYM (((16 + 8 * MAX_PSDU_SIZE + 6) / 24) + 1)
@@ -414,7 +414,7 @@ void viterbi_decoder::viterbi_chunks_init_generic()
{
int i, j;
for (i = 0; i < 4; i++) {
for (i = 0; i < 64; i++) {
d_metric0_generic[i] = 0;
d_path0_generic[i] = 0;
}
+7 -15
View File
@@ -1,18 +1,9 @@
# Copyright 2011 Free Software Foundation, Inc.
#
# Copyright (C) 2013 Bastian Bloessl <bloessl@ccs-labs.org>
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-ieee802_11
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# SPDX-License-Identifier: GPL-3.0-or-later
#
########################################################################
@@ -23,6 +14,8 @@ if(NOT PYTHONINTERP_FOUND)
return()
endif()
add_subdirectory(bindings)
########################################################################
# Install python sources
########################################################################
@@ -38,5 +31,4 @@ GR_PYTHON_INSTALL(
########################################################################
include(GrTest)
set(GR_TEST_TARGET_DEPS gnuradio-ieee802-11)
set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/swig)
set(GR_TEST_TARGET_DEPS gnuradio-ieee802_11)
+6 -17
View File
@@ -1,18 +1,7 @@
#
# Copyright (C) 2013 Bastian Bloessl <bloessl@ccs-labs.org>
# Copyright 2008,2009 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# SPDX-License-Identifier: GPL-3.0-or-later
#
# The presence of this file turns this directory into a Python package
@@ -21,13 +10,13 @@
This is the GNU Radio IEEE802_11 module. Place your Python package
description here (python/__init__.py).
'''
from __future__ import unicode_literals
import os
# import swig generated symbols into the ieee802_11 namespace
# import pybind11 generated symbols into the ieee802_11 namespace
try:
# this might fail if the module is python-only
from .ieee802_11_swig import *
except ImportError:
from .ieee802_11_python import *
except ModuleNotFoundError:
pass
# import any pure python here
+51
View File
@@ -0,0 +1,51 @@
# Copyright 2020 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
########################################################################
# Check if there is C++ code at all
########################################################################
if(NOT ieee802_11_sources)
MESSAGE(STATUS "No C++ sources... skipping python bindings")
return()
endif(NOT ieee802_11_sources)
########################################################################
# Check for pygccxml
########################################################################
GR_PYTHON_CHECK_MODULE_RAW(
"pygccxml"
"import pygccxml"
PYGCCXML_FOUND
)
include(GrPybind)
########################################################################
# Python Bindings
########################################################################
list(APPEND ieee802_11_python_files
chunks_to_symbols_python.cc
constellations_python.cc
decode_mac_python.cc
ether_encap_python.cc
extract_csi_python.cc
frame_equalizer_python.cc
mac_python.cc
mapper_python.cc
parse_mac_python.cc
signal_field_python.cc
sync_long_python.cc
sync_short_python.cc
python_bindings.cc)
GR_PYBIND_MAKE_OOT(ieee802_11
../..
gr::ieee802_11
"${ieee802_11_python_files}")
install(TARGETS ieee802_11_python DESTINATION ${GR_PYTHON_DIR}/ieee802_11 COMPONENT pythonapi)
View File
+57
View File
@@ -0,0 +1,57 @@
import warnings
import argparse
import os
from gnuradio.bindtool import BindingGenerator
import pathlib
import sys
parser = argparse.ArgumentParser(description='Bind a GR Out of Tree Block')
parser.add_argument('--module', type=str,
help='Name of gr module containing file to bind (e.g. fft digital analog)')
parser.add_argument('--output_dir', default='/tmp',
help='Output directory of generated bindings')
parser.add_argument('--prefix', help='Prefix of Installed GNU Radio')
parser.add_argument('--src', help='Directory of gnuradio source tree',
default=os.path.dirname(os.path.abspath(__file__))+'/../../..')
parser.add_argument(
'--filename', help="File to be parsed")
parser.add_argument(
'--defines', help='Set additional defines for precompiler',default=(), nargs='*')
parser.add_argument(
'--include', help='Additional Include Dirs, separated', default=(), nargs='*')
parser.add_argument(
'--status', help='Location of output file for general status (used during cmake)', default=None
)
parser.add_argument(
'--flag_automatic', default='0'
)
parser.add_argument(
'--flag_pygccxml', default='0'
)
args = parser.parse_args()
prefix = args.prefix
output_dir = args.output_dir
defines = tuple(','.join(args.defines).split(','))
includes = ','.join(args.include)
name = args.module
namespace = ['gr', name]
prefix_include_root = name
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
bg = BindingGenerator(prefix, namespace,
prefix_include_root, output_dir, define_symbols=defines, addl_includes=includes,
catch_exceptions=False, write_json_output=False, status_output=args.status,
flag_automatic=True if args.flag_automatic.lower() in [
'1', 'true'] else False,
flag_pygccxml=True if args.flag_pygccxml.lower() in ['1', 'true'] else False)
bg.gen_file_binding(args.filename)
@@ -0,0 +1,59 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
/***********************************************************************************/
/* This file is automatically generated using bindtool and can be manually edited */
/* The following lines can be configured to regenerate this file during cmake */
/* If manual edits are made, the following tags should be modified accordingly. */
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(chunks_to_symbols.h) */
/* BINDTOOL_HEADER_FILE_HASH(3d2f4de89018fc7c7ee96d450ca48179) */
/***********************************************************************************/
#include <pybind11/complex.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
#include <ieee802_11/chunks_to_symbols.h>
// pydoc.h is automatically generated in the build directory
#include <chunks_to_symbols_pydoc.h>
void bind_chunks_to_symbols(py::module& m)
{
using chunks_to_symbols = ::gr::ieee802_11::chunks_to_symbols;
py::class_<chunks_to_symbols, gr::tagged_stream_block, gr::block, gr::basic_block,
std::shared_ptr<chunks_to_symbols>>(m, "chunks_to_symbols", D(chunks_to_symbols))
.def(py::init(&chunks_to_symbols::make),
D(chunks_to_symbols,make)
)
;
}
+125
View File
@@ -0,0 +1,125 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
/***********************************************************************************/
/* This file is automatically generated using bindtool and can be manually edited */
/* The following lines can be configured to regenerate this file during cmake */
/* If manual edits are made, the following tags should be modified accordingly. */
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(constellations.h) */
/* BINDTOOL_HEADER_FILE_HASH(b80d50dfe0fc254d8d6101aee3d2bcad) */
/***********************************************************************************/
#include <pybind11/complex.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
#include <ieee802_11/constellations.h>
// pydoc.h is automatically generated in the build directory
#include <constellations_pydoc.h>
void bind_constellations(py::module& m)
{
using constellation_bpsk = ::gr::ieee802_11::constellation_bpsk;
using constellation_qpsk = ::gr::ieee802_11::constellation_qpsk;
using constellation_16qam = ::gr::ieee802_11::constellation_16qam;
using constellation_64qam = ::gr::ieee802_11::constellation_64qam;
py::class_<constellation_bpsk, gr::digital::constellation,
std::shared_ptr<constellation_bpsk>>(m, "constellation_bpsk", D(constellation_bpsk), py::multiple_inheritance())
.def(py::init(&constellation_bpsk::make),
D(constellation_bpsk,make)
)
.def("base",&constellation_bpsk::base,
D(constellation_bpsk,base)
)
;
py::class_<constellation_qpsk, gr::digital::constellation,
std::shared_ptr<constellation_qpsk>>(m, "constellation_qpsk", D(constellation_qpsk), py::multiple_inheritance())
.def(py::init(&constellation_qpsk::make),
D(constellation_qpsk,make)
)
.def("base",&constellation_qpsk::base,
D(constellation_qpsk,base)
)
;
py::class_<constellation_16qam, gr::digital::constellation,
std::shared_ptr<constellation_16qam>>(m, "constellation_16qam", D(constellation_16qam), py::multiple_inheritance())
.def(py::init(&constellation_16qam::make),
D(constellation_16qam,make)
)
.def("base",&constellation_16qam::base,
D(constellation_16qam,base)
)
;
py::class_<constellation_64qam, gr::digital::constellation,
std::shared_ptr<constellation_64qam>>(m, "constellation_64qam", D(constellation_64qam), py::multiple_inheritance())
.def(py::init(&constellation_64qam::make),
D(constellation_64qam,make)
)
.def("base",&constellation_64qam::base,
D(constellation_64qam,base)
)
;
}
+61
View File
@@ -0,0 +1,61 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
/***********************************************************************************/
/* This file is automatically generated using bindtool and can be manually edited */
/* The following lines can be configured to regenerate this file during cmake */
/* If manual edits are made, the following tags should be modified accordingly. */
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(decode_mac.h) */
/* BINDTOOL_HEADER_FILE_HASH(cace2c32f544fb653ce489c979eb4082) */
/***********************************************************************************/
#include <pybind11/complex.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
#include <ieee802_11/decode_mac.h>
// pydoc.h is automatically generated in the build directory
#include <decode_mac_pydoc.h>
void bind_decode_mac(py::module& m)
{
using decode_mac = ::gr::ieee802_11::decode_mac;
py::class_<decode_mac, gr::block, gr::basic_block,
std::shared_ptr<decode_mac>>(m, "decode_mac", D(decode_mac))
.def(py::init(&decode_mac::make),
py::arg("log") = false,
py::arg("debug") = false,
D(decode_mac,make)
)
;
}
+1
View File
@@ -0,0 +1 @@
This directory stores templates for docstrings that are scraped from the include header files for each block
@@ -0,0 +1,27 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include "pydoc_macros.h"
#define D(...) DOC(gr,ieee802_11, __VA_ARGS__ )
/*
This file contains placeholders for docstrings for the Python bindings.
Do not edit! These were automatically extracted during the binding process
and will be overwritten during the build process
*/
static const char *__doc_gr_ieee802_11_chunks_to_symbols = R"doc()doc";
static const char *__doc_gr_ieee802_11_chunks_to_symbols_chunks_to_symbols = R"doc()doc";
static const char *__doc_gr_ieee802_11_chunks_to_symbols_make = R"doc()doc";
@@ -0,0 +1,66 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include "pydoc_macros.h"
#define D(...) DOC(gr,ieee802_11, __VA_ARGS__ )
/*
This file contains placeholders for docstrings for the Python bindings.
Do not edit! These were automatically extracted during the binding process
and will be overwritten during the build process
*/
static const char *__doc_gr_ieee802_11_constellation_bpsk = R"doc()doc";
static const char *__doc_gr_ieee802_11_constellation_bpsk_constellation_bpsk = R"doc()doc";
static const char *__doc_gr_ieee802_11_constellation_bpsk_make = R"doc()doc";
static const char *__doc_gr_ieee802_11_constellation_bpsk_base = R"doc()doc";
static const char *__doc_gr_ieee802_11_constellation_qpsk = R"doc()doc";
static const char *__doc_gr_ieee802_11_constellation_qpsk_constellation_qpsk = R"doc()doc";
static const char *__doc_gr_ieee802_11_constellation_qpsk_make = R"doc()doc";
static const char *__doc_gr_ieee802_11_constellation_qpsk_base = R"doc()doc";
static const char *__doc_gr_ieee802_11_constellation_16qam = R"doc()doc";
static const char *__doc_gr_ieee802_11_constellation_16qam_constellation_16qam = R"doc()doc";
static const char *__doc_gr_ieee802_11_constellation_16qam_make = R"doc()doc";
static const char *__doc_gr_ieee802_11_constellation_16qam_base = R"doc()doc";
static const char *__doc_gr_ieee802_11_constellation_64qam = R"doc()doc";
static const char *__doc_gr_ieee802_11_constellation_64qam_constellation_64qam = R"doc()doc";
static const char *__doc_gr_ieee802_11_constellation_64qam_make = R"doc()doc";
static const char *__doc_gr_ieee802_11_constellation_64qam_base = R"doc()doc";
@@ -0,0 +1,27 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include "pydoc_macros.h"
#define D(...) DOC(gr,ieee802_11, __VA_ARGS__ )
/*
This file contains placeholders for docstrings for the Python bindings.
Do not edit! These were automatically extracted during the binding process
and will be overwritten during the build process
*/
static const char *__doc_gr_ieee802_11_decode_mac = R"doc()doc";
static const char *__doc_gr_ieee802_11_decode_mac_decode_mac = R"doc()doc";
static const char *__doc_gr_ieee802_11_decode_mac_make = R"doc()doc";
@@ -0,0 +1,27 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include "pydoc_macros.h"
#define D(...) DOC(gr,ieee802_11, __VA_ARGS__ )
/*
This file contains placeholders for docstrings for the Python bindings.
Do not edit! These were automatically extracted during the binding process
and will be overwritten during the build process
*/
static const char *__doc_gr_ieee802_11_ether_encap = R"doc()doc";
static const char *__doc_gr_ieee802_11_ether_encap_ether_encap = R"doc()doc";
static const char *__doc_gr_ieee802_11_ether_encap_make = R"doc()doc";
@@ -0,0 +1,27 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include "pydoc_macros.h"
#define D(...) DOC(gr,ieee802_11, __VA_ARGS__ )
/*
This file contains placeholders for docstrings for the Python bindings.
Do not edit! These were automatically extracted during the binding process
and will be overwritten during the build process
*/
static const char *__doc_gr_ieee802_11_extract_csi = R"doc()doc";
static const char *__doc_gr_ieee802_11_extract_csi_extract_csi = R"doc()doc";
static const char *__doc_gr_ieee802_11_extract_csi_make = R"doc()doc";
@@ -0,0 +1,39 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include "pydoc_macros.h"
#define D(...) DOC(gr,ieee802_11, __VA_ARGS__ )
/*
This file contains placeholders for docstrings for the Python bindings.
Do not edit! These were automatically extracted during the binding process
and will be overwritten during the build process
*/
static const char *__doc_gr_ieee802_11_frame_equalizer = R"doc()doc";
static const char *__doc_gr_ieee802_11_frame_equalizer_frame_equalizer_0 = R"doc()doc";
static const char *__doc_gr_ieee802_11_frame_equalizer_frame_equalizer_1 = R"doc()doc";
static const char *__doc_gr_ieee802_11_frame_equalizer_make = R"doc()doc";
static const char *__doc_gr_ieee802_11_frame_equalizer_set_algorithm = R"doc()doc";
static const char *__doc_gr_ieee802_11_frame_equalizer_set_bandwidth = R"doc()doc";
static const char *__doc_gr_ieee802_11_frame_equalizer_set_frequency = R"doc()doc";
@@ -0,0 +1,27 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include "pydoc_macros.h"
#define D(...) DOC(gr,ieee802_11, __VA_ARGS__ )
/*
This file contains placeholders for docstrings for the Python bindings.
Do not edit! These were automatically extracted during the binding process
and will be overwritten during the build process
*/
static const char *__doc_gr_ieee802_11_mac = R"doc()doc";
static const char *__doc_gr_ieee802_11_mac_mac = R"doc()doc";
static const char *__doc_gr_ieee802_11_mac_make = R"doc()doc";
@@ -0,0 +1,33 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include "pydoc_macros.h"
#define D(...) DOC(gr,ieee802_11, __VA_ARGS__ )
/*
This file contains placeholders for docstrings for the Python bindings.
Do not edit! These were automatically extracted during the binding process
and will be overwritten during the build process
*/
static const char *__doc_gr_ieee802_11_mapper = R"doc()doc";
static const char *__doc_gr_ieee802_11_mapper_mapper_0 = R"doc()doc";
static const char *__doc_gr_ieee802_11_mapper_mapper_1 = R"doc()doc";
static const char *__doc_gr_ieee802_11_mapper_make = R"doc()doc";
static const char *__doc_gr_ieee802_11_mapper_set_encoding = R"doc()doc";
@@ -0,0 +1,27 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include "pydoc_macros.h"
#define D(...) DOC(gr,ieee802_11, __VA_ARGS__ )
/*
This file contains placeholders for docstrings for the Python bindings.
Do not edit! These were automatically extracted during the binding process
and will be overwritten during the build process
*/
static const char *__doc_gr_ieee802_11_parse_mac = R"doc()doc";
static const char *__doc_gr_ieee802_11_parse_mac_parse_mac = R"doc()doc";
static const char *__doc_gr_ieee802_11_parse_mac_make = R"doc()doc";
@@ -0,0 +1,27 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include "pydoc_macros.h"
#define D(...) DOC(gr,ieee802_11, __VA_ARGS__ )
/*
This file contains placeholders for docstrings for the Python bindings.
Do not edit! These were automatically extracted during the binding process
and will be overwritten during the build process
*/
static const char *__doc_gr_ieee802_11_signal_field = R"doc()doc";
static const char *__doc_gr_ieee802_11_signal_field_signal_field = R"doc()doc";
static const char *__doc_gr_ieee802_11_signal_field_make = R"doc()doc";
@@ -0,0 +1,27 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include "pydoc_macros.h"
#define D(...) DOC(gr,ieee802_11, __VA_ARGS__ )
/*
This file contains placeholders for docstrings for the Python bindings.
Do not edit! These were automatically extracted during the binding process
and will be overwritten during the build process
*/
static const char *__doc_gr_ieee802_11_sync_long = R"doc()doc";
static const char *__doc_gr_ieee802_11_sync_long_sync_long = R"doc()doc";
static const char *__doc_gr_ieee802_11_sync_long_make = R"doc()doc";
@@ -0,0 +1,27 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include "pydoc_macros.h"
#define D(...) DOC(gr,ieee802_11, __VA_ARGS__ )
/*
This file contains placeholders for docstrings for the Python bindings.
Do not edit! These were automatically extracted during the binding process
and will be overwritten during the build process
*/
static const char *__doc_gr_ieee802_11_sync_short = R"doc()doc";
static const char *__doc_gr_ieee802_11_sync_short_sync_short = R"doc()doc";
static const char *__doc_gr_ieee802_11_sync_short_make = R"doc()doc";
+60
View File
@@ -0,0 +1,60 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
/***********************************************************************************/
/* This file is automatically generated using bindtool and can be manually edited */
/* The following lines can be configured to regenerate this file during cmake */
/* If manual edits are made, the following tags should be modified accordingly. */
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(ether_encap.h) */
/* BINDTOOL_HEADER_FILE_HASH(280e9072b32d4443bd89d2ad5560bdea) */
/***********************************************************************************/
#include <pybind11/complex.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
#include <ieee802_11/ether_encap.h>
// pydoc.h is automatically generated in the build directory
#include <ether_encap_pydoc.h>
void bind_ether_encap(py::module& m)
{
using ether_encap = ::gr::ieee802_11::ether_encap;
py::class_<ether_encap, gr::block, gr::basic_block,
std::shared_ptr<ether_encap>>(m, "ether_encap", D(ether_encap))
.def(py::init(&ether_encap::make),
py::arg("debug"),
D(ether_encap,make)
)
;
}
+59
View File
@@ -0,0 +1,59 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
/***********************************************************************************/
/* This file is automatically generated using bindtool and can be manually edited */
/* The following lines can be configured to regenerate this file during cmake */
/* If manual edits are made, the following tags should be modified accordingly. */
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(extract_csi.h) */
/* BINDTOOL_HEADER_FILE_HASH(e25959f49b55fd96cbc9354d42ad8c72) */
/***********************************************************************************/
#include <pybind11/complex.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
#include <ieee802_11/extract_csi.h>
// pydoc.h is automatically generated in the build directory
#include <extract_csi_pydoc.h>
void bind_extract_csi(py::module& m)
{
using extract_csi = ::gr::ieee802_11::extract_csi;
py::class_<extract_csi, gr::sync_block, gr::block, gr::basic_block,
std::shared_ptr<extract_csi>>(m, "extract_csi", D(extract_csi))
.def(py::init(&extract_csi::make),
D(extract_csi,make)
)
;
}
+94
View File
@@ -0,0 +1,94 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
/***********************************************************************************/
/* This file is automatically generated using bindtool and can be manually edited */
/* The following lines can be configured to regenerate this file during cmake */
/* If manual edits are made, the following tags should be modified accordingly. */
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(frame_equalizer.h) */
/* BINDTOOL_HEADER_FILE_HASH(16ff5ed7a4d765b220d8e93bba89c627) */
/***********************************************************************************/
#include <pybind11/complex.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
#include <ieee802_11/frame_equalizer.h>
// pydoc.h is automatically generated in the build directory
#include <frame_equalizer_pydoc.h>
void bind_frame_equalizer(py::module& m)
{
using frame_equalizer = ::gr::ieee802_11::frame_equalizer;
py::class_<frame_equalizer, gr::block, gr::basic_block,
std::shared_ptr<frame_equalizer>>(m, "frame_equalizer", D(frame_equalizer))
.def(py::init(&frame_equalizer::make),
py::arg("algo"),
py::arg("freq"),
py::arg("bw"),
py::arg("log"),
py::arg("debug"),
D(frame_equalizer,make)
)
.def("set_algorithm",&frame_equalizer::set_algorithm,
py::arg("algo"),
D(frame_equalizer,set_algorithm)
)
.def("set_bandwidth",&frame_equalizer::set_bandwidth,
py::arg("bw"),
D(frame_equalizer,set_bandwidth)
)
.def("set_frequency",&frame_equalizer::set_frequency,
py::arg("freq"),
D(frame_equalizer,set_frequency)
)
;
py::enum_<::gr::ieee802_11::Equalizer>(m,"Equalizer")
.value("LS", ::gr::ieee802_11::LS) // 0
.value("LMS", ::gr::ieee802_11::LMS) // 1
.value("COMB", ::gr::ieee802_11::COMB) // 2
.value("STA", ::gr::ieee802_11::STA) // 3
.export_values()
;
py::implicitly_convertible<int, ::gr::ieee802_11::Equalizer>();
}
+78
View File
@@ -0,0 +1,78 @@
# Utilities for reading values in header files
from argparse import ArgumentParser
import re
class PybindHeaderParser:
def __init__(self, pathname):
with open(pathname,'r') as f:
self.file_txt = f.read()
def get_flag_automatic(self):
# p = re.compile(r'BINDTOOL_GEN_AUTOMATIC\(([^\s])\)')
# m = p.search(self.file_txt)
m = re.search(r'BINDTOOL_GEN_AUTOMATIC\(([^\s])\)', self.file_txt)
if (m and m.group(1) == '1'):
return True
else:
return False
def get_flag_pygccxml(self):
# p = re.compile(r'BINDTOOL_USE_PYGCCXML\(([^\s])\)')
# m = p.search(self.file_txt)
m = re.search(r'BINDTOOL_USE_PYGCCXML\(([^\s])\)', self.file_txt)
if (m and m.group(1) == '1'):
return True
else:
return False
def get_header_filename(self):
# p = re.compile(r'BINDTOOL_HEADER_FILE\(([^\s]*)\)')
# m = p.search(self.file_txt)
m = re.search(r'BINDTOOL_HEADER_FILE\(([^\s]*)\)', self.file_txt)
if (m):
return m.group(1)
else:
return None
def get_header_file_hash(self):
# p = re.compile(r'BINDTOOL_HEADER_FILE_HASH\(([^\s]*)\)')
# m = p.search(self.file_txt)
m = re.search(r'BINDTOOL_HEADER_FILE_HASH\(([^\s]*)\)', self.file_txt)
if (m):
return m.group(1)
else:
return None
def get_flags(self):
return f'{self.get_flag_automatic()};{self.get_flag_pygccxml()};{self.get_header_filename()};{self.get_header_file_hash()};'
def argParse():
"""Parses commandline args."""
desc='Reads the parameters from the comment block in the pybind files'
parser = ArgumentParser(description=desc)
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"])
parser.add_argument("pathname", help="Pathname of pybind c++ file to read, e.g. blockname_python.cc")
return parser.parse_args()
if __name__ == "__main__":
# Parse command line options and set up doxyxml.
args = argParse()
pbhp = PybindHeaderParser(args.pathname)
if args.function == "flag_auto":
print(pbhp.get_flag_automatic())
elif args.function == "flag_pygccxml":
print(pbhp.get_flag_pygccxml())
elif args.function == "header_filename":
print(pbhp.get_header_filename())
elif args.function == "header_file_hash":
print(pbhp.get_header_file_hash())
elif args.function == "all":
print(pbhp.get_flags())
+62
View File
@@ -0,0 +1,62 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
/***********************************************************************************/
/* This file is automatically generated using bindtool and can be manually edited */
/* The following lines can be configured to regenerate this file during cmake */
/* If manual edits are made, the following tags should be modified accordingly. */
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(mac.h) */
/* BINDTOOL_HEADER_FILE_HASH(1c47a20e97ec549a0e6ec5362f06ad6f) */
/***********************************************************************************/
#include <pybind11/complex.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
#include <ieee802_11/mac.h>
// pydoc.h is automatically generated in the build directory
#include <mac_pydoc.h>
void bind_mac(py::module& m)
{
using mac = ::gr::ieee802_11::mac;
py::class_<mac, gr::block, gr::basic_block,
std::shared_ptr<mac>>(m, "mac", D(mac))
.def(py::init(&mac::make),
py::arg("src_mac"),
py::arg("dst_mac"),
py::arg("bss_mac"),
D(mac,make)
)
;
}
+81
View File
@@ -0,0 +1,81 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
/***********************************************************************************/
/* This file is automatically generated using bindtool and can be manually edited */
/* The following lines can be configured to regenerate this file during cmake */
/* If manual edits are made, the following tags should be modified accordingly. */
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(mapper.h) */
/* BINDTOOL_HEADER_FILE_HASH(58c66a6e35e1e775b96dcb8f7b38b293) */
/***********************************************************************************/
#include <pybind11/complex.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
#include <ieee802_11/mapper.h>
// pydoc.h is automatically generated in the build directory
#include <mapper_pydoc.h>
void bind_mapper(py::module& m)
{
using mapper = ::gr::ieee802_11::mapper;
py::class_<mapper, gr::block, gr::basic_block,
std::shared_ptr<mapper>>(m, "mapper", D(mapper))
.def(py::init(&mapper::make),
py::arg("mcs"),
py::arg("debug") = false,
D(mapper,make)
)
.def("set_encoding",&mapper::set_encoding,
py::arg("mcs"),
D(mapper,set_encoding)
)
;
py::enum_<::gr::ieee802_11::Encoding>(m,"Encoding")
.value("BPSK_1_2", ::gr::ieee802_11::BPSK_1_2) // 0
.value("BPSK_3_4", ::gr::ieee802_11::BPSK_3_4) // 1
.value("QPSK_1_2", ::gr::ieee802_11::QPSK_1_2) // 2
.value("QPSK_3_4", ::gr::ieee802_11::QPSK_3_4) // 3
.value("QAM16_1_2", ::gr::ieee802_11::QAM16_1_2) // 4
.value("QAM16_3_4", ::gr::ieee802_11::QAM16_3_4) // 5
.value("QAM64_2_3", ::gr::ieee802_11::QAM64_2_3) // 6
.value("QAM64_3_4", ::gr::ieee802_11::QAM64_3_4) // 7
.export_values()
;
py::implicitly_convertible<int, ::gr::ieee802_11::Encoding>();
}
+61
View File
@@ -0,0 +1,61 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
/***********************************************************************************/
/* This file is automatically generated using bindtool and can be manually edited */
/* The following lines can be configured to regenerate this file during cmake */
/* If manual edits are made, the following tags should be modified accordingly. */
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(parse_mac.h) */
/* BINDTOOL_HEADER_FILE_HASH(ebc81ff01bea127fd4abde631ac5f0f3) */
/***********************************************************************************/
#include <pybind11/complex.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
#include <ieee802_11/parse_mac.h>
// pydoc.h is automatically generated in the build directory
#include <parse_mac_pydoc.h>
void bind_parse_mac(py::module& m)
{
using parse_mac = ::gr::ieee802_11::parse_mac;
py::class_<parse_mac, gr::block, gr::basic_block,
std::shared_ptr<parse_mac>>(m, "parse_mac", D(parse_mac))
.def(py::init(&parse_mac::make),
py::arg("log") = false,
py::arg("debug") = false,
D(parse_mac,make)
)
;
}
+78
View File
@@ -0,0 +1,78 @@
/*
* Copyright 2020 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#include <pybind11/pybind11.h>
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <numpy/arrayobject.h>
namespace py = pybind11;
// Headers for binding functions
/**************************************/
// The following comment block is used for
// gr_modtool to insert function prototypes
// Please do not delete
/**************************************/
// BINDING_FUNCTION_PROTOTYPES(
void bind_chunks_to_symbols(py::module& m);
void bind_constellations(py::module& m);
void bind_decode_mac(py::module& m);
void bind_ether_encap(py::module& m);
void bind_extract_csi(py::module& m);
void bind_frame_equalizer(py::module& m);
void bind_mac(py::module& m);
void bind_mapper(py::module& m);
void bind_parse_mac(py::module& m);
void bind_signal_field(py::module& m);
void bind_sync_long(py::module& m);
void bind_sync_short(py::module& m);
// ) END BINDING_FUNCTION_PROTOTYPES
// We need this hack because import_array() returns NULL
// for newer Python versions.
// This function is also necessary because it ensures access to the C API
// and removes a warning.
void* init_numpy()
{
import_array();
return NULL;
}
PYBIND11_MODULE(ieee802_11_python, m)
{
// Initialize the numpy C API
// (otherwise we will see segmentation faults)
init_numpy();
// Allow access to base block methods
py::module::import("gnuradio.gr");
py::module::import("gnuradio.digital");
/**************************************/
// The following comment block is used for
// gr_modtool to insert binding function calls
// Please do not delete
/**************************************/
// BINDING_FUNCTION_CALLS(
bind_chunks_to_symbols(m);
bind_constellations(m);
bind_decode_mac(m);
bind_ether_encap(m);
bind_extract_csi(m);
bind_frame_equalizer(m);
bind_mac(m);
bind_mapper(m);
bind_parse_mac(m);
bind_signal_field(m);
bind_sync_long(m);
bind_sync_short(m);
// ) END BINDING_FUNCTION_CALLS
}
+59
View File
@@ -0,0 +1,59 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
/***********************************************************************************/
/* This file is automatically generated using bindtool and can be manually edited */
/* The following lines can be configured to regenerate this file during cmake */
/* If manual edits are made, the following tags should be modified accordingly. */
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(signal_field.h) */
/* BINDTOOL_HEADER_FILE_HASH(423674352455f6357bd249e1f5221cb4) */
/***********************************************************************************/
#include <pybind11/complex.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
#include <ieee802_11/signal_field.h>
// pydoc.h is automatically generated in the build directory
#include <signal_field_pydoc.h>
void bind_signal_field(py::module& m)
{
using signal_field = ::gr::ieee802_11::signal_field;
py::class_<signal_field, gr::digital::packet_header_default,
std::shared_ptr<signal_field>>(m, "signal_field", D(signal_field), py::multiple_inheritance())
.def(py::init(&signal_field::make),
D(signal_field,make)
)
;
}
+62
View File
@@ -0,0 +1,62 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
/***********************************************************************************/
/* This file is automatically generated using bindtool and can be manually edited */
/* The following lines can be configured to regenerate this file during cmake */
/* If manual edits are made, the following tags should be modified accordingly. */
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(sync_long.h) */
/* BINDTOOL_HEADER_FILE_HASH(a0194fa153fe85f65ac2b217646c1d12) */
/***********************************************************************************/
#include <pybind11/complex.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
#include <ieee802_11/sync_long.h>
// pydoc.h is automatically generated in the build directory
#include <sync_long_pydoc.h>
void bind_sync_long(py::module& m)
{
using sync_long = ::gr::ieee802_11::sync_long;
py::class_<sync_long, gr::block, gr::basic_block,
std::shared_ptr<sync_long>>(m, "sync_long", D(sync_long))
.def(py::init(&sync_long::make),
py::arg("sync_length"),
py::arg("log") = false,
py::arg("debug") = false,
D(sync_long,make)
)
;
}
+63
View File
@@ -0,0 +1,63 @@
/*
* Copyright 2021 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
/***********************************************************************************/
/* This file is automatically generated using bindtool and can be manually edited */
/* The following lines can be configured to regenerate this file during cmake */
/* If manual edits are made, the following tags should be modified accordingly. */
/* BINDTOOL_GEN_AUTOMATIC(0) */
/* BINDTOOL_USE_PYGCCXML(0) */
/* BINDTOOL_HEADER_FILE(sync_short.h) */
/* BINDTOOL_HEADER_FILE_HASH(ce2bf4884eae2d4c7695586469e38b17) */
/***********************************************************************************/
#include <pybind11/complex.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
namespace py = pybind11;
#include <ieee802_11/sync_short.h>
// pydoc.h is automatically generated in the build directory
#include <sync_short_pydoc.h>
void bind_sync_short(py::module& m)
{
using sync_short = ::gr::ieee802_11::sync_short;
py::class_<sync_short, gr::block, gr::basic_block,
std::shared_ptr<sync_short>>(m, "sync_short", D(sync_short))
.def(py::init(&sync_short::make),
py::arg("threshold"),
py::arg("min_plateau"),
py::arg("log") = false,
py::arg("debug") = false,
D(sync_short,make)
)
;
}
-63
View File
@@ -1,63 +0,0 @@
#
# Copyright (C) 2013 Bastian Bloessl <bloessl@ccs-labs.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
########################################################################
# Check if there is C++ code at all
########################################################################
if(NOT ieee802_11_sources)
MESSAGE(STATUS "No C++ sources... skipping swig/")
return()
endif(NOT ieee802_11_sources)
########################################################################
# Include swig generation macros
########################################################################
find_package(SWIG)
find_package(PythonLibs)
if(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND)
return()
endif()
include(GrSwig)
include(GrPython)
########################################################################
# Setup swig generation
########################################################################
set(GR_SWIG_INCLUDE_DIRS $<TARGET_PROPERTY:gnuradio::runtime_swig,INTERFACE_INCLUDE_DIRECTORIES>)
set(GR_SWIG_TARGET_DEPS gnuradio::runtime_swig)
set(GR_SWIG_LIBRARIES gnuradio-ieee802_11)
set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/ieee802_11_swig_doc.i)
set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../include)
GR_SWIG_MAKE(ieee802_11_swig ieee802_11_swig.i)
########################################################################
# Install the build swig module
########################################################################
GR_SWIG_INSTALL(TARGETS ieee802_11_swig DESTINATION ${GR_PYTHON_DIR}/ieee802_11)
########################################################################
# Install swig .i files for development
########################################################################
install(
FILES
ieee802_11_swig.i
${CMAKE_CURRENT_BINARY_DIR}/ieee802_11_swig_doc.i
DESTINATION ${GR_INCLUDE_DIR}/ieee802_11/swig
)
-100
View File
@@ -1,100 +0,0 @@
/* -*- c++ -*- */
/*
* Copyright 2013, 2019 Bastian Bloessl <mail@bastibl.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define IEEE802_11_API
#define DIGITAL_API
%include "gnuradio.i" // the common stuff
//load generated python docstrings
%include "ieee802_11_swig_doc.i"
%{
#include "ieee802_11/chunks_to_symbols.h"
#include "ieee802_11/constellations.h"
#include "ieee802_11/decode_mac.h"
#include "ieee802_11/ether_encap.h"
#include "ieee802_11/extract_csi.h"
#include "ieee802_11/frame_equalizer.h"
#include "ieee802_11/mac.h"
#include "ieee802_11/mapper.h"
#include "ieee802_11/parse_mac.h"
#include "ieee802_11/signal_field.h"
#include "ieee802_11/sync_long.h"
#include "ieee802_11/sync_short.h"
%}
%include "gnuradio/digital/packet_header_default.h"
%ignore gr::digital::constellation_bpsk;
%ignore gr::digital::constellation_qpsk;
%ignore gr::digital::constellation_16qam;
%include "gnuradio/digital/constellation.h"
%include "ieee802_11/chunks_to_symbols.h"
%include "ieee802_11/constellations.h"
%include "ieee802_11/decode_mac.h"
%include "ieee802_11/ether_encap.h"
%include "ieee802_11/extract_csi.h"
%include "ieee802_11/frame_equalizer.h"
%include "ieee802_11/mac.h"
%include "ieee802_11/mapper.h"
%include "ieee802_11/parse_mac.h"
%include "ieee802_11/signal_field.h"
%include "ieee802_11/sync_long.h"
%include "ieee802_11/sync_short.h"
GR_SWIG_BLOCK_MAGIC2(ieee802_11, chunks_to_symbols);
GR_SWIG_BLOCK_MAGIC2(ieee802_11, decode_mac);
GR_SWIG_BLOCK_MAGIC2(ieee802_11, ether_encap);
GR_SWIG_BLOCK_MAGIC2(ieee802_11, extract_csi);
GR_SWIG_BLOCK_MAGIC2(ieee802_11, frame_equalizer);
GR_SWIG_BLOCK_MAGIC2(ieee802_11, mac);
GR_SWIG_BLOCK_MAGIC2(ieee802_11, mapper);
GR_SWIG_BLOCK_MAGIC2(ieee802_11, parse_mac);
GR_SWIG_BLOCK_MAGIC2(ieee802_11, sync_long);
GR_SWIG_BLOCK_MAGIC2(ieee802_11, sync_short);
%template(signal_field_sptr) boost::shared_ptr<gr::ieee802_11::signal_field>;
%pythoncode %{
signal_field_sptr.__repr__ = lambda self: "<signal_field>"
signal_field = signal_field.make;
%}
%template(constellation_bpsk_sptr) boost::shared_ptr<gr::ieee802_11::constellation_bpsk>;
%pythoncode %{
constellation_bpsk_sptr.__repr__ = lambda self: "<constellation BPSK>"
constellation_bpsk = constellation_bpsk.make;
%}
%template(constellation_qpsk_sptr) boost::shared_ptr<gr::ieee802_11::constellation_qpsk>;
%pythoncode %{
constellation_qpsk_sptr.__repr__ = lambda self: "<constellation QPSK>"
constellation_qpsk = constellation_qpsk.make;
%}
%template(constellation_16qam_sptr) boost::shared_ptr<gr::ieee802_11::constellation_16qam>;
%pythoncode %{
constellation_16qam_sptr.__repr__ = lambda self: "<constellation 16QAM>"
constellation_16qam = constellation_16qam.make;
%}
%template(constellation_64qam_sptr) boost::shared_ptr<gr::ieee802_11::constellation_64qam>;
%pythoncode %{
constellation_64qam_sptr.__repr__ = lambda self: "<constellation 64QAM>"
constellation_64qam = constellation_64qam.make;
%}