diff --git a/.github/workflows/tagged_release.yml b/.github/workflows/tagged_release.yml index 8e169e249..9818be2af 100644 --- a/.github/workflows/tagged_release.yml +++ b/.github/workflows/tagged_release.yml @@ -31,6 +31,7 @@ jobs: cd interface npm ci npx typesafe-i18n --no-watch + sed -i "s/= 'pl'/= 'en'/" ./src/i18n/i18n-util.ts npm run build - name: Build firmware diff --git a/src/emsdevice.cpp b/src/emsdevice.cpp index 17c99a0ca..d5cdd9990 100644 --- a/src/emsdevice.cpp +++ b/src/emsdevice.cpp @@ -350,14 +350,8 @@ void EMSdevice::show_telegram_handlers(uuid::console::Shell & shell) const { // list all the telegram type IDs for this device, outputting to a string (max size 200) char * EMSdevice::show_telegram_handlers(char * result, const size_t len, const uint8_t handlers) { - uint8_t size = telegram_functions_.size(); - strlcpy(result, "", len); - if (!size) { - return result; - } - uint8_t i = 0; for (const auto & tf : telegram_functions_) { if (handlers == Handlers::ALL || (handlers == Handlers::RECEIVED && tf.received_ && !tf.fetch_) diff --git a/src/emsesp.cpp b/src/emsesp.cpp index 16cc4e0e9..5ee409283 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -1255,7 +1255,7 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) { } #endif // check for poll to us, if so send top message from Tx queue immediately and quit - if (poll_id == txservice_.ems_bus_id()) { + if (poll_id == txservice_.get_send_id()) { txservice_.send(); } // send remote room temperature if active diff --git a/src/telegram.cpp b/src/telegram.cpp index 45e86a4f9..c7d2869c9 100644 --- a/src/telegram.cpp +++ b/src/telegram.cpp @@ -268,6 +268,21 @@ void TxService::send_poll() const { } } +// get src id from next telegram to check poll in emsesp::incoming_telegram +uint8_t TxService::get_send_id() { + static uint32_t count = 0; + if (!tx_telegrams_.empty() && tx_telegrams_.front().telegram_->src != ems_bus_id()) { + if (++count > 500) { // after 500 polls (~3-10 sec) there will be no master poll for this id + tx_telegrams_.pop_front(); + count = 0; + return tx_telegrams_.empty() ? ems_bus_id() : tx_telegrams_.front().telegram_->src; + } + return tx_telegrams_.front().telegram_->src; + } + count = 0; + return ems_bus_id(); +} + // Process the next telegram on the Tx queue // This is sent when we receive a poll request void TxService::send() { @@ -463,7 +478,7 @@ void TxService::add(uint8_t operation, const uint8_t * data, const uint8_t lengt } // build header. src, dest and offset have fixed positions - uint8_t src = ems_bus_id(); // data[0]; we can only send data with own bus_id. + uint8_t src = operation == Telegram::Operation::TX_RAW ? data[0] : ems_bus_id(); uint8_t dest = data[1]; uint8_t offset = data[3]; @@ -499,7 +514,9 @@ void TxService::add(uint8_t operation, const uint8_t * data, const uint8_t lengt } if (operation == Telegram::Operation::TX_RAW) { - if (dest & 0x80) { + if (src != ems_bus_id()) { + operation = Telegram::Operation::NONE; // do not check reply/ack for other ids + } else if (dest & 0x80) { operation = Telegram::Operation::TX_READ; } else { operation = Telegram::Operation::TX_WRITE; @@ -585,8 +602,8 @@ bool TxService::send_raw(const char * telegram_data) { } } - // check valid length and src - if ((count < 4) || ((data[0] & 0x7F) != ems_bus_id())) { + // check valid length + if (count < 4) { return false; } diff --git a/src/telegram.h b/src/telegram.h index 710558f57..452edcb8b 100644 --- a/src/telegram.h +++ b/src/telegram.h @@ -290,6 +290,7 @@ class TxService : public EMSbus { void start(); void send(); + uint8_t get_send_id(); void add(const uint8_t operation, const uint8_t dest, const uint16_t type_id,