extend MQTT integration support with seen filter and variable compression
This commit is contained in:
@@ -115,7 +115,7 @@ Message::Message(const string& filename, const string& circuit, const string& le
|
||||
m_data(data), m_deleteData(deleteData),
|
||||
m_pollPriority(pollPriority),
|
||||
m_usedByCondition(false), m_isScanMessage(false), m_condition(condition),
|
||||
m_lastUpdateTime(0), m_lastChangeTime(0), m_pollOrder(0), m_lastPollTime(0) {
|
||||
m_dataHandlerState(0), m_lastUpdateTime(0), m_lastChangeTime(0), m_pollOrder(0), m_lastPollTime(0) {
|
||||
if (circuit == "scan") {
|
||||
setScanMessage();
|
||||
m_pollPriority = 0;
|
||||
@@ -1025,6 +1025,14 @@ void Message::decodeJson(bool leadingSeparator, bool appendDirectionCondition, b
|
||||
*output << "\n }";
|
||||
}
|
||||
|
||||
bool Message::setDataHandlerState(int state) {
|
||||
if (state == m_dataHandlerState) {
|
||||
return false;
|
||||
}
|
||||
m_dataHandlerState = state;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
ChainedMessage::ChainedMessage(const string& filename, const string& circuit, const string& level, const string& name,
|
||||
bool isWrite, const map<string, string>& attributes,
|
||||
|
||||
+17
-1
@@ -525,6 +525,19 @@ class Message : public AttributedItem {
|
||||
*/
|
||||
time_t getCreateTime() const { return m_createTime; }
|
||||
|
||||
/**
|
||||
* Get the arbitrary state value for data handlers.
|
||||
* @return the state value.
|
||||
*/
|
||||
int getDataHandlerState() const { return m_dataHandlerState; }
|
||||
|
||||
/**
|
||||
* Set the arbitrary state value for data handlers.
|
||||
* @param state the new state value.
|
||||
* @return true when the state was changed.
|
||||
*/
|
||||
bool setDataHandlerState(int state);
|
||||
|
||||
/**
|
||||
* Get the time when this message was last seen with reasonable data.
|
||||
* @return the time when this message was last seen, or 0.
|
||||
@@ -660,9 +673,12 @@ class Message : public AttributedItem {
|
||||
/** the last seen @a SlaveSymbolString. */
|
||||
SlaveSymbolString m_lastSlaveData;
|
||||
|
||||
/** the system time when the message was created. */
|
||||
/** the system time when the message was created or changed in poll priority. */
|
||||
time_t m_createTime;
|
||||
|
||||
/** an arbitrary state for data handlers. */
|
||||
int m_dataHandlerState;
|
||||
|
||||
/** the system time when the message was last updated, 0 for never. */
|
||||
time_t m_lastUpdateTime;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user