diff options
author | Harsh Sharma <harsh.sharma@multitech.com> | 2020-01-24 13:22:57 -0600 |
---|---|---|
committer | Harsh Sharma <harsh.sharma@multitech.com> | 2020-01-24 13:22:57 -0600 |
commit | 116d2f6402a83c824b0226c42fb08a22c75038b2 (patch) | |
tree | f7681c8d83e6c8f1737db4422837b4f3eda832dc /util_tx_test | |
parent | a0a94c3336574482d16fa910e94d7f07bba60123 (diff) | |
download | lora_gateway_mtac_full-116d2f6402a83c824b0226c42fb08a22c75038b2.tar.gz lora_gateway_mtac_full-116d2f6402a83c824b0226c42fb08a22c75038b2.tar.bz2 lora_gateway_mtac_full-116d2f6402a83c824b0226c42fb08a22c75038b2.zip |
Bug fix for util tx continuous's attn setting and added spi path option for util tx test
Diffstat (limited to 'util_tx_test')
-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: |