Commit Graph

16 Commits

Author SHA1 Message Date
Piotr Krysik 7379e341b0 apps/grgsm_trx: migrate from getopt to argparse
Change-Id: I24a17b4cd44db0ce95a19d7470f4f09f3c85a26d
2018-09-12 00:37:40 +07:00
Vadim Yanitskiy 38baac9678 apps/grgsm_trx: fix inaccurate sample rate calculation
Change-Id: I0c309588fa0f7822abfb3919327639735db07679
2018-09-12 00:36:13 +07:00
Piotr Krysik 1cc264fb0c Revert "grgsm_trx: Migrated argument parsing to argparse" that shouldn't be pushed
This reverts commit c62a3d9f55.
2018-09-06 19:57:57 +02:00
Piotr Krysik c62a3d9f55 grgsm_trx: Migrated argument parsing to argparse
Argparse makes adding new parameters easier and
adds consistent way of handling default values of
parameters and printing of their help info.

Change-Id: Idf99fd7a581464aa2f77fe01e721dbd162686811
2018-09-05 21:36:34 +02:00
Vadim Yanitskiy 97dc84e9f3 apps/grgsm_trx: add baseband frequency shift feature
An ability to shift the baseband frequency would allow one to
run both base stations and (OsmocomBB-based) mobile stations on
any frequency (e.g. in 2.4 GHz WiFi band)!

This is achieved by adding a given frequency offset to the
result of "ARFCN -> RX/TX frequency" calculation.

Usage example:

  grgsm_trx --freq-offset -500M

Both RX (Downlink) and TX (Uplink) frequencies will be shifted
by 500 MHz back, e.g. tuning request to ARFCN 105 would result
in tuning the radio to 456.0 MHz (instead of 956.0 MHz).

Related: OS#3520 (https://osmocom.org/versions/136)
Change-Id: I42e397e47402a87f4141ef31b25eff4c8c1267e2
2018-09-05 02:36:08 +07:00
Vadim Yanitskiy 473b35be86 apps/grgsm_trx: introduce bind address option
The new option (-b --bind-addr) allows one to specify the bind
address for both DATA and CTRL interfaces. By default, '0.0.0.0'
is used, so there are no restrictions for the L1 source address.

Change-Id: I3339f686b53db07cfd1bff9a516f4bdc28058cd9
2018-08-10 16:38:59 +07:00
Vadim Yanitskiy bf6f6ec0de trx/udp_link.py: close socket in destructor
Previously it was required to call the UDPLink.shutdown() method
manually in order to close a socket. Let's do it automatically
using the destructor of UDPLink.

Cherry-picked from: I59c3dc61ec58cd9effeb789947d28fd602ca91f4
Change-Id: Ief7aa21d1e50682a90616833b679741957193aae
2018-08-10 16:38:59 +07:00
Vadim Yanitskiy 8e1fa8bdd7 apps/grgsm_trx: use format string for help message
Instead of using the hard-coded default values in help message,
it makes sense to use a format string, and pass the actual
values when printing help.

Change-Id: Ib1bf0ef3ded86aa92faeb9b63eb286283f5c8c3d
2018-08-10 16:38:59 +07:00
Vadim Yanitskiy cae78211a6 grgsm_trx: change default TRX port number to 6700
In order to avoid clashes with OsmoTRX, which may be also
running on the same host, let's use a different port range
starting from 6700 by default.

This idea was introduced as a result of OS#2984.

Change-Id: Iaf0c78733bfefcb0b0938abf6d316e27d03ecab4
2018-08-10 15:11:23 +07:00
Vadim Yanitskiy 3674f48df5 apps/grgsm_trx: also print Piotr as a copyright holder
Despite the most part of Python code was written by Vadim, it's
heavily based on huge and impressive work done by Piotr. Let's
also print his credentials in the license header.

Change-Id: Icca7c679d84f99440ff502219f624e0f73112744
2018-08-10 15:11:23 +07:00
Vadim Yanitskiy 14b8e854c2 apps/grgsm_trx: use 4 * GSM_SYM_RATE as default sample rate
With this sample rate it's easier to synchronize
training sequence with the signal.
2017-12-04 00:22:39 +07:00
Vadim Yanitskiy 0e7c9a80ad apps/grgsm_trx: fix antenna selection options
Both '--rx-antenna' and '--tx-antenna' require an argument.
2017-11-29 23:11:14 +01:00
Vadim Yanitskiy 790b6f0cc1 apps/grgsm_trx: add cmd line arguments for TX chain 2017-11-05 17:33:26 +01:00
Vadim Yanitskiy 5d68aa5620 apps/grgsm_trx: get rid of unused subdev_spec
This could be specified via the device_args,
for example: "subdev=B:0".
2017-11-05 17:33:26 +01:00
Vadim Yanitskiy ba7ad29638 apps/grgsm_trx: import helper classes from grgsm.trx 2017-11-05 17:33:26 +01:00
Piotr Krysik 902f4ebaf0 Moved trx utilities from apps subdirectory - the grgsm_trx app need to be updated 2017-09-19 08:04:33 +02:00