v1.0.4
* Added missing LICENSE.TXT file * HAL & Packet Forwarder: added support for sx1250-based reference design for CN490 region * Packet Forwarder: disabled beaconing by default
This commit is contained in:
parent
5942224602
commit
81e748c904
23 changed files with 306 additions and 48 deletions
|
|
@ -103,6 +103,7 @@ void usage(void) {
|
|||
printf(" -k <uint> Concentrator clock source (Radio A or Radio B) [0..1]\n");
|
||||
printf(" -c <uint> RF chain to be used for TX (Radio A or Radio B) [0..1]\n");
|
||||
printf(" -r <uint> Radio type (1255, 1257, 1250)\n");
|
||||
printf(" -j Set radio in single input mode (SX1250 only)\n");
|
||||
printf(" -f <float> Radio TX frequency in MHz\n");
|
||||
printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" );
|
||||
printf(" --pa <uint> PA gain [0..3]\n");
|
||||
|
|
@ -465,6 +466,7 @@ int main(int argc, char **argv)
|
|||
uint8_t clocksource = 0;
|
||||
uint8_t rf_chain = 0;
|
||||
lgw_radio_type_t radio_type = LGW_RADIO_TYPE_NONE;
|
||||
bool single_input_mode = false;
|
||||
|
||||
struct lgw_conf_board_s boardconf;
|
||||
struct lgw_conf_rxrf_s rfconf;
|
||||
|
|
@ -490,7 +492,7 @@ int main(int argc, char **argv)
|
|||
};
|
||||
|
||||
/* parse command line options */
|
||||
while ((i = getopt_long (argc, argv, "hf:k:r:c:d:", long_options, &option_index)) != -1) {
|
||||
while ((i = getopt_long (argc, argv, "hjf:k:r:c:d:", long_options, &option_index)) != -1) {
|
||||
switch (i) {
|
||||
case 'h':
|
||||
usage();
|
||||
|
|
@ -543,6 +545,10 @@ int main(int argc, char **argv)
|
|||
}
|
||||
break;
|
||||
|
||||
case 'j':
|
||||
single_input_mode = true;
|
||||
break;
|
||||
|
||||
case 'f': /* <float> Radio TX frequency in MHz */
|
||||
i = sscanf(optarg, "%lf", &arg_d);
|
||||
if (i != 1) {
|
||||
|
|
@ -616,6 +622,7 @@ int main(int argc, char **argv)
|
|||
rfconf.freq_hz = ft;
|
||||
rfconf.type = radio_type;
|
||||
rfconf.tx_enable = true;
|
||||
rfconf.single_input_mode = single_input_mode;
|
||||
if (lgw_rxrf_setconf(0, &rfconf) != LGW_HAL_SUCCESS) {
|
||||
printf("ERROR: failed to configure rxrf 0\n");
|
||||
return EXIT_FAILURE;
|
||||
|
|
@ -626,6 +633,7 @@ int main(int argc, char **argv)
|
|||
rfconf.freq_hz = ft;
|
||||
rfconf.type = radio_type;
|
||||
rfconf.tx_enable = true;
|
||||
rfconf.single_input_mode = single_input_mode;
|
||||
if (lgw_rxrf_setconf(1, &rfconf) != LGW_HAL_SUCCESS) {
|
||||
printf("ERROR: failed to configure rxrf 1\n");
|
||||
return EXIT_FAILURE;
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ int main(int argc, char **argv)
|
|||
sx1302_radio_reset(i, rf_radio_type[i]);
|
||||
switch (radio_type) {
|
||||
case LGW_RADIO_TYPE_SX1250:
|
||||
sx1250_setup(i, rf_rx_freq[i]);
|
||||
sx1250_setup(i, rf_rx_freq[i], false);
|
||||
break;
|
||||
case LGW_RADIO_TYPE_SX1255:
|
||||
case LGW_RADIO_TYPE_SX1257:
|
||||
|
|
|
|||
|
|
@ -192,6 +192,7 @@ int main(int argc, char **argv)
|
|||
rfconf.freq_hz = fa;
|
||||
rfconf.type = radio_type;
|
||||
rfconf.tx_enable = false;
|
||||
rfconf.single_input_mode = false;
|
||||
if (lgw_rxrf_setconf(0, &rfconf) != LGW_HAL_SUCCESS) {
|
||||
printf("ERROR: failed to configure rxrf 0\n");
|
||||
return EXIT_FAILURE;
|
||||
|
|
@ -202,6 +203,7 @@ int main(int argc, char **argv)
|
|||
rfconf.freq_hz = fb;
|
||||
rfconf.type = radio_type;
|
||||
rfconf.tx_enable = false;
|
||||
rfconf.single_input_mode = false;
|
||||
if (lgw_rxrf_setconf(1, &rfconf) != LGW_HAL_SUCCESS) {
|
||||
printf("ERROR: failed to configure rxrf 1\n");
|
||||
return EXIT_FAILURE;
|
||||
|
|
@ -235,6 +237,7 @@ int main(int argc, char **argv)
|
|||
lgw_get_trigcnt(&counter);
|
||||
}
|
||||
wait_ms(10);
|
||||
printf("%u\n", counter);
|
||||
}
|
||||
|
||||
/* Stop the gateway */
|
||||
|
|
|
|||
|
|
@ -286,6 +286,7 @@ int main(int argc, char **argv)
|
|||
rfconf.rssi_offset = 0.0;
|
||||
rfconf.type = radio_type;
|
||||
rfconf.tx_enable = false;
|
||||
rfconf.single_input_mode = false;
|
||||
if (lgw_rxrf_setconf(0, &rfconf) != LGW_HAL_SUCCESS) {
|
||||
printf("ERROR: failed to configure rxrf 0\n");
|
||||
return EXIT_FAILURE;
|
||||
|
|
@ -297,6 +298,7 @@ int main(int argc, char **argv)
|
|||
rfconf.rssi_offset = 0.0;
|
||||
rfconf.type = radio_type;
|
||||
rfconf.tx_enable = false;
|
||||
rfconf.single_input_mode = false;
|
||||
if (lgw_rxrf_setconf(1, &rfconf) != LGW_HAL_SUCCESS) {
|
||||
printf("ERROR: failed to configure rxrf 1\n");
|
||||
return EXIT_FAILURE;
|
||||
|
|
|
|||
|
|
@ -67,15 +67,16 @@ static void sig_handler(int sigio) {
|
|||
|
||||
void usage(void) {
|
||||
//printf("Library version information: %s\n", lgw_version_info());
|
||||
printf( "Available options:\n");
|
||||
printf( " -h print this help\n");
|
||||
printf( " -k <uint> Concentrator clock source (Radio A or Radio B) [0..1]\n");
|
||||
printf( " -r <uint> Radio type (1255, 1257, 1250)\n");
|
||||
printf( " -a <float> Radio A RX frequency in MHz\n");
|
||||
printf( " -b <float> Radio B RX frequency in MHz\n");
|
||||
printf( " -n <uint> Number of packet received with CRC OK for each HAL start/stop loop\n");
|
||||
printf( " -z <uint> Size of the RX packet array to be passed to lgw_receive()\n");
|
||||
printf( " -m <uint> Channel frequency plan mode [0:LoRaWAN-like, 1:Same frequency for all channels (-400000Hz on RF0)]\n");
|
||||
printf("Available options:\n");
|
||||
printf(" -h print this help\n");
|
||||
printf(" -k <uint> Concentrator clock source (Radio A or Radio B) [0..1]\n");
|
||||
printf(" -r <uint> Radio type (1255, 1257, 1250)\n");
|
||||
printf(" -a <float> Radio A RX frequency in MHz\n");
|
||||
printf(" -b <float> Radio B RX frequency in MHz\n");
|
||||
printf(" -n <uint> Number of packet received with CRC OK for each HAL start/stop loop\n");
|
||||
printf(" -z <uint> Size of the RX packet array to be passed to lgw_receive()\n");
|
||||
printf(" -m <uint> Channel frequency plan mode [0:LoRaWAN-like, 1:Same frequency for all channels (-400000Hz on RF0)]\n");
|
||||
printf(" -j Set radio in single input mode (SX1250 only)\n");
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
|
@ -97,6 +98,7 @@ int main(int argc, char **argv)
|
|||
uint8_t clocksource = 0;
|
||||
lgw_radio_type_t radio_type = LGW_RADIO_TYPE_NONE;
|
||||
uint8_t max_rx_pkt = 16;
|
||||
bool single_input_mode = false;
|
||||
|
||||
struct lgw_conf_board_s boardconf;
|
||||
struct lgw_conf_rxrf_s rfconf;
|
||||
|
|
@ -136,7 +138,7 @@ int main(int argc, char **argv)
|
|||
const uint8_t channel_rfchain_mode1[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
/* parse command line options */
|
||||
while ((i = getopt (argc, argv, "ha:b:k:r:n:z:m:")) != -1) {
|
||||
while ((i = getopt (argc, argv, "hja:b:k:r:n:z:m:")) != -1) {
|
||||
switch (i) {
|
||||
case 'h':
|
||||
usage();
|
||||
|
|
@ -170,6 +172,9 @@ int main(int argc, char **argv)
|
|||
clocksource = (uint8_t)arg_u;
|
||||
}
|
||||
break;
|
||||
case 'j': /* Set radio in single input mode */
|
||||
single_input_mode = true;
|
||||
break;
|
||||
case 'a': /* <float> Radio A RX frequency in MHz */
|
||||
i = sscanf(optarg, "%lf", &arg_d);
|
||||
if (i != 1) {
|
||||
|
|
@ -250,6 +255,7 @@ int main(int argc, char **argv)
|
|||
rfconf.freq_hz = fa;
|
||||
rfconf.type = radio_type;
|
||||
rfconf.tx_enable = false;
|
||||
rfconf.single_input_mode = single_input_mode;
|
||||
if (lgw_rxrf_setconf(0, &rfconf) != LGW_HAL_SUCCESS) {
|
||||
printf("ERROR: failed to configure rxrf 0\n");
|
||||
return EXIT_FAILURE;
|
||||
|
|
@ -260,6 +266,7 @@ int main(int argc, char **argv)
|
|||
rfconf.freq_hz = fb;
|
||||
rfconf.type = radio_type;
|
||||
rfconf.tx_enable = false;
|
||||
rfconf.single_input_mode = single_input_mode;
|
||||
if (lgw_rxrf_setconf(1, &rfconf) != LGW_HAL_SUCCESS) {
|
||||
printf("ERROR: failed to configure rxrf 1\n");
|
||||
return EXIT_FAILURE;
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ void usage(void) {
|
|||
printf(" -t <uint> TX mode timestamped with delay in ms. If delay is 0, TX mode GPS trigger\n");
|
||||
printf(" -p <int> RF power in dBm\n");
|
||||
printf(" -i Send LoRa packet using inverted modulation polarity\n");
|
||||
printf(" -j Set radio in single input mode (SX1250 only)\n");
|
||||
printf( "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" );
|
||||
printf(" --pa <uint> PA gain SX125x:[0..3], SX1250:[0,1]\n");
|
||||
printf(" --dig <uint> sx1302 digital gain for sx125x [0..3]\n");
|
||||
|
|
@ -131,6 +132,7 @@ int main(int argc, char **argv)
|
|||
uint16_t preamble = 8;
|
||||
bool invert_pol = false;
|
||||
bool no_header = false;
|
||||
bool single_input_mode = false;
|
||||
|
||||
struct lgw_conf_board_s boardconf;
|
||||
struct lgw_conf_rxrf_s rfconf;
|
||||
|
|
@ -165,7 +167,7 @@ int main(int argc, char **argv)
|
|||
};
|
||||
|
||||
/* parse command line options */
|
||||
while ((i = getopt_long (argc, argv, "hif:s:b:n:z:p:k:r:c:l:t:m:o:q:d:", long_options, &option_index)) != -1) {
|
||||
while ((i = getopt_long (argc, argv, "hjif:s:b:n:z:p:k:r:c:l:t:m:o:q:d:", long_options, &option_index)) != -1) {
|
||||
switch (i) {
|
||||
case 'h':
|
||||
usage();
|
||||
|
|
@ -174,6 +176,9 @@ int main(int argc, char **argv)
|
|||
case 'i': /* Send packet using inverted modulation polarity */
|
||||
invert_pol = true;
|
||||
break;
|
||||
case 'j': /* Set radio in single input mode */
|
||||
single_input_mode = true;
|
||||
break;
|
||||
case 'r': /* <uint> Radio type */
|
||||
i = sscanf(optarg, "%u", &arg_u);
|
||||
if ((i != 1) || ((arg_u != 1255) && (arg_u != 1257) && (arg_u != 1250))) {
|
||||
|
|
@ -424,9 +429,10 @@ int main(int argc, char **argv)
|
|||
|
||||
memset( &rfconf, 0, sizeof rfconf);
|
||||
rfconf.enable = true; /* rf chain 0 needs to be enabled for calibration to work on sx1257 */
|
||||
rfconf.freq_hz = 868500000; /* dummy */
|
||||
rfconf.freq_hz = ft;
|
||||
rfconf.type = radio_type;
|
||||
rfconf.tx_enable = true;
|
||||
rfconf.single_input_mode = single_input_mode;
|
||||
if (lgw_rxrf_setconf(0, &rfconf) != LGW_HAL_SUCCESS) {
|
||||
printf("ERROR: failed to configure rxrf 0\n");
|
||||
return EXIT_FAILURE;
|
||||
|
|
@ -434,9 +440,10 @@ int main(int argc, char **argv)
|
|||
|
||||
memset( &rfconf, 0, sizeof rfconf);
|
||||
rfconf.enable = (((rf_chain == 1) || (clocksource == 1)) ? true : false);
|
||||
rfconf.freq_hz = 868500000; /* dummy */
|
||||
rfconf.freq_hz = ft;
|
||||
rfconf.type = radio_type;
|
||||
rfconf.tx_enable = false;
|
||||
rfconf.single_input_mode = single_input_mode;
|
||||
if (lgw_rxrf_setconf(1, &rfconf) != LGW_HAL_SUCCESS) {
|
||||
printf("ERROR: failed to configure rxrf 1\n");
|
||||
return EXIT_FAILURE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue