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 implement the Bind Management service. More...

+ Collaboration diagram for Bind Management:

Data Structures

struct  HF::Core::BindManagement::Entry
 This represents a bind entry data structure. More...
 
struct  HF::Core::BindManagement::Message
 Add/Remove Bind message. More...
 
struct  HF::Core::BindManagement::IEntries
 Bind Management persistent storage API. More...
 
class  HF::Core::BindManagement::Base
 Parent class for the Bind Management interface implementation. More...
 
class  HF::Core::BindManagement::Client
 Bind Management interface : Client side. More...
 
struct  HF::Core::BindManagement::IServer
 Bind Management interface : Server side API. More...
 
struct  HF::Core::BindManagement::AbstractServer
 Parent class for bind management - server role. More...
 
struct  HF::Core::BindManagement::Entries
 Default implementation of the bind entries container. More...
 
struct  HF::Core::BindManagement::Server< _Entries >
 Helper class used to implement custom functionality to the bind management server side. More...
 

Enumerations

enum  HF::Core::BindManagement::CMD {
  HF::Core::BindManagement::ADD_BIND_CMD = 0x01, HF::Core::BindManagement::REMOVE_BIND_CMD = 0x02, HF::Core::BindManagement::START_SESSION_CMD = 0x03, HF::Core::BindManagement::END_SESSION_CMD = 0x04,
  HF::Core::BindManagement::GET_ENTRIES_CMD = 0x05
}
 Commands. More...
 
enum  HF::Core::BindManagement::Attributes { HF::Core::BindManagement::NUMBER_OF_ENTRIES_ATTR = 0x01 }
 Attributes. More...
 

Functions

HF::Attributes::IAttributeHF::Core::create_attribute (HF::Core::BindManagement::IServer *server, uint8_t uid)
 Create an attribute object that can hold the attribute with the given uid. More...
 
 HF::Core::BindManagement::Entry::Entry (Protocol::Address _source, Common::Interface _itf)
 Constructor. More...
 
 HF::Core::BindManagement::Entry::Entry (Protocol::Address _source, Common::Interface _itf, Protocol::Address _destination)
 Constructor. More...
 
uint16_t HF::Core::BindManagement::Entry::size () const
 Number bytes needed to serialize the message. More...
 
uint16_t HF::Core::BindManagement::Entry::pack (Common::ByteArray &array, uint16_t offset=0) const
 Write the object on to a ByteArray so it can be sent over the network. More...
 
uint16_t HF::Core::BindManagement::Entry::unpack (const Common::ByteArray &array, uint16_t offset=0)
 Read a message from a ByteArray. More...
 
virtual Common::Result HF::Core::BindManagement::IEntries::destroy (uint16_t address, Protocol::Address::Type type=Protocol::Address::DEVICE)=0
 Destroy the entries in the persistent storage, that refer to the the given address. More...
 
virtual EntryPtr HF::Core::BindManagement::IEntries::find (const Protocol::Address &source, const Common::Interface &itf, const Protocol::Address &destination) const =0
 Return the Bind entry for the given parameters. More...
 
virtual bool HF::Core::BindManagement::IEntries::any_of (Protocol::Address const &source, Common::Interface const &itf) const =0
 Check if entries for the device with given source address and for the given interface ifc exist. More...
 
virtual void HF::Core::BindManagement::IEntries::for_each (Protocol::Address const &source, Common::Interface const &itf, std::function< void(const Entry &)> func) const =0
 Call the given function for all the entries with given source address and for the given interface ifc. More...
 
HF::Attributes::IAttributeHF::Core::BindManagement::create_attribute (uint8_t uid)
 Create an attribute object that can hold the attribute with the given uid. (HF::Core::BindManagement::Server *,uint8_t) More...
 
 HF::Core::BindManagement::Base::Base (HF::Core::Unit0 &unit)
 Constructor. More...
 
 HF::Core::BindManagement::Client::Client (HF::Core::Unit0 &unit)
 Constructor. More...
 
SessionMgrHF::Core::BindManagement::Client::session ()
 Reference to the session management API. More...
 
