summaryrefslogtreecommitdiff
path: root/util_spectral_scan/src/util_spectral_scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'util_spectral_scan/src/util_spectral_scan.c')
-rw-r--r--util_spectral_scan/src/util_spectral_scan.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/util_spectral_scan/src/util_spectral_scan.c b/util_spectral_scan/src/util_spectral_scan.c
index cbc8377..91a358f 100644
--- a/util_spectral_scan/src/util_spectral_scan.c
+++ b/util_spectral_scan/src/util_spectral_scan.c
@@ -37,6 +37,7 @@ Maintainer: Michael Coracin
#include "loragw_hal.h"
#include "loragw_radio.h"
#include "loragw_fpga.h"
+#include "loragw_spi.h"
/* -------------------------------------------------------------------------- */
/* --- MACROS & CONSTANTS --------------------------------------------------- */
@@ -116,7 +117,7 @@ int main( int argc, char ** argv )
float rssi_thresh[] = {0.1,0.3,0.5,0.8,1};
/* Parse command line options */
- while((i = getopt(argc, argv, "hf:n:b:l:o:")) != -1) {
+ while((i = getopt(argc, argv, "hf:n:b:l:o:p:")) != -1) {
switch (i) {
case 'h':
printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
@@ -126,6 +127,7 @@ int main( int argc, char ** argv )
printf(" -n <uint> Total number of RSSI points [1..65535]\n");
printf(" -o <int> Offset in dB to be applied to the SX127x RSSI [-128..127]\n");
printf(" -l <char> Log file name\n");
+ printf(" -p <char> path of SPIDEV e.g. /dev/spidev0.0\n");
printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
return EXIT_SUCCESS;
@@ -206,6 +208,16 @@ int main( int argc, char ** argv )
}
break;
+ case 'p': /* -p <char> Path for spi device */
+ j = sscanf(optarg, "%s", arg_s);
+ if (j != 1) {
+ printf("ERROR: argument parsing of -p argument. -h for help.\n");
+ return EXIT_FAILURE;
+ } else {
+ lgw_spi_set_path(arg_s);
+ }
+ break;
+
default:
printf("ERROR: argument parsing options. -h for help.\n");
return EXIT_FAILURE;