QKnxExtendedControlField Class

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

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

公共类型

class Builder
enum class ExtendedFrameFormat { Standard, Lte }

公共函数

QKnxExtendedControlField (const QKnxByteArray & data )
QKnxExtendedControlField (quint8 data )
QKnxExtendedControlField ()
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

静态公共成员

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

详细描述

A KNX frame contains several fields, one of which might be the extended control field. The extended control field must specify destinationAddressType (), hopCount (),和 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();
					

另请参阅 builder () 和 QKnxControlField .

成员类型文档编制

enum class QKnxExtendedControlField:: ExtendedFrameFormat

This enum type holds the extended frame format.

常量 描述
QKnxExtendedControlField::ExtendedFrameFormat::Standard 0x00 The frame has standard format.
QKnxExtendedControlField::ExtendedFrameFormat::Lte 0x01 The frame has Logical Tag Extended (LTE) format.

成员函数文档编制

QKnxExtendedControlField:: QKnxExtendedControlField (const QKnxByteArray & data )

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

注意: The byte array must contain at least one element.

QKnxExtendedControlField:: QKnxExtendedControlField ( quint8 data )

Creates a new extended control field from an 8-bit data 值。

QKnxExtendedControlField:: QKnxExtendedControlField ()

Creates an extended control field.

[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.

另请参阅 setDestinationAddressType ().

QKnxExtendedControlField::ExtendedFrameFormat QKnxExtendedControlField:: format () const

Returns the format of the extended control field.

另请参阅 setFormat ().

quint8 QKnxExtendedControlField:: hopCount () const

Returns the hop count.

另请参阅 setHopCount ().

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

Sets the destination address type to address .

另请参阅 destinationAddressType ().

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

Sets the format of the extended control field to format .

另请参阅 format ().

void QKnxExtendedControlField:: setHopCount ( quint8 hopCount )

Sets the hop count to hopCount .

另请参阅 hopCount ().

quint8 QKnxExtendedControlField:: size () const

Returns the number of bytes in the control field.

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

返回 true if this object and the given other 不相等;则返回 false .

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

返回 true if this object and the given other 相等;否则返回 false .

相关非成员

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

Writes the extended control field field debug stream.