void HF::Core::BindManagement::Client::send (const Protocol::Address &addr, Protocol::Message &message)
 Send message msg to the network address given by addr. More...
 
HF::Devices::Concentrator::IUnit0HF::Core::BindManagement::IServer::unit0 () const
 Return a reference to the unit that this service belongs to. More...
 
virtual IEntriesHF::Core::BindManagement::IServer::entries () const =0
 Reference to the persistent storage implementation. More...
 
virtual SessionManagement::IServerHF::Core::BindManagement::IServer::sessions ()=0
 Reference to the session management API. More...
 
 HF::Core::BindManagement::IServer::IServer (Unit0 &unit)
 Constructor. More...
 
Common::Result HF::Core::BindManagement::AbstractServer::add (const Protocol::Address &source, const Protocol::Address &destination, const Common::Interface &itf)
 Create a new bind entry in the database. More...
 
Common::Result HF::Core::BindManagement::AbstractServer::remove (const Protocol::Address &source, const Protocol::Address &destination, const Common::Interface &itf)
 Remove a bind entry from the database. More...
 
 HF::Core::BindManagement::AbstractServer::AbstractServer (Unit0 &unit)
 Constructor. More...
 
uint16_t HF::Core::BindManagement::Entries::size () const
 Return the number of entries in the container. More...
 
Common::Result HF::Core::BindManagement::Entries::destroy (const Entry &entry)
 Destroy the given entry in the persistent storage. More...
 
Common::Result HF::Core::BindManagement::Entries::destroy (uint16_t address, Protocol::Address::Type type=Protocol::Address::DEVICE)
 Destroy the entries in the persistent storage, that refer to the the given address. More...
 
EntryPtr HF::Core::BindManagement::Entries::find (const Protocol::Address &source, const Common::Interface &itf, const Protocol::Address &destination) const
 Return the Bind entry for the given parameters. More...
 
bool HF::Core::BindManagement::Entries::any_of (Protocol::Address const &source, Common::Interface const &itf) const
 Check if entries for the device with given source address and for the given interface ifc exist. More...
 
void HF::Core::BindManagement::Entries::for_each (Protocol::Address const &source, Common::Interface const &itf, std::function< void(const Entry &)> func) const
 Call the given function for all the entries with given source address and for the given interface ifc. More...
 
std::pair< iterator, iterator > HF::Core::BindManagement::Entries::find (Protocol::Address const &source, Common::Interface const &itf) const
 Return a pair of iterators for the entries that match the given search criteria. More...
 
template<typename Func >
Common::Result HF::Core::BindManagement::Entries::destroy (Func func)
 Destroy the entries in the persistent storage, for which the given predicate function returns true. More...
 
 HF::Core::BindManagement::Server< _Entries >::Server (Unit0 &unit)
 Constructor. More...
 
ContainerHF::Core::BindManagement::Server< _Entries >::entries () const
 Reference to the persistent storage implementation. More...
 
SessionMgrHF::Core::BindManagement::Server< _Entries >::sessions ()
 Reference to the session management API. More...
 
void HF::Core::BindManagement::Server< _Entries >::send (const Protocol::Address &addr, Protocol::Message &message)
 Send message msg to the network address given by addr. More...
 
std::ostream & operator<< (std::ostream &stream, const HF::Core::BindManagement::CMD command)
 Convert the given command into a string and write it to the given stream. More...
 
std::ostream & operator<< (std::ostream &stream, const HF::Core::BindManagement::Attributes attribute)
 Convert the given attribute into a string and write it to the given stream. More...
 

Variables

Protocol::Address HF::Core::BindManagement::Entry::source
 Source Address. More...
 
Protocol::Address HF::Core::BindManagement::Entry::destination
 Destination Address. More...
 
Common::Interface HF::Core::BindManagement::Entry::itf
 Destination Interface. More...
 
static constexpr uint16_t HF::Core::BindManagement::Entry::min_size
 Minimum pack/unpack required data size.
 
Container HF::Core::BindManagement::Entries::db
 Container for the bind entries.
 
