![]() |
HAN-FUN API
1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
|
This class provides the basic implementation for the Device's interface. More...
#include <devices.h>
Public Member Functions | |
const IUnits & | units () const |
Return the list of units registered in this device. More... | |
void | add (Units::IUnit *unit) |
Add unit to devices unit lists. More... | |
void | remove (Units::IUnit *unit) |
Remove unit from device's unit list. More... | |
Units::IUnit * | unit (uint8_t id) const |
Return pointer to the unit with the given id. More... | |
void | send (Protocol::Packet &packet) |
Send given packet into the HAN-FUN network. More... | |
void | receive (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset) |
Callback to deliver a packet received from the transport layer. More... | |
void | periodic (uint32_t time) |
Handle periodic processing. More... | |
![]() | |
virtual uint16_t | address () const =0 |
Return the device address on the HAN-FUN network, when the device is registered, or HF_BROADCAST_ADDR otherwise. More... | |
virtual IUnit0 * | unit0 () const =0 |
Return pointer to the unit 0 for this device. More... | |
![]() | |
virtual void | connected (Link *link)=0 |
Callback to report that a new transport link was been created to a remote device. More... | |
virtual void | disconnected (Link *link)=0 |
Callback to the report that the given transport link no longer is valid and MUST not be used to send messages to the corresponding end-point. More... | |
Protected Member Functions | |
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. More... | |
virtual bool | to_local (const Protocol::Packet &packet) const |
Check if the given packet is for this device. More... | |
bool | from_local (const Protocol::Packet &packet) const |
Check if the given packet is from the local device. More... | |
bool | from_remote (const Protocol::Packet &packet) |
Check if the given packet is from the a remote device. More... | |
bool | is_registered () |
Check if the device has a valid, i.e. More... | |
Protected Attributes | |
uint8_t | next_reference |
Last reference number used to send a packet. | |
IUnits | _units |
List containing pointers to the units present in the device. | |
Protocol::Filters::ResponseRequired | response_filter |
Support for generating missing responses for messages. | |
This class provides the basic implementation for the Device's interface.
|
inlinevirtual |
Add unit to devices unit lists.
unit | pointer to the unit to add to the list. |
Implements HF::IDevice.
Definition at line 85 of file devices.h.
References _units, and unit().
|
inlineprotected |
Check if the given packet is from the local device.
[in] | packet | reference to the incoming packet. |
true | if the source is the local device; |
false | otherwise. |
Definition at line 152 of file devices.h.
References HF::IDevice::address(), HF::Protocol::Address::device, and HF::Protocol::Packet::source.
Referenced by from_remote().
|
inlineprotected |
Check if the given packet is from the a remote device.
[in] | packet | reference to the incoming packet. |
true | if the source is a remote device; |
false | otherwise. |
Definition at line 165 of file devices.h.
References from_local().
|
inlineprotected |
Check if the device has a valid, i.e.
not HF::Protocol::BROADCAST_ADDR.
Definition at line 175 of file devices.h.
References HF::IDevice::address(), and HF::Protocol::BROADCAST_ADDR.
|
protectedpure virtual |
Return the link that can be used to send a packet to the device with the given address.
[in] | addr | the address of the device to send the packet to. |
nullptr
otherwise; Implemented in HF::Devices::Concentrator::AbstractBase, HF::Devices::Node::Abstract< CoreServices >, HF::Devices::Node::Abstract< NodeUnit0 >, and HF::Devices::Node::Abstract< HF::Devices::Node::DefaultUnit0 >.
|
virtual |
Handle periodic processing.
[in] | time | current system clock value in seconds. |
Implements HF::IDevice.
Referenced by HF::Unit0< IUnit0, ITF... >::periodic().
|
virtual |
Callback to deliver a packet received from the transport layer.
[in] | packet | reference to the received packet. |
[in] | payload | reference a ByteArray containing the received data. |
[in] | offset | offset from where the received data starts on the payload byte array buffer. |
Implements HF::Transport::Endpoint.
Reimplemented in HF::Devices::Concentrator::AbstractBase, HF::Devices::Node::Abstract< CoreServices >, HF::Devices::Node::Abstract< NodeUnit0 >, HF::Devices::Node::Abstract< HF::Devices::Node::DefaultUnit0 >, Base, and Node.
|
inlinevirtual |
Remove unit from device's unit list.
unit | pointer to the unit to remove from the list. |
Implements HF::IDevice.
Definition at line 90 of file devices.h.
References _units, and unit().
|
virtual |
Send given packet
into the HAN-FUN network.
packet | reference to the packet to send to the network. |
Implements HF::IDevice.
Referenced by HF::Core::BindManagement::Client::send(), HF::Core::DeviceManagement::Client::send(), HF::Core::BindManagement::Server< Entries >::send(), and HF::Core::DeviceManagement::Server< Entries >::send().
|
inlineprotectedvirtual |
Check if the given packet is for this device.
[in] | packet | reference to the incoming packet. |
true | if the destination is the local device; |
false | otherwise. |
Reimplemented in HF::Devices::Node::Abstract< CoreServices >, HF::Devices::Node::Abstract< NodeUnit0 >, and HF::Devices::Node::Abstract< HF::Devices::Node::DefaultUnit0 >.
Definition at line 139 of file devices.h.
References HF::IDevice::address(), HF::Protocol::Packet::destination, and HF::Protocol::Address::device.
|
virtual |
Return pointer to the unit with the given id.
[in] | id | unit identifier. |
Implements HF::IDevice.
Referenced by add(), and remove().
|
inlinevirtual |
Return the list of units registered in this device.
Implements HF::IDevice.
Definition at line 80 of file devices.h.
References _units.