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

Provides a method to parse SensorData from a string containing JSONObject to a SensorData object. More...

#include <JSONSensorDataParser.h>

Inheritance diagram for BeeeOn::JSONSensorDataParser:
BeeeOn::SensorDataParser

Public Member Functions

SensorData parse (const std::string &data) const override
 

Additional Inherited Members

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

Detailed Description

Provides a method to parse SensorData from a string containing JSONObject to a SensorData object.

Example string:

    {"device_id":"0x499602d2","timestamp":150000000000,"data":[{"module_id":5,"value":4.2},{"module_id":4,"value":0.5}]}

would be parsed to a SensorData object with relevant values. It is assumed that the "timestamp" contains epochMicroseconds. When a "value" is null, it is parsed to NaN.

Member Function Documentation

SensorData JSONSensorDataParser::parse ( const std::string &  data) const
overridevirtual

Convert string representation of SensorData to SensorData object.

Implements BeeeOn::SensorDataParser.


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