mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
remove tx/rx limits for standalone
This commit is contained in:
@@ -228,10 +228,12 @@ void RxService::add(uint8_t * data, uint8_t length) {
|
||||
// create the telegram
|
||||
auto telegram = std::make_shared<Telegram>(operation, src, dest, type_id, offset, message_data, message_length);
|
||||
|
||||
// check if queue is full, if so remove top item to make space
|
||||
// check if queue is full, if so remove top item to make space, except if we're in standalone mode
|
||||
#ifndef EMSESP_STANDALONE
|
||||
if (rx_telegrams_.size() >= MAX_RX_TELEGRAMS) {
|
||||
rx_telegrams_.pop_front();
|
||||
}
|
||||
#endif
|
||||
|
||||
rx_telegrams_.emplace_back(rx_telegram_id_++, std::move(telegram)); // add to queue
|
||||
}
|
||||
@@ -442,6 +444,7 @@ void TxService::add(const uint8_t operation,
|
||||
|
||||
LOG_DEBUG("New Tx [#%d] telegram, length %d", tx_telegram_id_, message_length);
|
||||
|
||||
#ifndef EMSESP_STANDALONE
|
||||
// if the queue is full, make room by removing the last one
|
||||
if (tx_telegrams_.size() >= MAX_TX_TELEGRAMS) {
|
||||
LOG_WARNING("Tx queue overflow, skip one message");
|
||||
@@ -452,6 +455,7 @@ void TxService::add(const uint8_t operation,
|
||||
}
|
||||
tx_telegrams_.pop_front();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (front) {
|
||||
tx_telegrams_.emplace_front(tx_telegram_id_++, std::move(telegram), false, validateid); // add to front of queue
|
||||
|
||||
@@ -32,13 +32,8 @@
|
||||
|
||||
#include "helpers.h"
|
||||
|
||||
#if defined(EMSESP_STANDALONE)
|
||||
#define MAX_RX_TELEGRAMS 100 // size of Rx queue
|
||||
#define MAX_TX_TELEGRAMS 200 // size of Tx queue
|
||||
#else
|
||||
#define MAX_RX_TELEGRAMS 10 // size of Rx queue
|
||||
#define MAX_TX_TELEGRAMS 160 // size of Tx queue
|
||||
#endif
|
||||
|
||||
// default values for null values
|
||||
static constexpr uint8_t EMS_VALUE_BOOL = 0xFF; // used to mark that something is a boolean
|
||||
|
||||
Reference in New Issue
Block a user