prevent multiple reading of long messages with no offset

This commit is contained in:
MichaelDvP
2021-05-10 13:40:11 +02:00
parent 37bee39cea
commit 312fd85469
3 changed files with 8 additions and 3 deletions

View File

@@ -1061,6 +1061,8 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) {
// get_uptime is only updated once per loop, does not give the right time
LOG_TRACE(F("[UART_DEBUG] Echo after %d ms: %s"), ::millis() - rx_time_, Helpers::data_to_hex(data, length).c_str());
#endif
// add to RxQueue for log/watch
rxservice_.add(data, length);
return; // it's an echo
}
@@ -1096,7 +1098,7 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) {
tx_successful = true;
// if telegram is longer read next part with offset + 25 for ems+
if (length == 32) {
if (txservice_.read_next_tx() == read_id_) {
if (txservice_.read_next_tx(data[3]) == read_id_) {
read_next_ = true;
}
}