39 #if HF_BATCH_PROGRAM_SUPPORT 43 #if HF_EVENT_SCHEDULING_SUPPORT 47 #if HF_WEEKLY_SCHEDULING_SUPPORT 229 template<
typename... ITF>
233 typename HF::Unit0<IUnit0, ITF...>::DeviceMgt>::value,
234 "DeviceMgt must be of type HF::Core::DeviceManagement::Client");
236 typedef std::tuple<ITF...> interfaces_t;
240 typedef typename _Parent::DeviceInfo DeviceInfo;
241 typedef typename _Parent::DeviceMgt DeviceMgt;
242 typedef typename _Parent::AttrReporting AttrReporting;
244 typedef typename _Parent::GroupTable GroupTable;
249 #if HF_BATCH_PROGRAM_SUPPORT 250 typedef typename _Parent::BatchProgram BatchProgram;
252 #if HF_EVENT_SCHEDULING_SUPPORT 253 typedef typename _Parent::EventScheduling EventScheduling;
255 #if HF_WEEKLY_SCHEDULING_SUPPORT 256 typedef typename _Parent::WeeklyScheduling WeeklyScheduling;
334 GroupTable *group_table()
336 return _Parent::group_table();
344 GroupTable *group_table()
const 346 return _Parent::group_table();
352 return _Parent::time();
357 return _Parent::time();
361 #if HF_BATCH_PROGRAM_SUPPORT 362 BatchProgram *batch_program()
364 return _Parent::batch_program();
367 BatchProgram *batch_program()
const 369 return _Parent::batch_program();
373 #if HF_EVENT_SCHEDULING_SUPPORT 374 EventScheduling *event_scheduling()
376 return _Parent::event_scheduling();
379 EventScheduling *event_scheduling()
const 381 return _Parent::event_scheduling();
385 #if HF_WEEKLY_SCHEDULING_SUPPORT 386 WeeklyScheduling *weekly_scheduling()
388 return _Parent::weekly_scheduling();
391 WeeklyScheduling *weekly_scheduling()
const 393 return _Parent::weekly_scheduling();
401 typedef Unit0<Core::DeviceInformation::Server,
402 Core::DeviceManagement::Client,
403 Core::AttributeReporting::Server
407 #if HF_BATCH_PROGRAM_SUPPORT 410 #if HF_EVENT_SCHEDULING_SUPPORT 413 #if HF_WEEKLY_SCHEDULING_SUPPORT 417 , Core::GroupTable::DefaultServer
424 template<
typename CoreServices = DefaultUnit0>
447 uint16_t offset) _override
458 return unit0()->device_management()->address();
461 CoreServices *
unit0() const _override
463 return const_cast<CoreServices *
>(&
_unit0);
501 typedef Abstract<> Node;
542 assert(_link !=
nullptr);
558 if ((_link ==
nullptr && this->link !=
nullptr) || (_link == this->
link))
562 this->link =
nullptr;
593 namespace Concentrator
667 template<
typename... ITF>
671 typename HF::Unit0<IUnit0, ITF...>::DeviceMgt>::value,
672 "DeviceMgt must be of type HF::Core::DeviceManagement::IServer");
676 typedef typename _Parent::DeviceInfo DeviceInfo;
677 typedef typename _Parent::DeviceMgt DeviceMgt;
678 typedef typename _Parent::AttrReporting AttrReporting;
680 typedef std::tuple<ITF...> interfaces_t;
683 typedef typename _Parent::GroupTable GroupTable;
686 static constexpr uint8_t GROUP_MGT = _Parent::GROUP_MGT;
688 typedef typename std::tuple_element<GROUP_MGT, interfaces_t>::type GroupMgt;
690 static_assert(std::is_base_of<HF::Core::GroupManagement::IServer, GroupMgt>::value,
691 "GroupMgt must be of type HF::Core::GroupManagement::IServer");
696 #if HF_BATCH_PROGRAM_SUPPORT 697 typedef typename _Parent::BatchProgram BatchProgram;
699 #if HF_EVENT_SCHEDULING_SUPPORT 700 typedef typename _Parent::EventScheduling EventScheduling;
702 #if HF_WEEKLY_SCHEDULING_SUPPORT 703 typedef typename _Parent::WeeklyScheduling WeeklyScheduling;
708 typedef typename std::tuple_element<BIND_MGT, interfaces_t>::type BindMgt;
710 static_assert(std::is_base_of<HF::Core::BindManagement::IServer, BindMgt>::value,
711 "BindMgt must be of type HF::Core::BindManagement::IServer");
722 BindMgt *bind_management()
const 724 return _Parent::template get<BindMgt, BIND_MGT>();
727 BindMgt *bind_management()
729 return _Parent::template get<BindMgt, BIND_MGT>();
732 DeviceInfo *device_info()
const 737 DeviceInfo *device_info()
742 AttrReporting *attribute_reporting()
const 747 AttrReporting *attribute_reporting()
753 GroupMgt *group_management()
const 755 return _Parent::template get<GroupMgt, GROUP_MGT>();
758 GroupMgt *group_management()
760 return _Parent::template get<GroupMgt, GROUP_MGT>();
763 GroupTable *group_table()
765 return _Parent::group_table();
768 GroupTable *group_table()
const 770 return _Parent::group_table();
777 return _Parent::time();
782 return _Parent::time();
785 #if HF_BATCH_PROGRAM_SUPPORT 786 BatchProgram *batch_program()
788 return _Parent::batch_program();
791 BatchProgram *batch_program()
const 793 return _Parent::batch_program();
796 #if HF_EVENT_SCHEDULING_SUPPORT 797 EventScheduling *event_scheduling()
799 return _Parent::event_scheduling();
802 EventScheduling *event_scheduling()
const 804 return _Parent::event_scheduling();
807 #if HF_WEEKLY_SCHEDULING_SUPPORT 808 WeeklyScheduling *weekly_scheduling()
810 return _Parent::weekly_scheduling();
813 WeeklyScheduling *weekly_scheduling()
const 815 return _Parent::weekly_scheduling();
824 typedef Unit0<Core::DeviceInformation::Server,
825 Core::DeviceManagement::DefaultServer,
826 Core::AttributeReporting::Server,
830 #if HF_BATCH_PROGRAM_SUPPORT 833 #if HF_EVENT_SCHEDULING_SUPPORT 836 #if HF_WEEKLY_SCHEDULING_SUPPORT 840 Core::GroupTable::DefaultServer,
841 Core::GroupManagement::DefaultServer,
843 Core::BindManagement::DefaultServer
878 Common::SimpleList<Transport::Link *>
_links;
905 template<
typename CoreServices = DefaultUnit0>
912 return const_cast<CoreServices *
>(&_unit0);
923 typedef Abstract<> Concentrator;
934 Common::SimpleList<HF::Transport::Link *>
links;
964 assert(link !=
nullptr);
966 links.push_front(link);
Interface of Unit 0 for Node devices.
This file contains the definitions for the Event Scheduling service.
IUnit0(HF::IDevice &device)
Constructor.
void connected(HF::Transport::Link *link)
Callback to report that a new transport link was been created to a remote device. ...
HF::Transport::Link * _link
Link to the be used when sending packets to the network.
This class provides support for generating a response when a response is required from an incoming me...
Unit0(IDevice &device)
Constructor.
virtual HF::Core::BindManagement::IServer * bind_management()=0
Return a pointer to unit 0 bind management service.
Server DefaultServer
Helper typedef.
This represent the special unit with ID/UID = 0.
DeviceMgt * device_management() const
Get the pointer to the node's Device Management service.
static constexpr uint8_t BIND_MGT
Group Management service index.
DeviceInfo * device_info() const
Device Information service.
This file contains the definitions for the Time service.
Parent class for transport layer implementations on a HAN-FUN Concentrator device.
This file contains the definitions for the Weekly Scheduling service.
Server< Entries< Day > > DefaultServer
Weekly Scheduling Service : Server side with default persistence implementation.
void add(HF::Transport::Endpoint *ep)
Register the given Endpoint to receive events.
virtual HF::Core::DeviceManagement::Client * device_management()=0
Get the pointer to the node's Device Management service.
DeviceInfo * device_info() const
Get the pointer to the node's Device Information service.
virtual HF::Core::DeviceManagement::IServer * device_management()=0
Return a pointer to unit 0 device management service.
Common::SimpleList< HF::Transport::Link * > links
List of links present in the transport layer.
bool is_registered()
Check if the device has a valid, i.e.
This file contains the common defines for the HAN-FUN library.
void connected(HF::Transport::Link *link) _override
Callback to report that a new transport link was been created to a remote device. ...
Units::IUnit * unit(uint8_t id) const
Return pointer to the unit with the given id.
This file contains the forward declarations of the core services and interfaces implementing classes...
AttrReporting * attribute_reporting() const
Attribute Reporting service.
Helper template class used to define custom Unit 0 for devices.
This interface represents a link on the transport layer, used to send data to the remote end-point...
HF::Transport::Link * link
Pointer to the link used to send packets to the network.
Server< Entries< Interval > > DefaultServer
Event Scheduling Service : Server side with default persistence implementation.
constexpr uint16_t BROADCAST_ADDR
HAN-FUN Broadcast - device address.
bool to_local(const Protocol::Packet &packet) const _override
Check if an incoming packet is for the node.
void add(HF::Transport::Endpoint *ep)
Add an entry to the list of end-points connected to the transport layer.
Device Management interface : Client side.
void send(Protocol::Packet &packet)
Send given packet into the HAN-FUN network.
This file contains the definitions for the HAN-FUN protocol messages.
Helper template to declare a Batch Program server with custom entries backend.
Unit0< Core::DeviceInformation::Server, Core::DeviceManagement::DefaultServer, Core::AttributeReporting::Server, Core::BindManagement::DefaultServer > DefaultUnit0
Unit0 using default classes to provide the core services.
Template to create Unit 0 for HAN-FUN node devices.
virtual bool to_local(const Protocol::Packet &packet) const
Check if the given packet is for this device.
void disconnected(HF::Transport::Link *link)
Call the disconnected method for all the registered end-points with the given link as argument...
This is the parent class for the HAN-FUN Concentrator devices implementation.
void add(Units::IUnit *unit)
Add unit to devices unit lists.
void receive(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
Callback to deliver a packet received from the transport layer.
void add(HF::Transport::Link *_link)
Add the given link to the list of known links and call the connected method for all registered end-po...
This file contains the definitions for the Group Management service.
uint16_t address() const _override
Return the device address on the HAN-FUN network, when the device is registered, or HF_BROADCAST_ADDR...
This class represents the interface common to all HAN-FUN devices.
DeviceInfo * device_info()
Get the pointer to the node's Device Information service.
virtual Transport::Link * link(uint16_t addr) const =0
Return the link that can be used to send a packet to the device with the given address.
DeviceMgt * device_management()
Get the pointer to the node's Device Management service.
Unit0< Core::DeviceInformation::Server, Core::DeviceManagement::Client, Core::AttributeReporting::Server > DefaultUnit0
Unit0 using default classes to provide the core services for node devices.
DeviceMgt * device_management() const
Device Management service.
IUnit0(HF::IDevice &device)
Constructor.
Address destination
Destination Address.
This file contains the definitions for the core Attribute Reporting Service in HAN-FUN.
virtual uint16_t address() const =0
Return the device address on the HAN-FUN network, when the device is registered, or HF_BROADCAST_ADDR...
void periodic(uint32_t time)
Handle periodic processing.
void receive(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
Callback to deliver a packet received from the transport layer.
HF::Transport::Link * find(uint16_t address)
Find the link used to send messages to the HAN-FUN device with the given address. ...
Common::SimpleList< Transport::Link * > _links
List of links present in this concentrator.
Unit 0 interface API for HAN-FUN Concentrators.
virtual Concentrator::IUnit0 * unit0() const =0
Get the unit 0 used by this concentrator device.
This file contains the definition of the transport layer API for the HAN-FUN common implementation...
uint16_t address() const
Return the device address on the HAN-FUN network, when the device is registered, or HF_BROADCAST_ADDR...
Parent class for transport layer implementations on a HAN-FUN Node.
void destroy()
Free the system resources associated with this transport layer.
Template for HAN-FUN concentrator devices.
void connected(HF::Transport::Link *link)
Call the connected method for all the registered end-points with the given link as argument...
IUnits _units
List containing pointers to the units present in the device.
This class represents a byte array.
AttrReporting * attribute_reporting() const
Get the pointer to the node's Attribute Reporting service.
void disconnected(HF::Transport::Link *link)
Callback to the report that the given transport link no longer is valid and MUST not be used to send ...
This file contains the definitions for the Batch Program Management interface.
CoreServices * unit0() const
Get the unit 0 used by this concentrator device.
Template to create Unit0 for HAN-FUN concentrator devices.
AttrReporting * attribute_reporting()
Get the pointer to the node's Attribute Reporting service.
Address source
Source Address.
This file contains the definitions for the core Bind Management Interface of the HAN-FUN protocol...
void remove(HF::Transport::Endpoint *ep=nullptr)
Remove the entry in ep, from the list of end-points connected to the transport layer.
CoreServices _unit0
Unit 0 implementation this device will use.
HAN-FUN device Unit 0 common API.
IDevice & device() const
Reference to the device this unit belongs to.
This file contains the definitions for the core Device Management Interface of the HAN-FUN protocol...
void add(HF::Transport::Endpoint *ep)
Register the given Endpoint to receive events.
bool from_remote(const Protocol::Packet &packet)
Check if the given packet is from the a remote device.
Bind Management interface : Server side API.
Time Service : Server side implementation.
HF::Transport::Link * link(uint16_t addr) const
Return the link that can be used to send a packet to the device with the given address.
void add(HF::Transport::Link *link)
Add the given link to the list of known links and call the connected method for all registered end-po...
This class represents the interface implemented by all HAN-FUN units.
Unit0(HF::IDevice &device)
Constructor.
uint16_t device
Device Address.
#define UNUSED(x)
Helper macro to remove warning about unused function/method argument.
void disconnected(HF::Transport::Link *link) _override
Callback to the report that the given transport link no longer is valid and MUST not be used to send ...
Parent class for all HF::Transport::Layer implementations.
CoreServices * unit0() const _override
Return pointer to the unit 0 for this device.
Time
This represents the type of time that is associated with a time measurement.
This class provides the basic implementation for the Device's interface.
const IUnits & units() const
Return the list of units registered in this device.
This file contains the declaration of the API for a HAN-FUN device.
Protocol::Filters::ResponseRequired response_filter
Support for generating missing responses for messages.
virtual void connected(Link *link)=0
Callback to report that a new transport link was been created to a remote device. ...
This file contains the definitions for the Group Table service.
virtual void route_packet(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
Route the given packet to the corresponding device.
bool from_local(const Protocol::Packet &packet) const
Check if the given packet is from the local device.
uint8_t next_reference
Last reference number used to send a packet.
Event Scheduling Service : Server side implementation.
Group Management Service : Server side implementation.
This is the interface used by the transport layer to signal events comming in from the network...
Device Management interface : Server side API.
void destroy()
Free the system resources associated with this transport layer.
Template for declaring HAN-FUN node devices.
Scheduling Service : Server side implementation.
HF::Transport::Link * find(uint16_t address)
Find the link used to send messages to the HAN-FUN device with the given address. ...
Bind Management service index.
void receive(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset) _override
Callback to deliver a packet received from the transport layer.
HF::Transport::Link * link(uint16_t addr) const _override
Return the link that can be used to send a packet to the device with the given address.
Top-level namespace for the HAN-FUN library.