_Entries HF::Core::BindManagement::Server< _Entries >::_entries
 Bind entries database. More...
 

Commands

void HF::Core::BindManagement::Client::add (const Protocol::Address &source, const Protocol::Address &destination, const Common::Interface &itf)
 Send a ADD_BIND command. More...
 
void HF::Core::BindManagement::Client::remove (const Protocol::Address &source, const Protocol::Address &destination, const Common::Interface &itf)
 Send a REMOVE_BIND command. More...
 
void HF::Core::BindManagement::Client::start_session () const
 Start read entries session.
 
void HF::Core::BindManagement::Client::get_entries (uint16_t offset, uint8_t count=0) const
 Read entries. More...
 
void HF::Core::BindManagement::Client::end_session () const
 End read entries session.
 

Events

virtual void HF::Core::BindManagement::Client::response (const CMD cmd, const Protocol::Response &response)
 This method is called when the response to a command is received. More...
 

Commands

virtual Common::Result HF::Core::BindManagement::IServer::add (const Protocol::Address &source, const Protocol::Address &destination, const Common::Interface &itf)=0
 Create a new bind entry in the database. More...
 
virtual Common::Result HF::Core::BindManagement::IServer::remove (const Protocol::Address &source, const Protocol::Address &destination, const Common::Interface &itf)=0
 Remove a bind entry from the database. More...
 

Detailed Description

This module contains the classes that implement the Bind Management service.

Enumeration Type Documentation

◆ Attributes

Attributes.

Enumerator
NUMBER_OF_ENTRIES_ATTR 

Number of entries attribute.

Definition at line 114 of file bind_management.h.

115  {
116  NUMBER_OF_ENTRIES_ATTR = 0x01,
117  __LAST_ATTR__ = NUMBER_OF_ENTRIES_ATTR
118  } Attributes;

◆ CMD

Commands.

Enumerator
ADD_BIND_CMD 

Add bind entry command.

REMOVE_BIND_CMD 

Remove bind entry command.

START_SESSION_CMD 

Start Session Read Registration Info.

END_SESSION_CMD 

End Session Read Registration Info.

GET_ENTRIES_CMD 

Get Entries Command.

Definition at line 103 of file bind_management.h.

104  {
105  ADD_BIND_CMD = 0x01,
106  REMOVE_BIND_CMD = 0x02,
107  START_SESSION_CMD = 0x03,
108  END_SESSION_CMD = 0x04,
109  GET_ENTRIES_CMD = 0x05,
110  __LAST_CMD__ = GET_ENTRIES_CMD
111  } CMD;
Start Session Read Registration Info.
End Session Read Registration Info.

Function Documentation

◆ AbstractServer()

HF::Core::BindManagement::AbstractServer::AbstractServer ( Unit0 unit)
inlineprotected

Constructor.

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

Definition at line 536 of file bind_management.h.

536  : IServer(unit)
537  {}
Units::IUnit * unit(uint8_t id) const
Return pointer to the unit with the given id.
IServer(Unit0 &unit)
Constructor.

◆ Base()

HF::Core::BindManagement::Base::Base ( HF::Core::Unit0 unit)
inlineprotected

Constructor.

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

Definition at line 276 of file bind_management.h.

276  :
277  Service(unit)
278  {}
Unit0 & unit() const
The device this unit is associated with.
Definition: core.h:142

◆ Client()

HF::Core::BindManagement::Client::Client ( HF::Core::Unit0 unit)
inline

Constructor.

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

Definition at line 298 of file bind_management.h.

298 : Service(unit), SessionMgr() {}
Units::IUnit * unit(uint8_t id) const
Return pointer to the unit with the given id.

◆ Entry() [1/2]

HF::Core::BindManagement::Entry::Entry ( Protocol::Address  _source,
Common::Interface  _itf 
)
inline

Constructor.

Parameters
[in]_sourcedevice source for the bind entry.
[in]_itfinterface UID + role for the bind entry.

Definition at line 140 of file bind_management.h.

140  :
141  source(_source), itf(_itf)
142  {}
Protocol::Address source
Source Address.
Common::Interface itf
Destination Interface.

