BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
JablotronReport.h
1 #pragma once
2 
3 namespace BeeeOn {
4 
17  const uint32_t address;
18 
22  const std::string type;
23 
27  const std::string data;
28 
32  operator bool() const;
33 
37  bool operator !() const;
38 
49  bool has(const std::string &keyword, bool hasValue = false) const;
50 
56  int get(const std::string &keyword) const;
57 
66  double temperature(const std::string &keyword) const;
67 
75  unsigned int battery() const;
76 
80  std::string toString() const;
81 
85  static JablotronReport invalid();
86 };
87 
88 }
Report with data coming from a sensor. Each report comes in format [AAAAAAAA] TYPE PAYLOAD...
Definition: JablotronReport.h:13
double temperature(const std::string &keyword) const
Almost same logic as for JablotronReport::get(), just the value is expected in the temperature format...
Definition: JablotronReport.cpp:63
const std::string type
Type of device.
Definition: JablotronReport.h:22
unsigned int battery() const
It calls JablotronReport::get("LB") internally and interprets the value as 1 - 5 % and 0 - 100 %...
Definition: JablotronReport.cpp:81
bool operator!() const
Definition: JablotronReport.cpp:21
std::string toString() const
Definition: JablotronReport.cpp:86
const std::string data
Data payload.
Definition: JablotronReport.h:27
bool has(const std::string &keyword, bool hasValue=false) const
Search the payload for a keyword like BEACON, SENSOR, etc.
Definition: JablotronReport.cpp:34
const uint32_t address
Address of the source device.
Definition: JablotronReport.h:17
static JablotronReport invalid()
Definition: JablotronReport.cpp:92