mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
fix offset of dummy reply
This commit is contained in:
@@ -233,8 +233,8 @@ void RxService::add(uint8_t * data, uint8_t length) {
|
||||
}
|
||||
|
||||
// add empty telegram to rx-queue
|
||||
void RxService::add_empty(const uint8_t src, const uint8_t dest, const uint16_t type_id) {
|
||||
auto telegram = std::make_shared<Telegram>(Telegram::Operation::RX, src, dest, type_id, 0, nullptr, 0);
|
||||
void RxService::add_empty(const uint8_t src, const uint8_t dest, const uint16_t type_id, uint8_t offset) {
|
||||
auto telegram = std::make_shared<Telegram>(Telegram::Operation::RX, src, dest, type_id, offset, nullptr, 0);
|
||||
// only if queue is not full
|
||||
if (rx_telegrams_.size() < MAX_RX_TELEGRAMS) {
|
||||
rx_telegrams_.emplace_back(rx_telegram_id_++, std::move(telegram)); // add to queue
|
||||
@@ -598,7 +598,7 @@ void TxService::retry_tx(const uint8_t operation, const uint8_t * data, const ui
|
||||
MAXIMUM_TX_RETRIES,
|
||||
telegram_last_->to_string().c_str());
|
||||
if (operation == Telegram::Operation::TX_READ) {
|
||||
EMSESP::rxservice_.add_empty(telegram_last_->dest, telegram_last_->src, telegram_last_->type_id);
|
||||
EMSESP::rxservice_.add_empty(telegram_last_->dest, telegram_last_->src, telegram_last_->type_id, telegram_last_->offset);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ class RxService : public EMSbus {
|
||||
|
||||
void loop();
|
||||
void add(uint8_t * data, uint8_t length);
|
||||
void add_empty(const uint8_t src, const uint8_t dst, const uint16_t type_id);
|
||||
void add_empty(const uint8_t src, const uint8_t dst, const uint16_t type_id, uint8_t offset);
|
||||
|
||||
uint32_t telegram_count() const {
|
||||
return telegram_count_;
|
||||
|
||||
Reference in New Issue
Block a user