Skip to content

Commit

Permalink
google style and debugging problems with toml11
Browse files Browse the repository at this point in the history
  • Loading branch information
tanneberger committed May 11, 2024
1 parent bee13c1 commit d178111
Show file tree
Hide file tree
Showing 10 changed files with 376 additions and 328 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
result
.idea
cmake-build-debug
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
cmake_minimum_required(VERSION 3.22)
project(tetra-receiver)

SET(CMAKE_CXX_STANDARD 17)

add_executable(tetra-receiver
src/main.cpp)
src/main.cpp
src/config/config.cpp
)

target_compile_options(tetra-receiver PUBLIC -std=c++17 -Wall)

Expand All @@ -15,7 +20,7 @@ find_package(cxxopts REQUIRED)

include_directories(${GNURADIO_ALL_INCLUDE_DIRS})

target_link_libraries(tetra-receiver log4cpp gnuradio-digital gnuradio-analog gnuradio-filter gnuradio-blocks gnuradio-fft gnuradio-runtime gnuradio-pmt volk gnuradio-osmosdr)
target_link_libraries(tetra-receiver log4cpp volk gnuradio-osmosdr gnuradio-digital gnuradio-analog gnuradio-filter gnuradio-blocks gnuradio-fft gnuradio-runtime gnuradio-pmt )

enable_testing()

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Tetra Receiver

Receive multiple TETRA streams at once and send the bits out via UDP.
Receive multiple TETRA streams_ at once and send the bits out via UDP.

The tetra streams can be decoding using [`tetra-rx` from the osmocom tetra project](https://github.com/osmocom/osmo-tetra) or [`decoder` from the tetra-kit project](https://gitlab.com/larryth/tetra-kit).
The tetra streams_ can be decoding using [`tetra-rx` from the osmocom tetra project](https://github.com/osmocom/osmo-tetra) or [`decoder` from the tetra-kit project](https://gitlab.com/larryth/tetra-kit).

Usage with tetra-rx: `socat STDIO UDP-LISTEN:42000 | stdbuf -i0 -o0 tetra-rx /dev/stdin`

## Usage
```
Receive multiple TETRA streams at once and send the bits out via UDP
Receive multiple TETRA streams_ at once and send the bits out via UDP
Usage:
tetra-receiver [OPTION...]
Expand All @@ -20,18 +20,18 @@ Usage:
https://projects.osmocom.org/projects/gr-osmos
dr/wiki/GrOsmoSDR (default: "")
--center-frequency arg Center frequency of the SDR (default: 0)
--offsets arg Offsets of the TETRA streams
--offsets arg Offsets of the TETRA streams_
--samp-rate arg Sample rate of the sdr (default: 1000000)
--udp-start arg Start UDP port. Each stream gets its own UDP
port, starting at udp-start (default: 42000)
--udp-start arg Start UDP port_. Each Stream gets its own UDP
port_, starting at udp-start (default: 42000)
```

## Toml Config Format

When decoding TETRA streams the downlink and uplink are often a number of MHz apart.
To solve the problem of decoding multiple uplinks and downlinks without having big FIR filters operating at the SDRs sampling rate, one wants to first decimate into two smaller streams. One for all uplink and downlink channels respectively.
When decoding TETRA streams_ the downlink and uplink are often a number of MHz apart.
To solve the problem of decoding multiple uplinks and downlinks without having big FIR filters operating at the SDRs sampling rate, one wants to first Decimate into two smaller streams_. One for all uplink and downlink channels respectively.

Therefore this application supports multiple stages of decimation.
Therefore this application supports multiple stages of decimation_.

The config has mandatory global arguments `CenterFrequency`, `DeviceString` and `SampleRate` for the SDR.

Expand Down
4 changes: 2 additions & 2 deletions nixos-modules/tetra-receiver.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ in {
offsets = mkOption {
type = types.listOf types.int;
default = [ ];
description = " Offsets of the TETRA streams\n";
description = " Offsets of the TETRA streams_\n";
};
sampRate = mkOption {
type = types.int;
Expand All @@ -43,7 +43,7 @@ in {
type = types.int;
default = 42000;
description =
" Start UDP port. Each stream gets its own UDP port, starting at udp-start (default: 42000)\n";
" Start UDP port_. Each Stream gets its own UDP port_, starting at udp-start (default: 42000)\n";
};
user = mkOption {
type = types.str;
Expand Down
19 changes: 17 additions & 2 deletions pkgs/tetra-receiver.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,26 @@
, mpir
, gmpxx
, cxxopts
, toml11
, gtest
, toml11
, fetchFromGitHub
, stdenv
}:
let
toml11 = stdenv.mkDerivation {
pname = "toml11";
version = "3.7.1";

src = fetchFromGitHub {
owner = "ToruNiina";
repo = "toml11";
rev = "v3.8.1";
hash = "sha256-HnhXBvIjo1JXhp+hUQvjs83t5IBVbNN6o3ZGhB4WESQ=";
};

nativeBuildInputs = [
cmake
];
};
osmosdr = gnuradioPackages.osmosdr.overrideAttrs(_oldAttrs: {
outputs = [ "out" ];
});
Expand Down
Loading

0 comments on commit d178111

Please sign in to comment.