fetch next telegram part for different offset

This commit is contained in:
MichaelDvP
2024-07-19 18:40:24 +02:00
parent f7278ab3a9
commit 58c48584ac
2 changed files with 3 additions and 2 deletions

View File

@@ -642,7 +642,8 @@ uint16_t TxService::read_next_tx(const uint8_t offset, const uint8_t length) {
uint8_t message_data = (UINT8_MAX - next_offset) >= next_length ? next_length : UINT8_MAX - next_offset;
// check telegram, offset and overflow
// some telegrams only reply with one byte less, but have higher offsets (0x10)
if (old_length >= (next_length - 1) && telegram_last_->offset == offset) {
// some reply with higher offset than requestes and have not_set values intermediate (0xEA)
if (old_length >= (next_length - 1) || telegram_last_->offset < offset) {
add(Telegram::Operation::TX_READ, telegram_last_->dest, telegram_last_->type_id, next_offset, &message_data, 1, 0, true);
return telegram_last_->type_id;
}