HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
Protocol

This module contains the classes that define and implement the Protocol API. More...

+ Collaboration diagram for Protocol:

Modules

 Attributes
 This module contains the classes that define and implement the common API for handling attributes.
 
 Filters
 This module contains the filters used in the Protocol API implementation.
 

Data Structures

struct  HF::Protocol::Message
 Network Message. More...
 
struct  HF::Protocol::Address
 Network Address. More...
 
struct  HF::Protocol::Packet
 HAN-FUN Protocol Packet. More...
 
struct  HF::Protocol::Response
 Parent class for the response messages. More...
 

Functions

bool HF::Protocol::request (Message::Type type, bool response=false)
 Check if message type is a request. More...
 
bool HF::Protocol::response (Message::Type type)
 Check if message is a response. More...
 
bool HF::Protocol::matches (Message::Type lhs, Message::Type rhs)
 Check if the given message types are the request and response for each other, for example, the Message::Type::COMMAND_RES matches both the Message::Type::COMMAND_REQ and Message::Type::COMMAND_RESP_REQ. More...
 
std::ostream & operator<< (std::ostream &stream, const HF::Protocol::Message::Type type)
 Convert the given message type into a string and write it to the given stream. More...
 
std::ostream & operator<< (std::ostream &stream, const HF::Protocol::Message &message)
 Convert the given message into a string and write it to the given stream. More...
 
std::ostream & operator<< (std::ostream &stream, const HF::Protocol::Address &address)
 Convert the given address into a string and write it to the given stream. More...
 
std::ostream & operator<< (std::ostream &stream, const HF::Protocol::Packet &packet)
 Convert the given packet into a string and write it to the given stream. More...
 

Variables

constexpr uint16_t HF::Protocol::BROADCAST_ADDR = 0x7FFF
 HAN-FUN Broadcast - device address.
 
constexpr uint8_t HF::Protocol::BROADCAST_UNIT = 0xFF
 HAN-FUN Broadcast - unit address.
 
constexpr uint16_t HF::Protocol::MAX_PAYLOAD = 0x01FF
 HAN-FUN Network - Maximum application payload length.
 

Detailed Description

This module contains the classes that define and implement the Protocol API.

Function Documentation

◆ matches()

bool HF::Protocol::matches ( Message::Type  lhs,
Message::Type  rhs 
)

Check if the given message types are the request and response for each other, for example, the Message::Type::COMMAND_RES matches both the Message::Type::COMMAND_REQ and Message::Type::COMMAND_RESP_REQ.

Parameters
[in]lhsmessage type to match.
[in]rhsmessage type to match.
Return values
trueif the message types match.
falseotherwise.

◆ operator<<() [1/4]

std::ostream& operator<< ( std::ostream &  stream,
const HF::Protocol::Message::Type  type 
)

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

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

◆ operator<<() [2/4]

std::ostream& operator<< ( std::ostream &  stream,
const HF::Protocol::Message message 
)

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

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

◆ operator<<() [3/4]

std::ostream& operator<< ( std::ostream &  stream,
const HF::Protocol::Address address 
)

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

Parameters
[in]streamout stream to write the string to.
[in]addressHAN-FUN address to convert to a string.
Returns
stream

◆ operator<<() [4/4]

std::ostream& operator<< ( std::ostream &  stream,
const HF::Protocol::Packet packet 
)

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

Parameters
[in]streamout stream to write the string to.
[in]packetHAN-FUN packet to convert to a string.
Returns
stream

◆ request()

bool HF::Protocol::request ( Message::Type  type,
bool  response = false 
)

Check if message type is a request.

If response is false then return true for all requests, otherwise only for those that require a response.

Parameters
[in]typemessage type to check if it is a request.
[in]responsefalse check for all request types, otherwise only those that require a response.
Return values
trueif the message is a request.
falseotherwise.

Referenced by HF::Core::BatchProgramManagement::Client::define_program().

+ Here is the caller graph for this function:

◆ response()

bool HF::Protocol::response ( Message::Type  type)

Check if message is a response.

Parameters
[in]typemessage type to check if it is a response.
Return values
trueif the message is a response.
falseotherwise.

Referenced by HF::Core::AttributeReporting::Client::added(), HF::Core::AttributeReporting::Client::created(), HF::Core::AttributeReporting::Client::deleted(), HF::Core::SessionManagement::Server< Entries >::entries(), HF::Core::SessionManagement::Client< Device >::entries(), and HF::Core::AttributeReporting::Client::updated().

+ Here is the caller graph for this function: