libknx
Public Member Functions | List of all members
knx::group Class Reference

This class represents a KNX group address which might be either 3 compnent "a/b/c" or 2 component "a/b". More...

#include <group.hpp>

Public Member Functions

 group ()
 Sets group to 0/0/0 by default.
 
 group (std::string name)
 Assigns a group address by name. Sets default 0/0/0 if string is invalid. 2 component addresses may be used.
 
 group (uint8_t a, uint8_t b, uint8_t c)
 Binary assign a 3 component group address.
 
 group (uint8_t a, uint8_t b)
 Binary assign a 2 component group address.
 
std::string get_name ()
 
uint16_t get_binary ()
 
void set_by_number (uint16_t a, uint16_t b, uint16_t c)
 
void set_by_number (uint16_t a, uint16_t b)
 
void set_by_name (std::string name)
 
void set_by_binary_2 (uint16_t binary)
 
void set_by_binary_3 (uint16_t binary)
 
bool operator== (knx::group other)
 Comparison operator for rapid equality checks.
 

Detailed Description

This class represents a KNX group address which might be either 3 compnent "a/b/c" or 2 component "a/b".

Member Function Documentation

◆ get_binary()

uint16_t knx::group::get_binary ( )

Get the binary group address value as 16 bit int.

Returns
Binary representation of the group address.

◆ get_name()

std::string knx::group::get_name ( )

Gives the current set address as string.

Returns
The group address as string.

◆ set_by_binary_2()

void knx::group::set_by_binary_2 ( uint16_t  binary)

Sets the whole address from binary value guessing a 2 comonent address in the form "a/b".

Parameters
binaryThe address as 16 bit uint.

◆ set_by_binary_3()

void knx::group::set_by_binary_3 ( uint16_t  binary)

Sets the whole address from binary value guessing a 3 comonent address in the form "a/b/c".

Parameters
binaryThe address as 16 bit uint.

◆ set_by_name()

void knx::group::set_by_name ( std::string  name)

Set the address by name either as "1/2" or "1/2/3".

◆ set_by_number() [1/2]

void knx::group::set_by_number ( uint16_t  a,
uint16_t  b 
)

Set the address by a set of components in the form "a/b". If any value exceeds the range higer bits are ignored.

Parameters
aFirst component 5 bits (0-31).
bSecond component 11 bits (0-2047).

◆ set_by_number() [2/2]

void knx::group::set_by_number ( uint16_t  a,
uint16_t  b,
uint16_t  c 
)

Set the address by a set of components in the form "a/b/c". If any value exceeds the range higer bits are ignored.

Parameters
aFirst component 5 bits (0-31).
bSecond component 3 bits (0-7).
cThird component 8 bits (0-255).

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