QKnxExtendedControlField Class

The QKnxExtendedControlField class represents an 8-bit extended KNX control field. More...

Header: #include <QKnxExtendedControlField>
qmake: QT += knx

Public Types

class Builder
enum ExtendedFrameFormat { Standard, Lte }

Public Functions

QKnxExtendedControlField()
QKnxExtendedControlField(quint8 data)
QKnxExtendedControlField(const QKnxByteArray &data)
quint8 byte() const
QKnxByteArray bytes() const
QKnxAddress::Type destinationAddressType() const
QKnxExtendedControlField::ExtendedFrameFormat format() const
quint8 hopCount() const
void setDestinationAddressType(QKnxAddress::Type address)
void setFormat(QKnxExtendedControlField::ExtendedFrameFormat format)
void setHopCount(quint8 hopCount)
quint8 size() const
bool operator!=(const QKnxExtendedControlField &other) const
bool operator==(const QKnxExtendedControlField &other) const

Static Public Members

QKnxExtendedControlField::Builder builder()
QDebug operator<<(QDebug debug, const QKnxExtendedControlField &field)

Detailed Description

The QKnxExtendedControlField class represents an 8-bit extended KNX control field.

A KNX frame contains several fields, one of which might be the extended control field. The extended control field must specify destinationAddressType(), hopCount(), and ExtendedFrameFormat.

The address type determines whether group addresses or individual addresses are used to establish a communication channel between devices.

The hop count specifies the number of subnetworks that the frame is allowed to pass. It prevents the endless circulation of messages in incorrectly configured installations.

The value of the ExtendedFrameFormat flag is mapped to the value of QKnxControlField::FrameFormat. If it is set to Extended, the extended frame format is used and the frame type is selected by the frame type parameter bit.

The following is an example of how to create a control field from a KNX byte array:

auto data = QKnxByteArray::fromHex("e0");
const QKnxExtendedControlField extCtrlField(data);

In addition to the default constructors a builder can be used:

auto extCtrl = QKnxExtendedControlField::builder()
    .setDestinationAddressType(QKnxAddress::Type::Group)
    .setHopCount(6)
    .setFormat(QKnxExtendedControlField::ExtendedFrameFormat::Standard)
    .create();

See also builder() and QKnxControlField.

Member Type Documentation

enum QKnxExtendedControlField::ExtendedFrameFormat

This enum type holds the extended frame format.

ConstantValueDescription
QKnxExtendedControlField::Standard0x00The frame has standard format.
QKnxExtendedControlField::Lte0x01The frame has Logical Tag Extended (LTE) format.

Member Function Documentation

QKnxExtendedControlField::QKnxExtendedControlField()

Creates an extended control field.

QKnxExtendedControlField::QKnxExtendedControlField(quint8 data)

Creates a new extended control field from an 8-bit data value.

QKnxExtendedControlField::QKnxExtendedControlField(const QKnxByteArray &data)

Creates a new extended control field from the first byte of the data byte array.

Note: The byte array must contain at least one element.

[static] QKnxExtendedControlField::Builder QKnxExtendedControlField::builder()

Returns a builder to create a KNX extended control field object.

quint8 QKnxExtendedControlField::byte() const

Returns the extended control field as a byte.

QKnxByteArray QKnxExtendedControlField::bytes() const

Returns the extended control field as a range of bytes.

QKnxAddress::Type QKnxExtendedControlField::destinationAddressType() const

Returns the destination address type.

See also setDestinationAddressType().

QKnxExtendedControlField::ExtendedFrameFormat QKnxExtendedControlField::format() const

Returns the format of the extended control field.

See also setFormat().

quint8 QKnxExtendedControlField::hopCount() const

Returns the hop count.

See also setHopCount().

void QKnxExtendedControlField::setDestinationAddressType(QKnxAddress::Type address)

Sets the destination address type to address.

See also destinationAddressType().

void QKnxExtendedControlField::setFormat(QKnxExtendedControlField::ExtendedFrameFormat format)

Sets the format of the extended control field to format.

See also format().

void QKnxExtendedControlField::setHopCount(quint8 hopCount)

Sets the hop count to hopCount.

See also hopCount().

quint8 QKnxExtendedControlField::size() const

Returns the number of bytes in the control field.

bool QKnxExtendedControlField::operator!=(const QKnxExtendedControlField &other) const

Returns true if this object and the given other are not equal; otherwise returns false.

bool QKnxExtendedControlField::operator==(const QKnxExtendedControlField &other) const

Returns true if this object and the given other are equal; otherwise returns false.

Related Non-Members

QDebug operator<<(QDebug debug, const QKnxExtendedControlField &field)

Writes the extended control field field to the debug stream.

© 2018 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.