![]() |
HAN-FUN API
1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
|
This represents a measurement for a given attribute. More...
#include <simple_power_meter.h>
Public Member Functions | |
uint16_t | size () const |
Number bytes needed to serialize the message. More... | |
uint16_t | pack (Common::ByteArray &array, uint16_t offset=0) const |
Write the object on to a ByteArray so it can be sent over the network. More... | |
uint16_t | unpack (const Common::ByteArray &array, uint16_t offset=0) |
Read a message from a ByteArray. More... | |
int | compare (const Measurement &other) const |
Compare this attribute with the given attribute in other . More... | |
float | changed (const Measurement &other) const |
This method is used to get the percentage of change that the attribute has in relation to the value present in other . More... | |
Data Fields | |
uint8_t | unit |
Measurement precision/type. More... | |
uint32_t | value |
Measurement value. More... | |
Static Public Attributes | |
static constexpr uint16_t | min_size |
Minimum pack/unpack required data size. | |
This represents a measurement for a given attribute.
Definition at line 152 of file simple_power_meter.h.
|
inline |
This method is used to get the percentage of change that the attribute has in relation to the value present in other
.
[in] | other | attribute holding a previous value. |
Definition at line 210 of file simple_power_meter.h.
References value.
|
inline |
Compare this attribute with the given attribute in other
.
This method should return < 0 if this attribute is less that, 0 if it is equal and > 0 if greater that the other
attribute.
[in] | other | attribute to compare to. |
<0 | if attribute less than other ; |
0 | if attribute equal to other ; |
>0 | if attribute greater than other . |
Definition at line 198 of file simple_power_meter.h.
References value.
|
inline |
Write the object on to a ByteArray so it can be sent over the network.
The buffer passed in MUST have enough size to hold the serialized object, e.g.,
[in,out] | array | ByteArray reference to write the object to. |
[in] | offset | offset to start writing to. |
Definition at line 168 of file simple_power_meter.h.
References HF_SERIALIZABLE_CHECK, min_size, unit, value, and HF::Common::ByteArray::write().
|
inline |
Number bytes needed to serialize the message.
Definition at line 162 of file simple_power_meter.h.
References min_size.
|
inline |
Read a message from a ByteArray.
[in] | array | ByteArray reference to read the message from. |
[in] | offset | offset to start reading from. |
Definition at line 179 of file simple_power_meter.h.
References HF_SERIALIZABLE_CHECK, min_size, HF::Common::ByteArray::read(), unit, and value.
uint8_t HF::Interfaces::SimplePowerMeter::Measurement::unit |
Measurement precision/type.
Definition at line 158 of file simple_power_meter.h.
uint32_t HF::Interfaces::SimplePowerMeter::Measurement::value |