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

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>

Inheritance diagram for BeeeOn::ChecksumSensorDataFormatter:
BeeeOn::SensorDataFormatter

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
 

Detailed Description

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.

Member Function Documentation

string ChecksumSensorDataFormatter::format ( const SensorData data)
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.


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