HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
HF::Core::DeviceManagement::IServer Struct Referenceabstract

Device Management interface : Server side API. More...

#include <device_management.h>

+ Inheritance diagram for HF::Core::DeviceManagement::IServer:
+ Collaboration diagram for HF::Core::DeviceManagement::IServer:

Public Member Functions

HF::Devices::Concentrator::IUnit0unit0 () const
 Return a reference to the unit that this service belongs to. More...
 
DevicePtr entry (uint16_t address) const
 Return the Device entry for the given address. More...
 
DevicePtr entry (const HF::UID::UID &uid) const
 Return the Device entry for the given UID. More...
 
virtual IEntriesentries () const =0
 Get a reference to the current object implementing the persistence API, for the device information. More...
 
virtual SessionManagement::IServersessions ()=0
 Reference to the session management API. More...
 
virtual uint16_t next_address ()
 Return next available address for registering a device. More...
 
Events
virtual void registered (DevicePtr &device)
 Indicate that a device has been registered. More...
 
virtual void deregistered (DevicePtr &device)
 Indicate that a device has been de-registered. More...
 
- Public Member Functions inherited from HF::Core::ServiceRole< Base, HF::Interface::SERVER_ROLE >
Interface::Role role () const
 Return the Interface::Role this interface implements. More...
 
- Public Member Functions inherited from Base
void receive (HF::Protocol::Packet &packet, HF::Common::ByteArray &payload, uint16_t offset)
 Callback to deliver a packet received from the transport layer. More...
 
bool has_bind (uint16_t dev_addr_1, uint16_t dev_addr_2)
 Check if bind exists. More...
 
uint8_t bind (uint16_t dev_addr_1, uint16_t dev_addr_2)
 Create a new bind entry. More...
 
bool unbind (uint16_t dev_addr_1, uint16_t dev_addr_2)
 Remove the binding entry for the given devices. More...
 
- Public Member Functions inherited from HF::Devices::Concentrator::Abstract< CoreServices >
CoreServices * unit0 () const
 Get the unit 0 used by this concentrator device. More...
 
- Public Member Functions inherited from HF::Devices::Concentrator::AbstractBase
uint16_t address () const
 Return the device address on the HAN-FUN network, when the device is registered, or HF_BROADCAST_ADDR otherwise. More...
 
void connected (HF::Transport::Link *link)
 Callback to report that a new transport link was been created to a remote device. More...
 
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 messages to the corresponding end-point. More...
 
