mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 16:59:50 +03:00
added poll ack after we get a poll request in Tx
This commit is contained in:
@@ -388,10 +388,9 @@ void TxService::send() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if there's nothing in the queue to send
|
// if there's nothing in the queue to transmit, send back a poll and quit
|
||||||
// optionally, send back a poll and quit
|
|
||||||
if (tx_telegrams_.empty()) {
|
if (tx_telegrams_.empty()) {
|
||||||
// send_poll(); // TODO commented out poll for now. should add back when stable.
|
send_poll();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -409,7 +408,7 @@ void TxService::send_telegram(const QueuedTxTelegram & tx_telegram) {
|
|||||||
// build the header
|
// build the header
|
||||||
auto telegram = tx_telegram.telegram_;
|
auto telegram = tx_telegram.telegram_;
|
||||||
|
|
||||||
// src - set MSB if its Junkers/HT3
|
// src - set MSB if it's Junkers/HT3
|
||||||
uint8_t src = telegram->src;
|
uint8_t src = telegram->src;
|
||||||
if (ems_mask() != EMS_MASK_UNSET) {
|
if (ems_mask() != EMS_MASK_UNSET) {
|
||||||
src ^= ems_mask();
|
src ^= ems_mask();
|
||||||
@@ -484,7 +483,10 @@ void TxService::send_telegram(const QueuedTxTelegram & tx_telegram) {
|
|||||||
|
|
||||||
// send the telegram to the UART Tx
|
// send the telegram to the UART Tx
|
||||||
EMSUART_STATUS status = EMSuart::transmit(telegram_raw, length);
|
EMSUART_STATUS status = EMSuart::transmit(telegram_raw, length);
|
||||||
//LOG_TRACE(F("Tx: %s"), Helpers::data_to_hex(telegram_raw, length).c_str());
|
#ifdef EMSESP_DEBUG
|
||||||
|
LOG_TRACE(F("Tx: %s"), Helpers::data_to_hex(telegram_raw, length).c_str());
|
||||||
|
#endif
|
||||||
|
|
||||||
if (status != EMS_TX_STATUS_OK) {
|
if (status != EMS_TX_STATUS_OK) {
|
||||||
LOG_ERROR(F("Failed to transmit Tx via UART. Error: %s"), status == EMS_TX_WTD_TIMEOUT ? F("Timeout") : F("BRK"));
|
LOG_ERROR(F("Failed to transmit Tx via UART. Error: %s"), status == EMS_TX_WTD_TIMEOUT ? F("Timeout") : F("BRK"));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user