Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gnuradio 3.10 - 3.11 support #600

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
adfa928
Merge pull request #1 from ptrkrysik/master
bkerler Dec 30, 2019
20055b0
Merge pull request #2 from ptrkrysik/master
bkerler Aug 13, 2021
a9be65e
Support gnuradio 3.10/3.11
bkerler Mar 12, 2022
dda008c
Add patches from @Deligrim
bkerler Mar 12, 2022
dc7774c
Fix path issues
bkerler Mar 12, 2022
5accd4a
Additional fixes
bkerler Mar 12, 2022
14c94dc
More fixes
bkerler Mar 12, 2022
d667096
Fixes compilation issues
bkerler Mar 12, 2022
86ad3fe
Delete grgsm_livemon.py
bkerler Mar 18, 2022
bdb1a25
Delete grgsm_livemon_headless.py
bkerler Mar 18, 2022
6cd32dd
Update multiarfcns_receiver.py
bkerler Mar 18, 2022
c291538
Update firdes to window
bkerler Mar 19, 2022
4ec71cb
Fix grc
bkerler Mar 19, 2022
64a8ed2
Fix ffft filter
bkerler Mar 24, 2022
6ab0256
Revert dda008c998c9655bb55c2836c19a233d55e82865
bkerler Mar 31, 2022
cfb11e0
Update grgsm_scanner
bkerler Apr 6, 2022
564d8a0
Update grgsm_trx
bkerler Apr 6, 2022
154db06
Update grgsm_livemon.grc
bkerler Apr 7, 2022
f796a60
Fix device detection
bkerler Apr 8, 2022
cd59fb9
Fix grc message print issue
bkerler Apr 8, 2022
b47c978
Fix building of grgsm_livemon and grgsm_livemon_headless
velichkov Jul 20, 2022
6962465
Update the Ubuntu container to 22.04
velichkov Jul 20, 2022
4d97d59
In unit tests import gsm module from gnuradio
velichkov Jul 20, 2022
f4869c9
Add Fedora 36 container
velichkov Jul 22, 2022
0b71400
Merge pull request #3 from velichkov/maint-3.10-fixes
bkerler Jul 27, 2022
ad56749
Make the build reproducible
petterreinholdtsen Aug 26, 2022
f173e34
Merge pull request #4 from petterreinholdtsen/reproducable-build
bkerler Oct 29, 2022
de1d643
Fix decoding issue with gr3.10
bkerler Nov 14, 2022
a77cf59
Fix issues with radio_if.py and grgsm_trx
bkerler Jan 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
104 changes: 104 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 90
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeCategories:
- Regex: '^"(gnuradio)/'
Priority: 1
- Regex: '^<(gnuradio)/'
Priority: 2
- Regex: '^<(boost)/'
Priority: 98
- Regex: '^<[a-z]*>$'
Priority: 99
- Regex: '^".*"$'
Priority: 0
- Regex: '.*'
Priority: 10

IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ build*/
debian/tmp/
debian/files
.directory
.idea
86 changes: 43 additions & 43 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,28 @@ if(DEFINED ENV{PYBOMBS_PREFIX})
message(STATUS "PyBOMBS installed GNU Radio. Setting CMAKE_INSTALL_PREFIX to $ENV{PYBOMBS_PREFIX}")
endif()

# Make sure our local CMake Modules path comes first
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
# Find gnuradio to get access to the cmake modules
find_package(Gnuradio "3.10" REQUIRED)

# Set the version information here
set(VERSION_MAJOR 1)
set(VERSION_API 0)
set(VERSION_ABI 0)
set(VERSION_PATCH git)

cmake_policy(SET CMP0011 NEW)

# Enable generation of compile_commands.json for code completion engines
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

########################################################################
# Minimum Version Requirements
########################################################################

include(GrMinReq)

# Select the release build type by default to get optimization flags
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
Expand All @@ -41,51 +63,18 @@ set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
# Make sure our local CMake Modules path comes first
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)

# Set the version information here
set(VERSION_MAJOR 1)
set(VERSION_API 0)
set(VERSION_ABI 0)
set(VERSION_PATCH git)

cmake_policy(SET CMP0011 NEW)

# Enable generation of compile_commands.json for code completion engines
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

########################################################################
# Compiler specific setup
# Compiler settings
########################################################################
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
AND NOT WIN32)
#http://gcc.gnu.org/wiki/Visibility
add_definitions(-fvisibility=hidden)
endif()

IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
SET(CMAKE_CXX_STANDARD 11)
ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
SET(CMAKE_CXX_STANDARD 11)
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
SET(CMAKE_CXX_STANDARD 11)
ELSE()
message(WARNING "C++ standard could not be set because compiler is not GNU, Clang or MSVC.")
ENDIF()

IF(CMAKE_C_COMPILER_ID STREQUAL "GNU")
SET(CMAKE_C_STANDARD 11)
ELSEIF(CMAKE_C_COMPILER_ID MATCHES "Clang")
SET(CMAKE_C_STANDARD 11)
ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
SET(CMAKE_C_STANDARD 11)
ELSE()
message(WARNING "C standard could not be set because compiler is not GNU, Clang or MSVC.")
ENDIF()
include(GrCompilerSettings)

