neither update last found timestamp nor empty last found value if decoding failed, added decode() for combined master/slave decoding

This commit is contained in:
john30
2014-12-31 09:16:33 +01:00
parent a7d404ee75
commit 2253060b8a
3 changed files with 43 additions and 7 deletions
+18 -1
View File
@@ -176,7 +176,7 @@ public:
result_t prepareSlave(SymbolString& slaveData);
/**
* @brief Decode a received message.
* @brief Decode a singular part of a received message.
* @param partType the @a PartType of the data.
* @param data the unescaped data @a SymbolString for reading binary data.
* @param output the @a ostringstream to append the formatted value to.
@@ -192,6 +192,23 @@ public:
bool verbose=false, const char* filterName=NULL,
char separator=UI_FIELD_SEPARATOR);
/**
* @brief Decode all parts of a received message.
* @param masterData the unescaped master data @a SymbolString to decode.
* @param slaveData the unescaped slave data @a SymbolString to decode.
* @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 filterName the optional name of a field to limit the output to.
* @param separator the separator character between multiple fields.
* @return @a RESULT_OK on success, or an error code.
*/
result_t decode(SymbolString& masterData, SymbolString& slaveData,
ostringstream& output, bool leadingSeparator=false,
bool verbose=false, const char* filterName=NULL,
char separator=UI_FIELD_SEPARATOR);
/**
* @brief Get the last decoded value.
* @return the last decoded value, or the empty string if it was not successful.