- Public Member Functions inherited from HF::Devices::AbstractDevice
const IUnitsunits () 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::IUnitunit (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 periodic (uint32_t time)
 Handle periodic processing. More...
 
Events

Protected Member Functions

 IServer (Unit0 &unit)
 Constructor. More...
 
- Protected Member Functions inherited from HF::Core::ServiceRole< Base, HF::Interface::SERVER_ROLE >
 ServiceRole (Unit0 &unit)
 Constructor. More...
 
- Protected Member Functions inherited from HF::Devices::Concentrator::AbstractBase
HF::Transport::Linklink (uint16_t addr) const
 Return the link that can be used to send a packet to the device with the given address. More...
 
virtual void route_packet (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
 Route the given packet to the corresponding device. More...
 
- Protected Member Functions inherited from HF::Devices::AbstractDevice
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...
 

Additional Inherited Members

- Protected Attributes inherited from HF::Devices::Concentrator::AbstractBase
Common::SimpleList< Transport::Link * > _links
 List of links present in this concentrator.
 
- Protected Attributes inherited from HF::Devices::AbstractDevice
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.
 

Detailed Description

Device Management interface : Server side API.

Definition at line 558 of file device_management.h.

Constructor & Destructor Documentation

◆ IServer()

HF::Core::DeviceManagement::IServer::IServer ( Unit0 unit)
inlineprotected

Constructor.

Parameters
[in]unitreference to the unit containing this service.

Definition at line 679 of file device_management.h.

679  : ServiceRole(unit)
680  {}
Units::IUnit * unit(uint8_t id) const
Return pointer to the unit with the given id.

Member Function Documentation

◆ deregistered()

virtual void HF::Core::DeviceManagement::IServer::deregistered ( DevicePtr device)
inlinevirtual

Indicate that a device has been de-registered.

Parameters
[in]devicepointer to the device entry corresponding to the de-registered device.

Definition at line 664 of file device_management.h.

References UNUSED.

665  {
666  UNUSED(device);
667  }
#define UNUSED(x)
Helper macro to remove warning about unused function/method argument.

◆ entries()

virtual IEntries& HF::Core::DeviceManagement::IServer::entries ( ) const
pure virtual

Get a reference to the current object implementing the persistence API, for the device information.

Returns
reference to the current object for the persistence API.

Implemented in HF::Core::DeviceManagement::Server< _Entries >, and HF::Core::DeviceManagement::Server< Entries >.

Referenced by entry(), and next_address().

+ Here is the caller graph for this function:

◆ entry() [1/2]

DevicePtr HF::Core::DeviceManagement::IServer::entry ( uint16_t  address) const

Return the Device entry for the given address.

Parameters
[in]addressthe device address.
Return values
apointer the Device entry associated with the given address,
nullptrif the entry does not exist.

◆ entry() [2/2]

DevicePtr HF::Core::DeviceManagement::IServer::entry ( const HF::UID::UID uid) const
inline

Return the Device entry for the given UID.

Parameters
[in]uidthe device UID.
Return values
apointer the Device entry associated with the given UID,
nullptrif the entry does not exist.

Definition at line 594 of file device_management.h.

References entries(), and HF::Core::DeviceManagement::IEntries::find().

595  {
596  return entries().find(uid);
597  }
virtual IEntries & entries() const =0
Get a reference to the current object implementing the persistence API, for the device information...
virtual DevicePtr find(uint16_t address) const =0
Return the Device entry for the given address.
+ Here is the call graph for this function:

◆ next_address()

virtual uint16_t HF::Core::DeviceManagement::IServer::next_address ( )
inlinevirtual

Return next available address for registering a device.

Returns
the address to use in the next registration.

Reimplemented in DeviceManagement::Server.

Definition at line 636 of file device_management.h.

References entries(), and HF::Core::DeviceManagement::IEntries::next_address().

Referenced by DeviceManagement::Server::next_address().

637  {
638  return entries().next_address();
639  }
virtual uint16_t next_address() const =0
Return next available address for registering a device.
virtual IEntries & entries() const =0
Get a reference to the current object implementing the persistence API, for the device information...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registered()

virtual void HF::Core::DeviceManagement::IServer::registered ( DevicePtr device)
inlinevirtual

Indicate that a device has been registered.

Parameters
[in]devicepointer to the device entry corresponding to the registered device.

Definition at line 653 of file device_management.h.

References UNUSED.

654  {
655  UNUSED(device);
656  }
#define UNUSED(x)
Helper macro to remove warning about unused function/method argument.

◆ sessions()

virtual SessionManagement::IServer& HF::Core::DeviceManagement::IServer::sessions ( )
pure virtual

Reference to the session management API.

Returns
reference to the object implementing the session management API for this device management server.

Implemented in HF::Core::DeviceManagement::Server< _Entries >, and HF::Core::DeviceManagement::Server< Entries >.

◆ unit0()

HF::Devices::Concentrator::IUnit0& HF::Core::DeviceManagement::IServer::unit0 ( ) const
virtual

Return a reference to the unit that this service belongs to.

This is the same reference as AbstractService::unit, but static casted to allow access to the the other interfaces.

Returns
a reference to the unit that holds this interface.

Implements HF::Devices::Concentrator::AbstractBase.


The documentation for this struct was generated from the following file: