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

This module contains the classes that define and implement the Time service API. More...

+ Collaboration diagram for Time service:

Data Structures

struct  HF::Core::Time::Value
 Helper class to handle the Time attribute for the Time service. More...
 
struct  HF::Core::Time::Date
 Helper class to parse the time value into a human readable string. More...
 
struct  HF::Core::Time::Base
 Time Service : Parent. More...
 
class  HF::Core::Time::Server
 Time Service : Server side implementation. More...
 
struct  HF::Core::Time::Client
 Time Service : Client side implementation. More...
 

Enumerations

enum  HF::Core::Time::Attributes { HF::Core::Time::TIME_ATTR = 1 }
 Attributes. More...
 

Functions

HF::Attributes::IAttributeHF::Core::create_attribute (Time::Server *server, uint8_t uid)
 Create an attribute object that can hold the attribute with the given uid. More...
 
uint32_t HF::Core::Time::convert (const Date &date)
 Convert the date given by date to the corresponding time value. More...
 
Date HF::Core::Time::convert (uint32_t time)
 Split the time given by value to the year, month, day, hour, minute and second values. More...
 
Date HF::Core::Time::convert (const Value &value)
 Split the time given by value to the year, month, day, hour, minute and second values. More...
 
HF::Attributes::IAttributeHF::Core::Time::create_attribute (uint8_t uid)
 Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::Time::Server *,uint8_t) More...
 
std::ostream & operator<< (std::ostream &stream, const HF::Core::Time::Attributes attribute)
 Convert the given attribute into a string and write it to the given stream. More...
 
std::ostream & operator<< (std::ostream &stream, const HF::Core::Time::Date &date)
 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 Time service API.

Enumeration Type Documentation

◆ Attributes

Attributes.

Enumerator
TIME_ATTR 

Time attribute UID.

Definition at line 63 of file time.h.

64  {
65  TIME_ATTR = 1,
66  __LAST_ATTR__ = TIME_ATTR
67  } Attributes;
Attributes
Attributes.
Definition: time.h:63
Time attribute UID.
Definition: time.h:65

Function Documentation

◆ convert() [1/3]

uint32_t HF::Core::Time::convert ( const Date date)

Convert the date given by date to the corresponding time value.

Parameters
[in]datereference to the date to convert from.
Returns
the time that corresponds to the given date or Value::INVALID in case of error.

◆ convert() [2/3]

Date HF::Core::Time::convert ( uint32_t  time)

Split the time given by value to the year, month, day, hour, minute and second values.

Parameters
[in]timevalue to convert.
Returns
a Date structure containing the time value split into the proper fields.

◆ convert() [3/3]

Date HF::Core::Time::convert ( const Value value)

Split the time given by value to the year, month, day, hour, minute and second values.

Parameters
[in]valuereference to the attribute containing the time value to convert.
Returns
a Date structure containing the time value split into the proper fields.

◆ create_attribute() [1/2]

HF::Attributes::IAttribute* HF::Core::create_attribute ( Time::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::Core::Time::create_attribute ( uint8_t  uid)
inline

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

See also
HF::Core::create_attribute (HF::Core::Time::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::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::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::Core::Time::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
reference to the stream.

◆ operator<<() [2/2]

std::ostream& operator<< ( std::ostream &  stream,
const HF::Core::Time::Date date 
)

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

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