summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Reiss <jreiss@multitech.com>2021-06-21 12:08:23 -0500
committerJason Reiss <jreiss@multitech.com>2021-06-21 16:16:59 -0500
commit7ff178a82a8a0123ed95b29cd61ca665f212801a (patch)
tree7313bed3ae212931c7248dc62b400c7cbbc52d7b
parent7032155d630bd05e49c622202b4ed6844b4a429f (diff)
downloadlora_gateway_mtac_full-7ff178a82a8a0123ed95b29cd61ca665f212801a.tar.gz
lora_gateway_mtac_full-7ff178a82a8a0123ed95b29cd61ca665f212801a.tar.bz2
lora_gateway_mtac_full-7ff178a82a8a0123ed95b29cd61ca665f212801a.zip
lbt: adjust tx_max_time check based on 400ms packet limit for 128us scan time5.0.6
-rw-r--r--libloragw/src/loragw_lbt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libloragw/src/loragw_lbt.c b/libloragw/src/loragw_lbt.c
index a9a858f..aa694fa 100644
--- a/libloragw/src/loragw_lbt.c
+++ b/libloragw/src/loragw_lbt.c
@@ -348,7 +348,9 @@ int lbt_is_channel_free(struct lgw_pkt_tx_s * pkt_data, uint16_t tx_start_delay,
// if ((delta_time <= (tx_max_time - 2048)) && (lbt_time != 0)) {
// delta time check did not allow 400 ms packets, change to simple check against packet duration
// Japan STD regulations allow 400ms packet duration from start of tx
- if ((packet_duration <= (tx_max_time)) && (lbt_time != 0)) {
+ if (tx_max_time <= 400000 && (packet_duration <= (tx_max_time)) && (lbt_time != 0)) {
+ *tx_allowed = true;
+ } else if (tx_max_time > 400000 && (delta_time <= (tx_max_time - 2048)) && (lbt_time != 0)) {
*tx_allowed = true;
} else {
DEBUG_MSG("ERROR: TX request rejected (LBT)\n");