summaryrefslogtreecommitdiff
path: root/util_tx_continuous
diff options
context:
space:
mode:
Diffstat (limited to 'util_tx_continuous')
-rw-r--r--util_tx_continuous/src/util_tx_continuous.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/util_tx_continuous/src/util_tx_continuous.c b/util_tx_continuous/src/util_tx_continuous.c
index 54d77f7..b8b59e9 100644
--- a/util_tx_continuous/src/util_tx_continuous.c
+++ b/util_tx_continuous/src/util_tx_continuous.c
@@ -37,6 +37,7 @@ Maintainer: Matthieu Leurent
#include "loragw_hal.h"
#include "loragw_reg.h"
#include "loragw_aux.h"
+#include "loragw_spi.h"
/* -------------------------------------------------------------------------- */
/* --- MACROS & CONSTANTS --------------------------------------------------- */
@@ -97,6 +98,7 @@ int main(int argc, char **argv)
{"bt", 1, 0, 0},
{"notch", 1, 0, 0},
{"attn", 1, 0, 0},
+ {"path", 1, 0, 0},
{0, 0, 0, 0}
};
unsigned int arg_u;
@@ -117,7 +119,6 @@ int main(int argc, char **argv)
uint8_t fdev_khz = DEFAULT_FDEV_KHZ;
uint8_t bt = DEFAULT_BT;
uint32_t tx_notch_freq = DEFAULT_NOTCH_FREQ;
-
int32_t offset_i, offset_q;
/* RF configuration (TX fail if RF chain is not enabled) */
@@ -150,6 +151,7 @@ int main(int argc, char **argv)
printf(" --fdev <uint> FSK frequency deviation in kHz, [1:250]\n");
printf(" --bt <uint> FSK gaussian filter BT trim, [0:3]\n");
printf(" --attn <float> Attenuator value in dB, required LGA module or MTAC full card\n");
+ printf(" --path <string> Path of SPIDEV e.g. /dev/spidev0.0\n");
printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
return EXIT_SUCCESS;
break;
@@ -275,7 +277,16 @@ int main(int argc, char **argv)
else {
g_atten = arg_u;
}
- }
+ } else if (strcmp(long_options[option_index].name,"path") == 0) {
+ 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);
+ }
+ }
else {
printf("ERROR: argument parsing options. Use -h to print help\n");
return EXIT_FAILURE;