Report with data coming from a sensor. Each report comes in format [AAAAAAAA] TYPE PAYLOAD
. The AAAAAAAA
is an address in decadic format. The TYPE
represents type of the device. The PAYLOAD
contains the actual report that depends on the TYPE
.
More...
#include <JablotronReport.h>
|
const uint32_t | address |
| Address of the source device.
|
|
const std::string | type |
| Type of device.
|
|
const std::string | data |
| Data payload.
|
|
Report with data coming from a sensor. Each report comes in format [AAAAAAAA] TYPE PAYLOAD
. The AAAAAAAA
is an address in decadic format. The TYPE
represents type of the device. The PAYLOAD
contains the actual report that depends on the TYPE
.
unsigned int JablotronReport::battery |
( |
| ) |
const |
It calls JablotronReport::get("LB")
internally and interprets the value as 1 - 5 % and 0 - 100 %.
- Returns
- battery status in percents
- Exceptions
-
Poco::NotFoundException | is no such keyword with value is present in the payload |
int JablotronReport::get |
( |
const std::string & |
keyword | ) |
const |
- Returns
- value associated with the given keyword
- Exceptions
-
Poco::NotFoundException | is no such keyword with value is present in the payload |
bool JablotronReport::has |
( |
const std::string & |
keyword, |
|
|
bool |
hasValue = false |
|
) |
| const |
Search the payload for a keyword like BEACON
, SENSOR
, etc.
If the argument hasValue is true then it is assumed that the keyword has a value separated by colon. In such case, data like BEACON
are ignored due to a missing value. This is useful to search payload for e.g. ACT:0
, ACT:1
, etc.
JablotronReport::operator bool |
( |
| ) |
const |
- Returns
- true if the report is valid.
bool JablotronReport::operator! |
( |
| ) |
const |
- Returns
- true if the report is invalid.
double JablotronReport::temperature |
( |
const std::string & |
keyword | ) |
const |
Almost same logic as for JablotronReport::get(), just the value is expected in the temperature format ##.#
.
- Returns
- temperature value associated with the given keyword.
- Exceptions
-
Poco::SyntaxException | if value is not in a valid temperature format |
Poco::NotFoundException | is no such keyword with value is present in the payload |
string JablotronReport::toString |
( |
| ) |
const |
- Returns
- string representation of the report
The documentation for this struct was generated from the following files:
- /var/lib/jenkins/workspace/beeeon-gateway-master/src/jablotron/JablotronReport.h
- /var/lib/jenkins/workspace/beeeon-gateway-master/src/jablotron/JablotronReport.cpp