◆ Entry() [2/2]

HF::Core::BindManagement::Entry::Entry ( Protocol::Address  _source,
Common::Interface  _itf,
Protocol::Address  _destination 
)
inline

Constructor.

Parameters
[in]_sourcedevice source for the bind entry.
[in]_itfinterface UID + role for the bind entry.
[in]_destinationdestination device for he bing entry.

Definition at line 151 of file bind_management.h.

152  :
153  source(_source), destination(_destination), itf(_itf)
154  {}
Protocol::Address source
Source Address.
Common::Interface itf
Destination Interface.
Protocol::Address destination
Destination Address.

◆ IServer()

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

Constructor.

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

Definition at line 489 of file bind_management.h.

489  :
490  ServiceRole<Base, HF::Interface::SERVER_ROLE>(unit)
491  {}
Units::IUnit * unit(uint8_t id) const
Return pointer to the unit with the given id.

◆ Server()

template<typename _Entries = BindManagement::Entries>
HF::Core::BindManagement::Server< _Entries >::Server ( Unit0 unit)
inline

Constructor.

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

Definition at line 665 of file bind_management.h.

665 : AbstractServer(unit), SessionMgr() {}
Units::IUnit * unit(uint8_t id) const
Return pointer to the unit with the given id.

◆ add() [1/3]

void HF::Core::BindManagement::Client::add ( const Protocol::Address source,
const Protocol::Address destination,
const Common::Interface itf 
)

Send a ADD_BIND command.

Parameters
[in]sourcethe HAN-FUN source device.
[in]destinationthe HAN-FUN destination device.
[in]itfthe interface to bind between source and destination.

◆ add() [2/3]

virtual Common::Result HF::Core::BindManagement::IServer::add ( const Protocol::Address source,
const Protocol::Address destination,
const Common::Interface itf 
)
pure virtual

Create a new bind entry in the database.

Parameters
[in]sourcethe HAN-FUN source device.
[in]destinationthe HAN-FUN destination device.
[in]itfthe interface to bind between source and destination.
Returns
Common::Result::OK if the bind was created or Result::FAIL_* otherwise.

Implemented in HF::Core::BindManagement::AbstractServer.

◆ add() [3/3]

Common::Result HF::Core::BindManagement::AbstractServer::add ( const Protocol::Address source,
const Protocol::Address destination,
const Common::Interface itf 
)
virtual

Create a new bind entry in the database.

Parameters
[in]sourcethe HAN-FUN source device.
[in]destinationthe HAN-FUN destination device.
[in]itfthe interface to bind between source and destination.
Returns
Common::Result::OK if the bind was created or Result::FAIL_* otherwise.

Implements HF::Core::BindManagement::IServer.

◆ any_of() [1/2]

virtual bool HF::Core::BindManagement::IEntries::any_of ( Protocol::Address const &  source,
Common::Interface const &  itf 
) const
pure virtual

Check if entries for the device with given source address and for the given interface ifc exist.

Parameters
[in]sourcedevice address to search for.
[in]itfinterface id to search for.
Return values
trueif entries exist,
falseotherwise.

Implemented in HF::Core::BindManagement::Entries.

◆ any_of() [2/2]

bool HF::Core::BindManagement::Entries::any_of ( Protocol::Address const &  source,
Common::Interface const &  itf 
) const
virtual

Check if entries for the device with given source address and for the given interface ifc exist.

Parameters
[in]sourcedevice address to search for.
[in]itfinterface id to search for.
Return values
trueif entries exist,
falseotherwise.

Implements HF::Core::BindManagement::IEntries.

◆ create_attribute() [1/2]

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

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

