added verbose arg to decode()
This commit is contained in:
@@ -293,7 +293,7 @@ result_t Message::prepareSlave(SymbolString& slaveData)
|
||||
}
|
||||
|
||||
result_t Message::decode(const PartType partType, SymbolString& data,
|
||||
ostringstream& output, bool leadingSeparator, char separator)
|
||||
ostringstream& output, bool leadingSeparator, bool verbose, char separator)
|
||||
{
|
||||
unsigned char offset;
|
||||
if (partType == pt_masterData)
|
||||
@@ -301,7 +301,7 @@ result_t Message::decode(const PartType partType, SymbolString& data,
|
||||
else
|
||||
offset = 0;
|
||||
int startPos = output.str().length();
|
||||
result_t result = m_data->read(partType, data, offset, output, leadingSeparator, false, separator);
|
||||
result_t result = m_data->read(partType, data, offset, output, leadingSeparator, verbose, separator);
|
||||
time(&m_lastUpdateTime);
|
||||
if (result != RESULT_OK) {
|
||||
m_lastValue.clear();
|
||||
|
||||
@@ -165,11 +165,13 @@ public:
|
||||
* @param data the unescaped data @a SymbolString for reading binary data.
|
||||
* @param output the @a ostringstream to append the formatted value to.
|
||||
* @param leadingSeparator whether to prepend a separator before the formatted value.
|
||||
* @param verbose whether to prepend the name, append the unit (if present), and append
|
||||
* the comment in square brackets (if present).
|
||||
* @param separator the separator character between multiple fields.
|
||||
* @return @a RESULT_OK on success, or an error code.
|
||||
*/
|
||||
result_t decode(const PartType partType, SymbolString& data,
|
||||
ostringstream& output, bool leadingSeparator=false, char separator=UI_FIELD_SEPARATOR);
|
||||
ostringstream& output, bool leadingSeparator=false, bool verbose=false, char separator=UI_FIELD_SEPARATOR);
|
||||
|
||||
/**
|
||||
* @brief Get the last decoded value.
|
||||
|
||||
Reference in New Issue
Block a user