From 7ff178a82a8a0123ed95b29cd61ca665f212801a Mon Sep 17 00:00:00 2001 From: Jason Reiss Date: Mon, 21 Jun 2021 12:08:23 -0500 Subject: lbt: adjust tx_max_time check based on 400ms packet limit for 128us scan time --- libloragw/src/loragw_lbt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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"); -- cgit v1.2.3