summaryrefslogtreecommitdiff
path: root/util_tx_continuous
diff options
context:
space:
mode:
authorHarsh Sharma <harsh.sharma@multitech.com>2019-10-31 11:17:13 -0500
committerHarsh Sharma <harsh.sharma@multitech.com>2019-10-31 11:17:13 -0500
commit408ecd322635e37c710006c95a22dddc455e7f08 (patch)
tree61ed109f272710d2a50abb008a2bfd3bee697940 /util_tx_continuous
parent963a35fe0d6668e5b66d6bd1ff9659be8bf7d7bd (diff)
downloadlora_gateway_mtac_full-408ecd322635e37c710006c95a22dddc455e7f08.tar.gz
lora_gateway_mtac_full-408ecd322635e37c710006c95a22dddc455e7f08.tar.bz2
lora_gateway_mtac_full-408ecd322635e37c710006c95a22dddc455e7f08.zip
Fixed lora attenuator mode5.0.1-mts-2
Diffstat (limited to 'util_tx_continuous')
-rw-r--r--util_tx_continuous/src/util_tx_continuous.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/util_tx_continuous/src/util_tx_continuous.c b/util_tx_continuous/src/util_tx_continuous.c
index 7768c22..275c3eb 100644
--- a/util_tx_continuous/src/util_tx_continuous.c
+++ b/util_tx_continuous/src/util_tx_continuous.c
@@ -149,7 +149,7 @@ int main(int argc, char **argv)
printf(" --br <float> FSK bitrate in kbps, [0.5:250]\n");
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, Full Card Only [0.0:31.75]\n");
+ printf(" --attn <float> Attenuator value in dB, required LGA module or MTAC full card\n");
printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
return EXIT_SUCCESS;
break;
@@ -268,8 +268,8 @@ int main(int argc, char **argv)
}
else if (strcmp(long_options[option_index].name,"attn") == 0) {
i = sscanf(optarg, "%f", &arg_f);
- if ((i != 1) || (arg_f < 0.0) || (arg_f > 31.75)) {
- printf("ERROR: argument parsing of --br argument. Use -h to print help\n");
+ if ((i != 1) || (arg_f < 0.0) ) {
+ printf("ERROR: argument parsing of --attn argument. Use -h to print help\n");
return EXIT_FAILURE;
}
else {
@@ -362,9 +362,10 @@ int main(int argc, char **argv)
txpkt.freq_hz = freq_hz;
txpkt.tx_mode = IMMEDIATE;
txpkt.rf_chain = TX_RF_CHAIN;
- txpkt.rf_power = 0;
- if (read_fpga_version() == 32) {
- i = lgw_set_attenuation(g_atten);
+ if (fpga_supports_attenuator()) {
+ txpkt.rf_power = 32.0 - g_atten;
+ } else {
+ txpkt.rf_power = 0.0;
}
if (strcmp(mod, "FSK") == 0) {