formatting
This commit is contained in:
@@ -1049,7 +1049,6 @@ result_t BusHandler::setState(BusState state, result_t result, bool firstRepetit
|
||||
} else if (m_state == bs_noSignal) {
|
||||
logNotice(lf_bus, "signal acquired");
|
||||
}
|
||||
// logDebug(lf_bus, "state: from %s to %s with %s", getStateCode(m_state), getStateCode(state), getResultCode(result));
|
||||
m_state = state;
|
||||
|
||||
if (state == bs_ready || state == bs_skip) {
|
||||
|
||||
@@ -655,11 +655,17 @@ void MqttHandler::notifyTopic(const string& topic, const string& data) {
|
||||
if (namePrefix) {
|
||||
name = name.substr(0, name.length()-1);
|
||||
}
|
||||
m_messages->findAll(circuit, name, m_levels, !(circuitPrefix || namePrefix), true, true, true, true, true, 0, 0, false, &messages);
|
||||
m_messages->findAll(circuit, name, m_levels, !(circuitPrefix || namePrefix), true, true,
|
||||
true, true, true, 0, 0, false, &messages);
|
||||
bool onlyWithData = !data.empty();
|
||||
for (const auto message : messages) {
|
||||
if (circuitPrefix && (message->getCircuit().substr(0, circuit.length())!=circuit || !namePrefix && name.length()>0 && message->getName()!=name)
|
||||
|| namePrefix && (message->getName().substr(0, name.length())!=name || !circuitPrefix && circuit.length()>0 && message->getCircuit()!=circuit)) {
|
||||
if ((circuitPrefix && (
|
||||
message->getCircuit().substr(0, circuit.length()) != circuit
|
||||
|| (!namePrefix && name.length() > 0 && message->getName() != name)))
|
||||
|| (namePrefix && (
|
||||
message->getName().substr(0, name.length()) != name
|
||||
|| (!circuitPrefix && circuit.length() > 0 && message->getCircuit() != circuit)))
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
time_t lastup = message->getLastUpdateTime();
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#endif
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <ios>
|
||||
#include <iomanip>
|
||||
@@ -547,7 +548,8 @@ bool Device::read(symbol_t* value, bool isAvailable, ArbitrationState* arbitrati
|
||||
default:
|
||||
if (m_listener != nullptr) {
|
||||
ostringstream stream;
|
||||
stream << "unexpected enhanced command 0x" << std::setw(2) << std::setfill('0') << std::hex << static_cast<unsigned>(cmd);
|
||||
stream << "unexpected enhanced command 0x" << std::setw(2) << std::setfill('0') << std::hex
|
||||
<< static_cast<unsigned>(cmd);
|
||||
string str = stream.str();
|
||||
m_listener->notifyStatus(true, str.c_str());
|
||||
}
|
||||
|
||||
@@ -45,7 +45,8 @@ class RotateFile {
|
||||
* @param textMode whether to write each byte with prefixed timestamp and direction as text.
|
||||
* @param flushBuffer the size of the flush buffer.
|
||||
*/
|
||||
RotateFile(const string fileName, const unsigned int maxSize, const bool textMode = false, const unsigned int flushBuffer = 16)
|
||||
RotateFile(const string fileName, const unsigned int maxSize, const bool textMode = false,
|
||||
const unsigned int flushBuffer = 16)
|
||||
: m_enabled(false), m_fileName(fileName), m_maxSize(maxSize), m_textMode(textMode), m_stream(), m_fileSize(0),
|
||||
m_flushSize(0), m_flushBuffer(flushBuffer) {}
|
||||
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
/*
|
||||
* ebusd - daemon for communication with eBUS heating systems.
|
||||
* Copyright (C) 2020-2021 John Baier <ebusd@ebusd.eu>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -7,11 +23,13 @@
|
||||
#include <time.h>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
#include <argp.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <cstdlib>
|
||||
#include <iomanip>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
#include <argp.h>
|
||||
#include "intelhex/intelhexclass.h"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user