HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
HF::Core::DeviceManagement::Client Class Reference

Device Management interface : Client side. More...

#include <device_management.h>

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

Public Types

typedef SessionManagement::Client< DeviceSessionMgr
 Device HAN-FUN Address.
 

Public Member Functions

 Client (Unit0 &unit)
 Constructor. More...
 
virtual uint16_t address () const
 Return the address given by the HF Concentrator to the Device. More...
 
SessionMgrsession ()
 Reference to the session management API. More...
 
void send (const Protocol::Address &addr, Protocol::Message &message)
 Send message msg to the network address given by addr. More...
 
Commands
void register_device ()
 Send a register message.
 
void deregister (uint16_t address)
 Send a de-register message for the given address. More...
 
void deregister ()
 Send a de-register message for current address.
 
void start_session () const
 Start read entries session.
 
void get_entries (uint16_t offset, uint8_t count=0) const
 Read entries. More...
 
void end_session () const
 End read entries session.
 
Events
virtual void registered (RegisterResponse &response)
 This method is called when a response to a registration message is received. More...
 
virtual void deregistered (Protocol::Response &response)
 This method is called when a response to a de-registration message is received. More...
 
- Public Member Functions inherited from HF::Core::ServiceRole< Base, HF::Interface::CLIENT_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

Additional Inherited Members

- Protected Member Functions inherited from HF::Core::ServiceRole< Base, HF::Interface::CLIENT_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...
 
virtual void entries (const GetEntriesResponse< Device > &response)
 This event is called when a response to a get entries is received. More...
 
- Protected Member Functions inherited from HF::Core::SessionManagement::AbstractClient
Common::Result handle_command (CMD cmd, Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset=0)
 Handle command request/response messages. More...
 
uint16_t payload_size (CMD cmd) const
 Get the minimum number of bytes necessary to pack/unpack a message of the given command. More...
 
template<uint8_t _role, uint16_t _uid, uint8_t _member>
void get_entries (uint16_t offset, uint8_t count=0) const
 Helper method to send a message to read, count entries starting at offset from the server. More...
 
template<uint8_t _role, uint16_t _uid, uint8_t _member>
void request () const
 Helper method to create a session management request. More...
 
- 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 : Client side.

Definition at line 404 of file device_management.h.

Constructor & Destructor Documentation

◆ Client()

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

Constructor.

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

Definition at line 422 of file device_management.h.

422  :
423  Service(unit), SessionMgr(), _address(Protocol::BROADCAST_ADDR)
424  {}
SessionManagement::Client< Device > SessionMgr
Device HAN-FUN Address.
Units::IUnit * unit(uint8_t id) const
Return pointer to the unit with the given id.
constexpr uint16_t BROADCAST_ADDR
HAN-FUN Broadcast - device address.
Definition: protocol.h:45

Member Function Documentation

◆ address()

virtual uint16_t HF::Core::DeviceManagement::Client::address ( ) const
inlinevirtual

Return the address given by the HF Concentrator to the Device.

Returns
the device HAN-FUN address.

Implements HF::IDevice.

Definition at line 433 of file device_management.h.

434  {
435  return _address;
436  }

◆ deregister()

void HF::Core::DeviceManagement::Client::deregister ( uint16_t  address)

Send a de-register message for the given address.

Parameters
[in]addressthe address of the device to de-register.

◆ deregistered()

virtual void HF::Core::DeviceManagement::Client::deregistered ( Protocol::Response response)
virtual

This method is called when a response to a de-registration message is received.

Parameters
[in]responsethe response received.

◆ get_entries()

void HF::Core::DeviceManagement::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 494 of file device_management.h.

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

495  {
496  SessionMgr::get_entries<SERVER_ROLE, Interface::DEVICE_MANAGEMENT,
497  GET_ENTRIES_CMD>(offset, count);
498  }
Device Management interface UID.
Definition: interface.h:60

◆ registered()

virtual void HF::Core::DeviceManagement::Client::registered ( RegisterResponse response)
virtual

This method is called when a response to a registration message is received.

Parameters
[in]responsethe register response that was received.

◆ send()

void HF::Core::DeviceManagement::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 540 of file device_management.h.

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

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

◆ session()

SessionMgr& HF::Core::DeviceManagement::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 444 of file device_management.h.

445  {
446  return *this;
447  }

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