HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
Simple Power Meter

This module contains the classes that define and implement the Simple Power Meter interface API. More...

+ Collaboration diagram for Simple Power Meter:

Data Structures

struct  HF::Interfaces::SimplePowerMeter::Measurement
 This represents a measurement for a given attribute. More...
 
struct  HF::Interfaces::SimplePowerMeter::Report
 Simple Meter report. More...
 
struct  HF::Interfaces::SimplePowerMeter::Base
 Simple Power Meter Interface : Parent. More...
 
class  HF::Interfaces::SimplePowerMeter::Server
 Simple Power Meter Interface : Server side implementation. More...
 
struct  HF::Interfaces::SimplePowerMeter::Client
 Simple Power Meter Interface : Client side implementation. More...
 

Enumerations

enum  HF::Interfaces::SimplePowerMeter::CMD { HF::Interfaces::SimplePowerMeter::REPORT_CMD = 0x01, HF::Interfaces::SimplePowerMeter::MEASUREMENT_RESET_CMD = 0x01 }
 Commands IDs. More...
 
enum  HF::Interfaces::SimplePowerMeter::Attributes {
  HF::Interfaces::SimplePowerMeter::ENERGY_ATTR = 0x01, HF::Interfaces::SimplePowerMeter::ENERGY_AT_RESET_ATTR = 0x02, HF::Interfaces::SimplePowerMeter::TIME_AT_RESET_ATTR = 0x03, HF::Interfaces::SimplePowerMeter::POWER_ATTR = 0x04,
  HF::Interfaces::SimplePowerMeter::AVG_POWER_ATTR = 0x05, HF::Interfaces::SimplePowerMeter::AVG_POWER_INTERVAL_ATTR = 0x06, HF::Interfaces::SimplePowerMeter::VOLTAGE_ATTR = 0x07, HF::Interfaces::SimplePowerMeter::CURRENT_ATTR = 0x08,
  HF::Interfaces::SimplePowerMeter::FREQUENCY_ATTR = 0x09, HF::Interfaces::SimplePowerMeter::POWER_FACTOR_ATTR = 0x0A, HF::Interfaces::SimplePowerMeter::REPORT_INTERVAL_ATTR = 0x0B
}
 Attributes IDs. More...
 

Functions

HF::Attributes::IAttributeHF::Interfaces::create_attribute (HF::Interfaces::SimplePowerMeter::Server *server, uint8_t uid)
 Create an attribute object that can hold the attribute with the given uid. More...
 
HF::Attributes::IAttributeHF::Interfaces::SimplePowerMeter::create_attribute (uint8_t uid)
 Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::SimplePowerMeter::Server *,uint8_t) More...
 
std::ostream & operator<< (std::ostream &stream, const HF::Interfaces::SimplePowerMeter::CMD command)
 Convert the given command into a string and write it to the given stream. More...
 
std::ostream & operator<< (std::ostream &stream, const HF::Interfaces::SimplePowerMeter::Attributes attribute)
 Convert the given attribute into a string and write it to the given stream. More...
 

Detailed Description

This module contains the classes that define and implement the Simple Power Meter interface API.

Enumeration Type Documentation

◆ Attributes

Attributes IDs.

Enumerator
ENERGY_ATTR 

Energy Attribute ID.

ENERGY_AT_RESET_ATTR 

Energy at Last Reset Attribute ID.

TIME_AT_RESET_ATTR 

Time at Last Reset Attribute ID.

POWER_ATTR 

Instantaneous Power Attribute ID.

AVG_POWER_ATTR 

Average Power Attribute ID.

AVG_POWER_INTERVAL_ATTR 

Average Power Interval Attribute ID.

VOLTAGE_ATTR 

Voltage Attribute ID.

CURRENT_ATTR 

Current Attribute ID.

FREQUENCY_ATTR 

Frequency Attribute ID.

POWER_FACTOR_ATTR 

Power Factor Attribute ID.

REPORT_INTERVAL_ATTR 

Report Interval Attribute ID.

Definition at line 133 of file simple_power_meter.h.

134  {
135  ENERGY_ATTR = 0x01,
136  ENERGY_AT_RESET_ATTR = 0x02,
137  TIME_AT_RESET_ATTR = 0x03,
138  POWER_ATTR = 0x04,
139  AVG_POWER_ATTR = 0x05,
140  AVG_POWER_INTERVAL_ATTR = 0x06,
141  VOLTAGE_ATTR = 0x07,
142  CURRENT_ATTR = 0x08,
143  FREQUENCY_ATTR = 0x09,
144  POWER_FACTOR_ATTR = 0x0A,
145  REPORT_INTERVAL_ATTR = 0x0B,
146  __LAST_ATTR__ = REPORT_INTERVAL_ATTR,
147  } Attributes;
Instantaneous Power Attribute ID.