See also
HF::Core::create_attribute (HF::Core::BindManagement::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::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::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...

◆ destroy() [1/4]

virtual Common::Result HF::Core::BindManagement::IEntries::destroy ( uint16_t  address,
Protocol::Address::Type  type = Protocol::Address::DEVICE 
)
pure virtual

Destroy the entries in the persistent storage, that refer to the the given address.

This method destroys the entries that refer to the address both in the source and in the destination address.

Parameters
[in]addressHF address to remove entries for.
[in]typeHF address type.
Return values
Common::Result::OKand a copy of the destroyed entry if the entry was destroyed.
Common::Result::FAIL_ARGand nullptr otherwise.

Implemented in HF::Core::BindManagement::Entries.

◆ destroy() [2/4]

Common::Result HF::Core::BindManagement::Entries::destroy ( const Entry entry)

Destroy the given entry in the persistent storage.

Parameters
[in]entryreference to the entry to erase.
Return values
Common::Result::OK,ifthe entry was destroyed.
Common::Result::FAIL_ARGotherwise.
Warning
the reference passed into this method SHOULD NOT be considered valid if it was obtained by calling the find method.

Referenced by HF::Core::BindManagement::Entries::destroy().

+ Here is the caller graph for this function:

◆ destroy() [3/4]

Common::Result HF::Core::BindManagement::Entries::destroy ( uint16_t  address,
Protocol::Address::Type  type = Protocol::Address::DEVICE 
)
virtual

Destroy the entries in the persistent storage, that refer to the the given address.

This method destroys the entries that refer to the address both in the source and in the destination address.

Parameters
[in]addressHF address to remove entries for.
[in]typeHF address type.
Return values
Common::Result::OKand a copy of the destroyed entry if the entry was destroyed.
Common::Result::FAIL_ARGand nullptr otherwise.

Implements HF::Core::BindManagement::IEntries.

◆ destroy() [4/4]

template<typename Func >
Common::Result HF::Core::BindManagement::Entries::destroy ( Func  func)
inline

Destroy the entries in the persistent storage, for which the given predicate function returns true.

Parameters
[in]funcpredicate to call for each entry to check if it should be deleted.
Return values
Common::Result::OKif at least one entry was destroyed.
Common::Result::FAIL_ARG,otherwise.

Definition at line 623 of file bind_management.h.

References HF::Core::BindManagement::Entries::db, HF::Core::BindManagement::Entries::destroy(), HF::Common::FAIL_ARG, and HF::Common::OK.

624  {
626 
627  for (iterator itr = db.begin(); itr != db.end();)
628  {
629  if (func(*itr))
630  {
631  auto old = itr++;
632  destroy(*old);
633  result = Common::Result::OK;
634  }
635  else
636  {
637  ++itr;
638  }
639  }
640 
641  return result;
642  }
Common::Result destroy(const Entry &entry)
Destroy the given entry in the persistent storage.
Container db
Container for the bind entries.
Fail - Invalid Argument.
Result
Commands result codes.
+ Here is the call graph for this function:

◆ entries() [1/2]

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

Reference to the persistent storage implementation.

Returns
reference to the object responsible by the persistent storage of the bind entries.

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

◆ entries() [2/2]

template<typename _Entries = BindManagement::Entries>
Container& HF::Core::BindManagement::Server< _Entries >::entries ( ) const
inlinevirtual

Reference to the persistent storage implementation.

Returns
reference to the object responsible by the persistent storage of the bind entries.

Implements HF::Core::BindManagement::IServer.

Definition at line 670 of file bind_management.h.

671  {
672  return SessionMgr::entries();
673  }
Container & entries() const
Return the container for the service entries.

◆ find() [1/3]

virtual EntryPtr HF::Core::BindManagement::IEntries::find ( const Protocol::Address source,
const Common::Interface itf,
const Protocol::Address destination 
) const
pure virtual

Return the Bind entry for the given parameters.

Parameters
[in]sourcesource address of the device.
[in]destinationdestination address of the device.
[in]itfinterface to bind.
Return values
apointer to bind entry for the given parameters,
nullptrif bind entry does not exist.

Implemented in HF::Core::BindManagement::Entries.

◆ find() [2/3]

EntryPtr HF::Core::BindManagement::Entries::find ( const Protocol::Address source,
const Common::Interface itf,
const Protocol::Address destination 
) const
virtual

Return the Bind entry for the given parameters.

Parameters
[in]sourcesource address of the device.
[in]destinationdestination address of the device.
[in]itfinterface to bind.
Return values
apointer to bind entry for the given parameters,
nullptrif bind entry does not exist.

Implements HF::Core::BindManagement::IEntries.

◆ find() [3/3]

std::pair<iterator, iterator> HF::Core::BindManagement::Entries::find ( Protocol::Address const &  source,
Common::Interface const &  itf 
) const

Return a pair of iterators for the entries that match the given search criteria.

Parameters
[in]sourcedevice address to search for.
[in]itfinterface id to search for.
Returns
iterators to the entries found.

◆ for_each() [1/2]

virtual void HF::Core::BindManagement::IEntries::for_each ( Protocol::Address const &  source,
Common::Interface const &  itf,
std::function< void(const Entry &)>  func 
) const
pure virtual

Call the given function for all the entries with given source address and for the given interface ifc.

Parameters
[in]sourcedevice address to search for.
[in]itfinterface id to search for.
[in]funcfunction to call for all the entries.

Implemented in HF::Core::BindManagement::Entries.

◆ for_each() [2/2]

void HF::Core::BindManagement::Entries::for_each ( Protocol::Address const &  source,
Common::Interface const &  itf,
std::function< void(const Entry &)>  func 
) const
virtual

Call the given function for all the entries with given source address and for the given interface ifc.

Parameters
[in]sourcedevice address to search for.
[in]itfinterface id to search for.
[in]funcfunction to call for all the entries.

Implements HF::Core::BindManagement::IEntries.

◆ get_entries()

void HF::Core::BindManagement::Client::get_entries ( uint16_t  offset,
uint8_t  count = 0 
) const
inlinevirtual

Read entries.

Parameters
[in]offsetstart read at offset.
[in]countnumber of entries to read.

Implements HF::Core::SessionManagement::AbstractClient.

Definition at line 358 of file bind_management.h.

References HF::Interface::DEVICE_MANAGEMENT, and HF::Core::BindManagement::GET_ENTRIES_CMD.

359  {
360  SessionMgr::get_entries<SERVER_ROLE, Interface::DEVICE_MANAGEMENT,
361  GET_ENTRIES_CMD>(offset, count);
362  }
Device Management interface UID.
Definition: interface.h:60

◆ operator<<() [1/2]

std::ostream& operator<< ( std::ostream &  stream,
const HF::Core::BindManagement::CMD  command 
)

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

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

◆ operator<<() [2/2]

std::ostream& operator<< ( std::ostream &  stream,
const HF::Core::BindManagement::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
stream

◆ pack()

uint16_t HF::Core::BindManagement::Entry::pack ( Common::ByteArray array,
uint16_t  offset = 0 
) const

Write the object on to a ByteArray so it can be sent over the network.

The buffer passed in MUST have enough size to hold the serialized object, e.g.,

Serializable obj;
ByteArray payload(obj.size());
obj.pack(payload);
Parameters
[in,out]arrayByteArray reference to write the object to.
[in]offsetoffset to start writing to.
Returns
the number of bytes written.

◆ remove() [1/3]

void HF::Core::BindManagement::Client::remove ( const Protocol::Address source,
const Protocol::Address destination,
const Common::Interface itf 
)

Send a REMOVE_BIND command.

Parameters
[in]sourcethe HAN-FUN source device.
[in]destinationthe HAN-FUN destination device.
[in]itfthe interface to unbind between source and destination.

◆ remove() [2/3]

virtual Common::Result HF::Core::BindManagement::IServer::remove ( const Protocol::Address source,
const Protocol::Address destination,
const Common::Interface itf 
)
pure virtual

Remove a bind entry from the database.

Parameters
[in]sourcethe HAN-FUN source device.
[in]destinationthe HAN-FUN destination device.
[in]itfthe interface to bind between source and destination.
Returns
Common::Result::OK if the bind was removed or Result::FAIL_* otherwise.

Implemented in HF::Core::BindManagement::AbstractServer.

◆ remove() [3/3]

Common::Result HF::Core::BindManagement::AbstractServer::remove ( const Protocol::Address source,
const Protocol::Address destination,
const Common::Interface itf 
)
virtual

Remove a bind entry from the database.

Parameters
[in]sourcethe HAN-FUN source device.
[in]destinationthe HAN-FUN destination device.
[in]itfthe interface to bind between source and destination.
Returns
Common::Result::OK if the bind was removed or Result::FAIL_* otherwise.

Implements HF::Core::BindManagement::IServer.

◆ response()

virtual void HF::Core::BindManagement::Client::response ( const CMD  cmd,
const Protocol::Response response 
)
virtual

This method is called when the response to a command is received.

Parameters
[in]cmdthe command that response refers to.
[in]responsethe result of the command.

◆ send() [1/2]

void HF::Core::BindManagement::Client::send ( const Protocol::Address addr,
Protocol::Message message 
)
inlinevirtual

Send message msg to the network address given by addr.

Parameters
[in]addrHF network address.
[in]messagepointer to the message to be sent to the network.

Implements HF::Core::SessionManagement::AbstractClient.

Definition at line 395 of file bind_management.h.

References HF::Devices::AbstractDevice::send().

396  {
397  Service::send(addr, message);
398  }
void send(Protocol::Packet &packet)
Send given packet into the HAN-FUN network.
+ Here is the call graph for this function:

◆ send() [2/2]

template<typename _Entries = BindManagement::Entries>
void HF::Core::BindManagement::Server< _Entries >::send ( const Protocol::Address addr,
Protocol::Message message 
)
inlinevirtual

Send message msg to the network address given by addr.

Parameters
[in]addrHF network address.
[in]messagepointer to the message to be sent to the network.

Implements HF::Core::SessionManagement::AbstractServer.

Definition at line 682 of file bind_management.h.

683  {
684  AbstractServer::send(addr, message);
685  }
void send(Protocol::Packet &packet)
Send given packet into the HAN-FUN network.

◆ session()

SessionMgr& HF::Core::BindManagement::Client::session ( )
inline

Reference to the session management API.

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

Definition at line 308 of file bind_management.h.

309  {
310  return *this;
311  }

◆ sessions() [1/2]

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

Reference to the session management API.

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

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

◆ sessions() [2/2]

template<typename _Entries = BindManagement::Entries>
SessionMgr& HF::Core::BindManagement::Server< _Entries >::sessions ( )
inlinevirtual

Reference to the session management API.

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

Implements HF::Core::BindManagement::IServer.

Definition at line 675 of file bind_management.h.

676  {
677  return *this;
678  }

◆ size() [1/2]

uint16_t HF::Core::BindManagement::Entry::size ( ) const

Number bytes needed to serialize the message.

Returns
number of bytes the message requires to be serialized.

◆ size() [2/2]

uint16_t HF::Core::BindManagement::Entries::size ( ) const
virtual

Return the number of entries in the container.

Returns
the number of entries in the container.

Implements HF::Common::IEntries< Entry >.

◆ unit0()

HF::Devices::Concentrator::IUnit0& HF::Core::BindManagement::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.

◆ unpack()

uint16_t HF::Core::BindManagement::Entry::unpack ( const Common::ByteArray array,
uint16_t  offset = 0 
)

Read a message from a ByteArray.

Parameters
[in]arrayByteArray reference to read the message from.
[in]offsetoffset to start reading from.
Returns
the number of bytes read.

Variable Documentation

◆ _entries

template<typename _Entries = BindManagement::Entries>
_Entries HF::Core::BindManagement::Server< _Entries >::_entries
protected

Bind entries database.

Definition at line 689 of file bind_management.h.

◆ destination

Protocol::Address HF::Core::BindManagement::Entry::destination

Destination Address.

Definition at line 127 of file bind_management.h.

◆ itf

Common::Interface HF::Core::BindManagement::Entry::itf

Destination Interface.

Definition at line 129 of file bind_management.h.

◆ source

Protocol::Address HF::Core::BindManagement::Entry::source

Source Address.

Definition at line 125 of file bind_management.h.