From 7032155d630bd05e49c622202b4ed6844b4a429f Mon Sep 17 00:00:00 2001 From: Jason Reiss Date: Thu, 17 Jun 2021 14:29:00 -0500 Subject: 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 4s --- libloragw/src/loragw_lbt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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"); -- cgit v1.2.3