########################################################################
# Install directories
########################################################################
find_package(Gnuradio "3.8" REQUIRED COMPONENTS blocks filter fft CONFIG)
include(GrVersion)

include(GrPlatform) #define LIB_SUFFIX
Expand All @@ -94,8 +83,8 @@ if(NOT CMAKE_MODULES_DIR)
set(CMAKE_MODULES_DIR lib${LIB_SUFFIX}/cmake)
endif(NOT CMAKE_MODULES_DIR)

set(GR_INCLUDE_DIR include/grgsm)
set(GR_CMAKE_DIR ${CMAKE_MODULES_DIR}/gsm)
set(GR_INCLUDE_DIR include/gsm)
set(GR_CMAKE_DIR ${CMAKE_MODULES_DIR}/gnuradio-gsm)
set(GR_PKG_DATA_DIR ${GR_DATA_DIR}/${CMAKE_PROJECT_NAME})
set(GR_PKG_DOC_DIR ${GR_DOC_DIR}/${CMAKE_PROJECT_NAME})
set(GR_PKG_CONF_DIR ${GR_CONF_DIR}/${CMAKE_PROJECT_NAME}/conf.d)
Expand Down Expand Up @@ -159,20 +148,31 @@ add_custom_target(uninstall
########################################################################
# Add subdirectories
########################################################################
add_subdirectory(include/grgsm)
add_subdirectory(include/gsm)
add_subdirectory(lib)
add_subdirectory(apps)
add_subdirectory(docs)
add_subdirectory(swig)
add_subdirectory(python)
add_subdirectory(grc)
# 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/gsm)
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/gr-gsmConfig.cmake
DESTINATION ${CMAKE_MODULES_DIR}/grgsm
cmake/Modules/gnuradio-gsmConfig.cmake
DESTINATION ${CMAKE_MODULES_DIR}/gsm
)

include(CMakePackageConfigHelpers)
configure_package_config_file(
${PROJECT_SOURCE_DIR}/cmake/Modules/targetConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake/Modules/${target}Config.cmake
INSTALL_DESTINATION ${GR_CMAKE_DIR})
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Credits

*Roman Khassraf* \<rkhassraf (at) gmail.com\> - blocks for demultiplexing and decoding of voice channels, decryption block supporting all ciphers used in GSM, blocks for storing and reading GSM bursts, project planning and user support

*Vadim Yanitskiy* \<axilirator (at) gmail.com\> - control and data interface for the transceiver, grgsm_trx application
*Vadim Yanitskiy* \<axilirator (at) gmail.com\> - control and data interface for the transceiver, gsm_trx application

*Vasil Velichkov* \<vvvelichkov (at) gmail.com\> - automatic compilation of grc applications, fixes and user support

Expand Down
2 changes: 1 addition & 1 deletion TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## CI Testing

CI testing currently consists of attempting to build gr-gsm as described in the .docker files located under gr-gsm/tests/dockerfiles using travis-ci.org. If the build is successful, travis-ci will attempt to decode the test file located under gr-gsm/test_data and compare the results to this file: gr-gsm/tests/fixtures/grgsm_decode_test1_expected. See the gr-gsm/tests/scripts/decode.sh file for details.
CI testing currently consists of attempting to build gr-gsm as described in the .docker files located under gr-gsm/tests/dockerfiles using travis-ci.org. If the build is successful, travis-ci will attempt to decode the test file located under gr-gsm/test_data and compare the results to this file: gr-gsm/tests/fixtures/gsm_decode_test1_expected. See the gr-gsm/tests/scripts/decode.sh file for details.

## Integration testing

Expand Down
22 changes: 11 additions & 11 deletions apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,29 @@ add_subdirectory(helpers)
GRCC_COMPILE(grgsm_livemon)
GRCC_COMPILE(grgsm_livemon_headless)

set(grgsm_flowgraphs "")
OPTION(ENABLE_GRCC "Compile the flowgraphs with grcc" ON)
OPTION(ENABLE_GRGSM_LIVEMON "Compile grgsm_livemon" ON)
OPTION(ENABLE_GRGSM_LIVEMON_HEADLESS "Compile grgsm_livemon_headless" ON)
set(gsm_flowgraphs "")
#OPTION(ENABLE_GRCC "Compile the flowgraphs with grcc" ON)
Copy link
Contributor

@velichkov velichkov Jul 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bkerler,

Why did you comment out ENABLE_GRCC option? This seems to break generation of grgsm_livemon and grgsm_livemon_headless as reported in the gr-gsm's mailing list.

https://groups.google.com/g/gr-gsm/c/F1zUJz2DVEc/m/w3m85luRIQAJ

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I uncommented it because otherwise the package fails to compile due to gnuradio 3.9 package compiling changes. So far I couldn't figure out how to fix it as it refers to packages to import that can't be imported because they aren't compiled.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you post the exact error messages and list the packages that aren't compiled?

OPTION(ENABLE_GSM_LIVEMON "Compile grgsm_livemon" ON)
OPTION(ENABLE_GSM_LIVEMON_HEADLESS "Compile grgsm_livemon_headless" ON)

if(ENABLE_GRC AND ENABLE_GRCC AND ENABLE_GRGSM_LIVEMON)
list (APPEND grgsm_flowgraphs ${CMAKE_CURRENT_BINARY_DIR}/grgsm_livemon)
if(ENABLE_GRC AND ENABLE_GRCC AND ENABLE_GSM_LIVEMON)
list (APPEND gsm_flowgraphs ${CMAKE_CURRENT_BINARY_DIR}/grgsm_livemon)
endif()

if(ENABLE_GRC AND ENABLE_GRCC AND ENABLE_GRGSM_LIVEMON_HEADLESS)
list (APPEND grgsm_flowgraphs ${CMAKE_CURRENT_BINARY_DIR}/grgsm_livemon_headless)
if(ENABLE_GRC AND ENABLE_GRCC AND ENABLE_GSM_LIVEMON_HEADLESS)
list (APPEND gsm_flowgraphs ${CMAKE_CURRENT_BINARY_DIR}/grgsm_livemon_headless)
endif()

GR_PYTHON_INSTALL(
PROGRAMS
${grgsm_flowgraphs}
grgsm_scanner
grgsm_decode
grgsm_scanner
grgsm_trx
${gsm_flowgraphs}
DESTINATION bin
)

# The add_dependencies(...) is very important for the parallel build `make -j $(nproc)`
# The `pygen_apps` target is generated in GR_PYTHON_INSTALL function which calls
# GR_UNIQUE_TARGET that we redefine in GrccCompile.
add_dependencies(pygen_apps grgsm_swig)
add_dependencies(pygen_apps gsm_python)
10 changes: 5 additions & 5 deletions apps/README
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
This directory contains programs based on gr-gsm:
* grgsm_decode (old name: airprobe_decode.py) - program for decoding C0 channel
* grgsm_decode (old name: airprobe_decode.py) - program for decoding C0 channel
which is most close in terms of functionality to the old gsm-receiver
from Airprobe project, with ability to decode signalling channels and traffic channels with speech
(analysis of the data can be performed in Wireshark, decoded sound is stored to an audio file),
* grgsm_livemon (old name: airprobe_rtlsdr.py) - interactive monitor of a single C0 channel with analysis
* grgsm_livemon (old name: airprobe_rtlsdr.py) - interactive monitor of a single C0 channel with analysis
performed by Wireshark (command to run wireshark: sudo wireshark -k -f udp -Y gsmtap -i lo),
* grgsm_scanner (old name: airprobe_rtlsdr_scanner.py) - an application that scans GSM bands and prints
* grgsm_scanner (old name: airprobe_rtlsdr_scanner.py) - an application that scans GSM bands and prints
information about base transceiver stations transmitting in the area.

There are following helper programs for grgsm_decode program:

* grgsm_capture (old name: airprobe_rtlsdr_capture.py) - program for capturing GSM signal to a file
* grgsm_capture (old name: airprobe_rtlsdr_capture.py) - program for capturing GSM signal to a file
that can be later processed by grgsm_decode,
* grgsm_channelize (old name: gsm_channelize.py) - splits wideband capture file into multiple files - each contain
* grgsm_channelize (old name: gsm_channelize.py) - splits wideband capture file into multiple files - each contain
single GSM channel.

* grgsm_livemon_headless - command line version of grgsm_livemon. It
Expand Down
14 changes: 7 additions & 7 deletions apps/apps_data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.

set(grgsm_freedesktop_path ${GR_PKG_DATA_DIR}/gr-gsm/freedesktop)
set(gsm_freedesktop_path ${GR_PKG_DATA_DIR}/gr-gsm/freedesktop)

install(
FILES
grgsm-livemon.desktop
DESTINATION ${grgsm_freedesktop_path}
gsm-livemon.desktop
DESTINATION ${gsm_freedesktop_path}
COMPONENT "gr-gsm"
)

find_program(HAVE_XDG_UTILS xdg-desktop-menu)

if(UNIX AND HAVE_XDG_UTILS)
set(SRCDIR ${CMAKE_INSTALL_PREFIX}/${grgsm_freedesktop_path})
set(SRCDIR ${CMAKE_INSTALL_PREFIX}/${gsm_freedesktop_path})
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/grgsm_setup_freedesktop.in
${CMAKE_CURRENT_BINARY_DIR}/grgsm_setup_freedesktop
${CMAKE_CURRENT_SOURCE_DIR}/gsm_setup_freedesktop.in
${CMAKE_CURRENT_BINARY_DIR}/gsm_setup_freedesktop
@ONLY)
install(
PROGRAMS
${CMAKE_CURRENT_BINARY_DIR}/grgsm_setup_freedesktop
${CMAKE_CURRENT_BINARY_DIR}/gsm_setup_freedesktop
DESTINATION ${GR_PKG_LIBEXEC_DIR}
COMPONENT "gr-gsm"
)
Expand Down
Loading