diff options
author | Jason Reiss <jreiss@multitech.com> | 2020-03-20 09:11:25 -0500 |
---|---|---|
committer | Jason Reiss <jreiss@multitech.com> | 2020-03-20 09:11:25 -0500 |
commit | ea028e8048d55367a52365087f9e3928746c55a5 (patch) | |
tree | d3c28fb745071653bcf35bff7f05c93051796390 /util_tx_test/src/util_tx_test.c | |
parent | b3a4461b3dfc5588111a88fd735d058888b8d3d4 (diff) | |
parent | dea57d6f29246434173c33c56850708c51fc5b23 (diff) | |
download | lora_gateway_mtac_full-ea028e8048d55367a52365087f9e3928746c55a5.tar.gz lora_gateway_mtac_full-ea028e8048d55367a52365087f9e3928746c55a5.tar.bz2 lora_gateway_mtac_full-ea028e8048d55367a52365087f9e3928746c55a5.zip |
Merge branch 'master' of gitlab.multitech.net:lora_enterprise/lora_gateway_mtac_full5.0.1-mts-5
Diffstat (limited to 'util_tx_test/src/util_tx_test.c')
-rw-r--r-- | util_tx_test/src/util_tx_test.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/util_tx_test/src/util_tx_test.c b/util_tx_test/src/util_tx_test.c index 74c163f..0ac8244 100644 --- a/util_tx_test/src/util_tx_test.c +++ b/util_tx_test/src/util_tx_test.c @@ -37,6 +37,7 @@ Maintainer: Sylvain Miermont #include "loragw_hal.h" #include "loragw_reg.h" #include "loragw_aux.h" +#include "loragw_spi.h" /* -------------------------------------------------------------------------- */ /* --- PRIVATE MACROS ------------------------------------------------------- */ @@ -147,11 +148,12 @@ void usage(void) { printf(" -i send packet using inverted modulation polarity\n"); printf(" -t <uint> pause between packets (ms)\n"); printf(" -x <int> nb of times the sequence is repeated (-1 loop until stopped)\n"); - printf(" --lbt-freq <float> lbt first channel frequency in MHz\n"); - printf(" --lbt-nbch <uint> lbt number of channels [1..8]\n"); - printf(" --lbt-sctm <uint> lbt scan time in usec to be applied to all channels [128, 5000]\n"); - printf(" --lbt-rssi <int> lbt rssi target in dBm [-128..0]\n"); - printf(" --lbt-rssi-offset <int> rssi offset in dB to be applied to SX127x RSSI [-128..127]\n"); + printf(" --lbt-freq <float> lbt first channel frequency in MHz\n"); + printf(" --lbt-nbch <uint> lbt number of channels [1..8]\n"); + printf(" --lbt-sctm <uint> lbt scan time in usec to be applied to all channels [128, 5000]\n"); + printf(" --lbt-rssi <int> lbt rssi target in dBm [-128..0]\n"); + printf(" --lbt-rssi-offset <int> rssi offset in dB to be applied to SX127x RSSI [-128..127]\n"); + printf(" --path <string> path of SPIDEV e.g. /dev/spidev0.0\n"); } /* -------------------------------------------------------------------------- */ @@ -213,6 +215,7 @@ int main(int argc, char **argv) {"lbt-rssi", required_argument, 0, 0}, {"lbt-nbch", required_argument, 0, 0}, {"lbt-rssi-offset", required_argument, 0, 0}, + {"path", required_argument, 0, 0}, {0, 0, 0, 0} }; @@ -469,6 +472,15 @@ int main(int argc, char **argv) usage(); return EXIT_FAILURE; } + } else if (strcmp(long_options[option_index].name,"path") == 0) { /* <string> Path to spi device */ + i = sscanf(optarg, "%s", arg_s); + if ((i != 1) || (strncmp(arg_s, "/dev/", 5 ) != 0)) { + printf("ERROR: argument parsing of --path argument. Use -h to print help\n"); + return EXIT_FAILURE; + } + else { + lgw_spi_set_path(arg_s); + } } break; default: |