HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
HF::Interfaces::SimplePowerMeter::Report Struct Reference

Simple Meter report. More...

#include <simple_power_meter.h>

+ Collaboration diagram for HF::Interfaces::SimplePowerMeter::Report:

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...
 

Data Fields

Measurement energy
 Energy measurement. More...
 
Measurement last_energy
 Energy measurement at last reset. More...
 
Measurement last_time
 Device time measurement at last reset. More...
 
Measurement power
 Instantaneous Power measurement. More...
 
Measurement avg_power
 Average Power measurement. More...
 
uint16_t avg_power_interval
 Average Power Interval. More...
 
uint8_t power_factor
 Power Factor. More...
 
Measurement voltage
 Voltage measurement. More...
 
Measurement current
 Current measurement. More...
 
Measurement frequency
 Frequency measurement. More...
 
std::array< bool, __LAST_ATTR__+1 > enabled
 This array contains an indication of with attributes should be packed or were unpacked.
 

Static Public Attributes

static constexpr uint16_t min_size = sizeof(uint8_t)
 Minimum pack/unpack required data size.
 

Detailed Description

Simple Meter report.

Todo:
This needs a way to dynamically add only the attributes that are needed to the report.

Definition at line 222 of file simple_power_meter.h.

Member Function Documentation

◆ pack()

uint16_t HF::Interfaces::SimplePowerMeter::Report::pack ( Common::ByteArray array,
uint16_t  offset = 0 
) const

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.,

Serializable obj;
ByteArray payload(obj.size());
obj.pack(payload);
Parameters
[in,out]arrayByteArray reference to write the object to.
[in]offsetoffset to start writing to.
Returns
the number of bytes written.

◆ size()

uint16_t HF::Interfaces::SimplePowerMeter::Report::size ( ) const

Number bytes needed to serialize the message.

Returns
number of bytes the message requires to be serialized.

◆ unpack()

uint16_t HF::Interfaces::SimplePowerMeter::Report::unpack ( const Common::ByteArray array,
uint16_t  offset = 0 
)

Read a message from a ByteArray.

Parameters
[in]arrayByteArray reference to read the message from.
[in]offsetoffset to start reading from.
Returns
the number of bytes read.

Field Documentation

◆ avg_power

Measurement HF::Interfaces::SimplePowerMeter::Report::avg_power

Average Power measurement.

Definition at line 230 of file simple_power_meter.h.

◆ avg_power_interval

uint16_t HF::Interfaces::SimplePowerMeter::Report::avg_power_interval

Average Power Interval.

Definition at line 232 of file simple_power_meter.h.

◆ current

Measurement HF::Interfaces::SimplePowerMeter::Report::current

Current measurement.

Definition at line 237 of file simple_power_meter.h.

◆ energy

Measurement HF::Interfaces::SimplePowerMeter::Report::energy

Energy measurement.

Definition at line 224 of file simple_power_meter.h.

◆ frequency

Measurement HF::Interfaces::SimplePowerMeter::Report::frequency

Frequency measurement.

Definition at line 238 of file simple_power_meter.h.

◆ last_energy

Measurement HF::Interfaces::SimplePowerMeter::Report::last_energy

Energy measurement at last reset.

Definition at line 226 of file simple_power_meter.h.

◆ last_time

Measurement HF::Interfaces::SimplePowerMeter::Report::last_time

Device time measurement at last reset.

Definition at line 227 of file simple_power_meter.h.

◆ power

Measurement HF::Interfaces::SimplePowerMeter::Report::power

Instantaneous Power measurement.

Definition at line 229 of file simple_power_meter.h.

◆ power_factor

uint8_t HF::Interfaces::SimplePowerMeter::Report::power_factor

Power Factor.

Definition at line 234 of file simple_power_meter.h.

◆ voltage

Measurement HF::Interfaces::SimplePowerMeter::Report::voltage

Voltage measurement.

Definition at line 236 of file simple_power_meter.h.


The documentation for this struct was generated from the following file: