summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Reiss <jreiss@multitech.com>2021-06-17 14:29:00 -0500
committerJason Reiss <jreiss@multitech.com>2021-06-17 14:29:00 -0500
commit7032155d630bd05e49c622202b4ed6844b4a429f (patch)
tree8448456f9c96eb76c62648a6c67ed5ca142a1158
parentee305b42611200077f4b5714479deb6870af0af9 (diff)
downloadlora_gateway_mtac_full-7032155d630bd05e49c622202b4ed6844b4a429f.tar.gz
lora_gateway_mtac_full-7032155d630bd05e49c622202b4ed6844b4a429f.tar.bz2
lora_gateway_mtac_full-7032155d630bd05e49c622202b4ed6844b4a429f.zip
lbt: adjust packet duration check to allow 400ms, check was there to only allow tx within 4s of last ch free time, channels are checked more frequently than every 4s5.0.5
-rw-r--r--libloragw/src/loragw_lbt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libloragw/src/loragw_lbt.c b/libloragw/src/loragw_lbt.c
index 9c43521..a9a858f 100644
--- a/libloragw/src/loragw_lbt.c
+++ b/libloragw/src/loragw_lbt.c
@@ -345,7 +345,10 @@ int lbt_is_channel_free(struct lgw_pkt_tx_s * pkt_data, uint16_t tx_start_delay,
/* lbt_time: last time when channel was free */
/* tx_max_time: maximum time allowed to send packet since last free time */
/* 2048: some margin */
- if ((delta_time < (tx_max_time - 2048)) && (lbt_time != 0)) {
+ // 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)) {
*tx_allowed = true;
} else {
DEBUG_MSG("ERROR: TX request rejected (LBT)\n");