◆ CMD

Commands IDs.

Enumerator
REPORT_CMD 

Report command ID.

MEASUREMENT_RESET_CMD 

Measurement Reset command ID.

Definition at line 124 of file simple_power_meter.h.

Function Documentation

◆ create_attribute() [1/2]

HF::Attributes::IAttribute* HF::Interfaces::create_attribute ( HF::Interfaces::SimplePowerMeter::Server server,
uint8_t  uid 
)

Create an attribute object that can hold the attribute with the given uid.

If server is not equal to nullptr then initialize it with the current value.

Parameters
[in]serverpointer to the object to read the current value from.
[in]uidattribute's UID to create the attribute object for.
Returns
pointer to an attribute object or nullptr if the attribute UID does not exist.

◆ create_attribute() [2/2]

HF::Attributes::IAttribute* HF::Interfaces::SimplePowerMeter::create_attribute ( uint8_t  uid)
inline

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::SimplePowerMeter::Server *,uint8_t)

See also
HF::Interfaces::create_attribute (HF::Interfaces::SimplePowerMeter::Server *,uint8_t)
Parameters
[in]uidattribute UID to create the attribute object for.
Return values
pointerto an attribute object
<tt>nullptr</tt>if the attribute UID does not exist.

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::SimplePowerMeter::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::SimpleLightSensor::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::SimpleKeypad::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::SimpleButton::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::SimpleAirPressure::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::OnOff::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::LevelControl::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::ColourControl::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::Alert::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Core::Scheduling::Weekly::IServer *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::Time::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::SUOTA::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::RSSI::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Core::GroupTable::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid.

Create an attribute object that can hold the attribute with the given uid. (HF::Core::Scheduling::Event::IServer *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Core::DeviceManagement::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Core::DeviceInformation::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Core::BindManagement::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Core::BatchProgramManagement::IServer *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Core::AttributeReporting::Server *,uint8_t)

See also
HF::Interfaces::create_attribute (HF::Interfaces::SimpleHumidity::Server *,uint8_t)
Parameters
[in]uidattribute UID to create the attribute object for.
Returns
pointer to an attribute object or nullptr if the attribute UID does not exist.

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::SimplePowerMeter::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::SimpleLightSensor::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::SimpleKeypad::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::SimpleButton::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::SimpleAirPressure::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::OnOff::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::LevelControl::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::ColourControl::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::Alert::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Core::Scheduling::Weekly::IServer *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::Time::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::SUOTA::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::RSSI::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Core::GroupTable::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid.

Create an attribute object that can hold the attribute with the given uid. (HF::Core::Scheduling::Event::IServer *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Core::DeviceManagement::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Core::DeviceInformation::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Core::BindManagement::Server *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Core::BatchProgramManagement::IServer *,uint8_t)

Create an attribute object that can hold the attribute with the given uid. (HF::Core::AttributeReporting::Server *,uint8_t)

See also
HF::Interfaces::create_attribute (HF::Interfaces::SimpleTemperature::Server *,uint8_t)
Parameters
[in]uidattribute UID to create the attribute object for.
Return values
pointerto an attribute object
<tt>nullptr</tt>if the attribute UID does not exist.

Definition at line 108 of file simple_humidity.h.

109  {
110  return Interfaces::create_attribute(static_cast<SimpleHumidity::Server *>(nullptr),
111  uid);
112  }
HF::Attributes::IAttribute * create_attribute(uint8_t uid)
Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::SimpleHum...

◆ operator<<() [1/2]

std::ostream& operator<< ( std::ostream &  stream,
const HF::Interfaces::SimplePowerMeter::CMD  command 
)

Convert the given command into a string and write it to the given stream.

Parameters
[in]streamout stream to write the string to.
[in]commandrole value to convert to a string.
Returns
stream

◆ operator<<() [2/2]

std::ostream& operator<< ( std::ostream &  stream,
const HF::Interfaces::SimplePowerMeter::Attributes  attribute 
)

Convert the given attribute into a string and write it to the given stream.

Parameters
[in]streamout stream to write the string to.
[in]attributeattribute value to convert to a string.
Returns
stream