Skip to content

Commit

Permalink
fix offset of dummy reply
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Aug 11, 2022
1 parent df555ac commit c78a42e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/telegram.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/telegram.h
Expand Up @@ -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_;
Expand Down

0 comments on commit c78a42e

Please sign in to comment.