24 #include "json/json.h" 115 void save(Json::Value &root);
122 void restore(Json::Value root);
179 void save(Json::Value &root);
186 void restore(Json::Value root);
221 struct Unit:
public HF::Units::Unit<HF::Profiles::GenericApplicationLogic, Alert,
222 LevelControl, OnOff, SimplePowerMeter>
225 HF::Units::Unit<
HF::Profiles::GenericApplicationLogic, Alert, LevelControl,
226 OnOff, SimplePowerMeter>(id, device)
239 struct Unit:
public HF::Units::Unit<HF::Profiles::GenericApplicationLogic, Alert,
240 LevelControl, OnOff, SimplePowerMeter>
243 HF::Units::Unit<
HF::Profiles::GenericApplicationLogic, Alert, LevelControl,
244 OnOff, SimplePowerMeter>(id, device)
249 return *
const_cast<Alert *
>(get<0>());
252 LevelControl &level_control()
254 return *
const_cast<LevelControl *
>(get<1>());
259 return *
const_cast<OnOff *
>(get<2>());
262 SimplePowerMeter &simple_power_meter()
264 return *
const_cast<SimplePowerMeter *
>(get<3>());
284 #if HF_BATCH_PROGRAM_SUPPORT 287 #if HF_EVENT_SCHEDULING_SUPPORT 290 #if HF_WEEKLY_SCHEDULING_SUPPORT 294 HF::Core::GroupTable::DefaultServer,
305 Commands::Unit commands;
308 events(1, *
this), commands(2, *
this)
318 std::forward_list<HF::Transport::Link *> &links()
332 bool has_bind(uint16_t dev_addr_1, uint16_t dev_addr_2);
345 uint8_t
bind(uint16_t dev_addr_1, uint16_t dev_addr_2);
358 bool unbind(uint16_t dev_addr_1, uint16_t dev_addr_2);
void insert(Entry &entry)
Insert a bind management entry into the database.
bool available(uint16_t address)
Check if the given address is available for registration.
This class represents a HAN-FUN Concentrator.
HF::Devices::Concentrator::Unit0< HF::Core::DeviceInformation::Server, ::DeviceManagement::Server, HF::Core::AttributeReporting::Server, ::BindManagement::Server > Unit0
Custom Unit0 declaration.
On-Off Interface : Client side implementation.
Server DefaultServer
Helper typedef.
This represent the special unit with ID/UID = 0.
This is the top level include file for the HAN-FUN library.
Simple Power Meter Interface : Server side implementation.
Default implementation of the persistence API.
Server< Entries< Day > > DefaultServer
Weekly Scheduling Service : Server side with default persistence implementation.
void insert(const Device &device)
Insert a device management entry into the database.
Default implementation of the bind entries container.
bool deregister(uint16_t address)
De-register the device with the given address.
Units::IUnit * unit(uint8_t id) const
Return pointer to the unit with the given id.
Server< Entries< Interval > > DefaultServer
Event Scheduling Service : Server side with default persistence implementation.
constexpr uint16_t BROADCAST_ADDR
HAN-FUN Broadcast - device address.
Level Control Interface : Client side implementation.
void save(Json::Value &root)
Save the bind entries into the JSON database.
Payload for the Status command.
Attribute Reporting - Server Role.
Alert Interface : Client side implementation.
Custom Device Management class.
Helper class used to implement custom functionality to the device management server side...
Helper template class to implement units.
This class represents the interface common to all HAN-FUN devices.
Custom Device Management Entries class.
On-Off Interface : Server side implementation.
Common::SimpleList< Transport::Link * > _links
List of links present in this concentrator.
Unit 0 interface API for HAN-FUN Concentrators.
uint16_t address() const
Return the device address on the HAN-FUN network, when the device is registered, or HF_BROADCAST_ADDR...
Helper class used to implement custom functionality to the bind management server side...
Template for HAN-FUN concentrator devices.
Wrapper around UID_T pointer's.
This class represents a byte array.
Simple Power Meter Interface : Client side implementation.
void to_json(HF::UID::UID *uid, Json::Value &node)
Serialize a HF::UID::UID pointer to the given Json::Value.
Template to create Unit0 for HAN-FUN concentrator devices.
uint16_t next_address(uint16_t addr)
Set the device address for the next registration message.
Custom Bind Management Entries class.
Level Control Interface : Server side implementation.
bool unbind(uint16_t dev_addr_1, uint16_t dev_addr_2)
Remove the binding entry for the given devices.
Alert Interface : Server side implementation.
Time Service : Server side implementation.
This represents a bind entry data structure.
Simple raw pointer wrapper.
void receive(HF::Protocol::Packet &packet, HF::Common::ByteArray &payload, uint16_t offset)
Callback to deliver a packet received from the transport layer.
void restore(Json::Value root)
Restore the device entries from the JSON database.
void from_json(Json::Value &node, HF::UID::UID *&uid)
Create a new HF::UID::UID based on the fields present in the given Json::Value object.
void save(Json::Value &root)
Save the device entries into the JSON database.
This file contains the definitions for the common functionality in the HAN-FUN example applications...
Helper class used to implement custom functionality to the group management server side...
uint16_t next_address()
Return next available address for registering a device.
void restore(Json::Value root)
Restore the bind entries from the JSON database.
bool has_bind(uint16_t dev_addr_1, uint16_t dev_addr_2)
Check if bind exists.
uint16_t _next_address
The address the next registering device will be assigned.
Result
Commands result codes.
uint8_t bind(uint16_t dev_addr_1, uint16_t dev_addr_2)
Create a new bind entry.
Custom Bind Management class.
Top-level namespace for the HAN-FUN library.