attempted lora fix: timeout increase
This commit is contained in:
@@ -247,14 +247,14 @@ static uint16_t read_u16_le(const uint8_t *src) {
|
|||||||
|
|
||||||
static uint32_t compute_batch_rx_timeout_ms(uint16_t total_len, uint8_t chunk_count) {
|
static uint32_t compute_batch_rx_timeout_ms(uint16_t total_len, uint8_t chunk_count) {
|
||||||
if (total_len == 0 || chunk_count == 0) {
|
if (total_len == 0 || chunk_count == 0) {
|
||||||
return 2000;
|
return 10000;
|
||||||
}
|
}
|
||||||
size_t max_chunk_payload = total_len > BATCH_CHUNK_PAYLOAD ? BATCH_CHUNK_PAYLOAD : total_len;
|
size_t max_chunk_payload = total_len > BATCH_CHUNK_PAYLOAD ? BATCH_CHUNK_PAYLOAD : total_len;
|
||||||
size_t payload_len = BATCH_HEADER_SIZE + max_chunk_payload;
|
size_t payload_len = BATCH_HEADER_SIZE + max_chunk_payload;
|
||||||
size_t packet_len = 5 + payload_len + 2;
|
size_t packet_len = 5 + payload_len + 2;
|
||||||
uint32_t airtime_ms = lora_airtime_ms(packet_len);
|
uint32_t per_chunk_toa_ms = lora_airtime_ms(packet_len);
|
||||||
uint32_t timeout_ms = airtime_ms + BATCH_RX_MARGIN_MS;
|
uint32_t timeout_ms = static_cast<uint32_t>(chunk_count) * per_chunk_toa_ms + BATCH_RX_MARGIN_MS;
|
||||||
return timeout_ms < 500 ? 500 : timeout_ms;
|
return timeout_ms < 10000 ? 10000 : timeout_ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool inject_batch_meta(String &json, int16_t rssi_dbm, float snr_db, uint32_t rx_ts_utc) {
|
static bool inject_batch_meta(String &json, int16_t rssi_dbm, float snr_db, uint32_t rx_ts_utc) {
|
||||||
|
|||||||
Reference in New Issue
Block a user