BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Public Member Functions | Protected Member Functions
BeeeOn::ChecksumSensorDataParser Class Reference

ChecksumSensorDataParser parses data serialized by the equivalently configured ChecksumSensorDataFormatter. It first extracts the checksum at the beginning of the given string. Then the wrapped parser is used to parse the rest. More...

#include <ChecksumSensorDataParser.h>

Inheritance diagram for BeeeOn::ChecksumSensorDataParser:
BeeeOn::SensorDataParser

Public Member Functions

 ChecksumSensorDataParser (SensorDataParser::Ptr parser)
 
void setDelimiter (const std::string &delimiter)
 Set delimiter between the prepended checksum and the actual data part formatted by the wrapped formatter.
 
void setParser (SensorDataParser::Ptr parser)
 
SensorData parse (const std::string &data) const override
 Parse the given data string. Expect it to start with a checksum following by the given delimiter. The rest of the string is parsed by the wrapped parser.
 

Protected Member Functions

SensorData parseNoDelimiter (const std::string &data) const
 Parse the input data in case when the preset delimiter is empty.
 
SensorData checkAndParse (const std::string &prefix, const std::string &content) const
 Check the given checksum and parse the content by the configured parser.
 

Additional Inherited Members

- Public Types inherited from BeeeOn::SensorDataParser
typedef Poco::SharedPtr
< SensorDataParser
Ptr
 

Detailed Description

ChecksumSensorDataParser parses data serialized by the equivalently configured ChecksumSensorDataFormatter. It first extracts the checksum at the beginning of the given string. Then the wrapped parser is used to parse the rest.


The documentation for this class was generated from the following files: