BeeeOn Gateway
v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
|
ChecksumSensorDataFormatter is a wrapper around any SensorDataFormatter. Its job is to utilize the wrapped formatter for the actual serialization and to prepend a checksum at the beginning of the record. More...
#include <ChecksumSensorDataFormatter.h>
Public Member Functions | |
ChecksumSensorDataFormatter (SensorDataFormatter::Ptr formatter) | |
void | setDelimiter (const std::string &delimiter) |
Set delimiter between the prepended checksum and the actual data part formatted by the wrapped formatter. | |
void | setFormatter (SensorDataFormatter::Ptr formatter) |
std::string | format (const SensorData &data) override |
Format the given data via the configured formatter and prepend checksum of the resulted string. The result would be of the following form: More... | |
Additional Inherited Members | |
Public Types inherited from BeeeOn::SensorDataFormatter | |
typedef Poco::SharedPtr < SensorDataFormatter > | Ptr |
ChecksumSensorDataFormatter is a wrapper around any SensorDataFormatter. Its job is to utilize the wrapped formatter for the actual serialization and to prepend a checksum at the beginning of the record.
|
overridevirtual |
Format the given data via the configured formatter and prepend checksum of the resulted string. The result would be of the following form:
CCCCCCCCD*S*
where C represents a single checksum character, D* represents the delimiter string and S* the actual sensoric data string.
Implements BeeeOn::SensorDataFormatter.