formatting brackets

This commit is contained in:
Proddy
2022-09-28 21:46:12 +02:00
parent fe0a855618
commit 9b619216cb
16 changed files with 176 additions and 176 deletions

View File

@@ -150,9 +150,9 @@ void RxService::add(uint8_t * data, uint8_t length) {
if (data[length - 1] != crc) {
if ((data[0] & 0x7F) != ems_bus_id()) { // do not count echos as errors
telegram_error_count_++;
LOG_WARNING(("Incomplete Rx: %s"), Helpers::data_to_hex(data, length - 1).c_str()); // exclude CRC
LOG_WARNING("Incomplete Rx: %s", Helpers::data_to_hex(data, length - 1).c_str()); // exclude CRC
} else {
LOG_TRACE(("Incomplete Rx: %s"), Helpers::data_to_hex(data, length - 1).c_str()); // exclude CRC
LOG_TRACE("Incomplete Rx: %s", Helpers::data_to_hex(data, length - 1).c_str()); // exclude CRC
}
return;
}
@@ -203,16 +203,16 @@ void RxService::add(uint8_t * data, uint8_t length) {
uint16_t trace_watch_id = EMSESP::watch_id();
if ((trace_watch_id == WATCH_ID_NONE) || (type_id == trace_watch_id)
|| ((trace_watch_id < 0x80) && ((src == trace_watch_id) || (dest == trace_watch_id)))) {
LOG_NOTICE(("Rx: %s"), Helpers::data_to_hex(data, length).c_str());
LOG_NOTICE("Rx: %s", Helpers::data_to_hex(data, length).c_str());
} else if (EMSESP::trace_raw()) {
LOG_TRACE(("Rx: %s"), Helpers::data_to_hex(data, length).c_str());
LOG_TRACE("Rx: %s", Helpers::data_to_hex(data, length).c_str());
}
} else if (EMSESP::trace_raw()) {
LOG_TRACE(("Rx: %s"), Helpers::data_to_hex(data, length).c_str());
LOG_TRACE("Rx: %s", Helpers::data_to_hex(data, length).c_str());
}
#ifdef EMSESP_DEBUG
LOG_DEBUG(("[DEBUG] New Rx telegram, message length %d"), message_length);
LOG_DEBUG("[DEBUG] New Rx telegram, message length %d", message_length);
#endif
// if we don't have a type_id exit,
@@ -262,7 +262,7 @@ void TxService::start() {
// sends a 1 byte poll which is our own deviceID
void TxService::send_poll() const {
//LOG_DEBUG(("Ack %02X"),ems_bus_id() ^ ems_mask());
//LOG_DEBUG("Ack %02X",ems_bus_id() ^ ems_mask());
if (tx_mode()) {
EMSuart::send_poll(ems_bus_id() ^ ems_mask());
}
@@ -363,12 +363,12 @@ void TxService::send_telegram(const QueuedTxTelegram & tx_telegram) {
// if we're in simulation mode, don't send anything, just quit
if (EMSESP::system_.readonly_mode() && (telegram->operation == Telegram::Operation::TX_WRITE)) {
LOG_INFO(("[readonly] Sending write Tx telegram: %s"), Helpers::data_to_hex(telegram_raw, length - 1).c_str());
LOG_INFO("[readonly] Sending write Tx telegram: %s", Helpers::data_to_hex(telegram_raw, length - 1).c_str());
tx_state(Telegram::Operation::NONE);
return;
}
LOG_DEBUG(("Sending %s Tx [#%d], telegram: %s"),
LOG_DEBUG("Sending %s Tx [#%d], telegram: %s",
(telegram->operation == Telegram::Operation::TX_WRITE) ? ("write") : ("read"),
tx_telegram.id_,
Helpers::data_to_hex(telegram_raw, length - 1).c_str()); // exclude the last CRC byte
@@ -429,7 +429,7 @@ void TxService::add(const uint8_t operation,
auto telegram = std::make_shared<Telegram>(operation, ems_bus_id(), dest, type_id, offset, message_data, message_length);
#ifdef EMSESP_DEBUG
LOG_DEBUG(("[DEBUG] New Tx [#%d] telegram, length %d"), tx_telegram_id_, message_length);
LOG_DEBUG("[DEBUG] New Tx [#%d] telegram, length %d", tx_telegram_id_, message_length);
#endif
// if the queue is full, make room but removing the last one
@@ -488,7 +488,7 @@ void TxService::add(uint8_t operation, const uint8_t * data, const uint8_t lengt
// if we don't have a type_id or empty data block, exit
if ((type_id == 0) || (message_length == 0)) {
#ifdef EMSESP_DEBUG
LOG_DEBUG(("[DEBUG] Tx telegram type %d failed, length %d"), type_id, message_length);
LOG_DEBUG("[DEBUG] Tx telegram type %d failed, length %d", type_id, message_length);
#endif
return;
}
@@ -511,7 +511,7 @@ void TxService::add(uint8_t operation, const uint8_t * data, const uint8_t lengt
}
#ifdef EMSESP_DEBUG
LOG_DEBUG(("[DEBUG] New Tx [#%d] telegram, length %d"), tx_telegram_id_, message_length);
LOG_DEBUG("[DEBUG] New Tx [#%d] telegram, length %d", tx_telegram_id_, message_length);
#endif
if (front) {
@@ -528,7 +528,7 @@ void TxService::add(uint8_t operation, const uint8_t * data, const uint8_t lengt
// send a Tx telegram to request data from an EMS device
void TxService::read_request(const uint16_t type_id, const uint8_t dest, const uint8_t offset, const uint8_t length) {
LOG_DEBUG(("Tx read request to device 0x%02X for type ID 0x%02X"), dest, type_id);
LOG_DEBUG("Tx read request to device 0x%02X for type ID 0x%02X", dest, type_id);
uint8_t message_data = (type_id > 0xFF) ? (EMS_MAX_TELEGRAM_MESSAGE_LENGTH - 2) : EMS_MAX_TELEGRAM_MESSAGE_LENGTH;
// if length set, publish result and set telegram to front
@@ -593,7 +593,7 @@ void TxService::retry_tx(const uint8_t operation, const uint8_t * data, const ui
EMSESP::wait_validate(0); // do not wait for validation
if (operation == Telegram::Operation::TX_READ) {
if (telegram_last_->offset > 0) { // ignore errors for higher offsets
LOG_DEBUG(("Last Tx Read operation failed after %d retries. Ignoring request: %s"), MAXIMUM_TX_RETRIES, telegram_last_->to_string().c_str());
LOG_DEBUG("Last Tx Read operation failed after %d retries. Ignoring request: %s", MAXIMUM_TX_RETRIES, telegram_last_->to_string().c_str());
return;
}
increment_telegram_read_fail_count(); // another Tx fail
@@ -601,7 +601,7 @@ void TxService::retry_tx(const uint8_t operation, const uint8_t * data, const ui
increment_telegram_write_fail_count(); // another Tx fail
}
LOG_ERROR(("Last Tx %s operation failed after %d retries. Ignoring request: %s"),
LOG_ERROR("Last Tx %s operation failed after %d retries. Ignoring request: %s",
(operation == Telegram::Operation::TX_WRITE) ? ("Write") : ("Read"),
MAXIMUM_TX_RETRIES,
telegram_last_->to_string().c_str());
@@ -613,7 +613,7 @@ void TxService::retry_tx(const uint8_t operation, const uint8_t * data, const ui
}
#ifdef EMSESP_DEBUG
LOG_DEBUG(("[DEBUG] Last Tx %s operation failed. Retry #%d. sent message: %s, received: %s"),
LOG_DEBUG("[DEBUG] Last Tx %s operation failed. Retry #%d. sent message: %s, received: %s",
(operation == Telegram::Operation::TX_WRITE) ? ("Write") : ("Read"),
retry_count_,
telegram_last_->to_string().c_str(),
@@ -665,7 +665,7 @@ uint16_t TxService::post_send_query() {
(this->telegram_last_->type_id > 0xFF) ? (EMS_MAX_TELEGRAM_MESSAGE_LENGTH - 2) : EMS_MAX_TELEGRAM_MESSAGE_LENGTH; // request all data, 32 bytes
this->add(Telegram::Operation::TX_READ, dest, post_typeid, offset, &message_data, 1, 0, true); // add to top/front of queue
// read_request(telegram_last_post_send_query_, dest, 0); // no offset
LOG_DEBUG(("Sending post validate read, type ID 0x%02X to dest 0x%02X"), post_typeid, dest);
LOG_DEBUG("Sending post validate read, type ID 0x%02X to dest 0x%02X", post_typeid, dest);
set_post_send_query(0); // reset
// delay the request if we have a different type_id for post_send_query
delayed_send_ = (this->telegram_last_->type_id == post_typeid) ? 0 : (uuid::get_uptime() + POST_SEND_DELAY);