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 .
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. |
Creates a new extended control field from the first byte of the data byte array.
注意: The byte array must contain at least one element.
Creates a new extended control field from an 8-bit data 值。
Creates an extended control field.
[static]
QKnxExtendedControlField::Builder
QKnxExtendedControlField::
builder
()
Returns a builder to create a KNX extended control field object.
Returns the extended control field as a byte.
Returns the extended control field as a range of bytes.
Returns the destination address type.
另请参阅 setDestinationAddressType ().
Returns the format of the extended control field.
另请参阅 setFormat ().
Returns the hop count.
另请参阅 setHopCount ().
Sets the destination address type to address .
另请参阅 destinationAddressType ().
Sets the format of the extended control field to format .
另请参阅 format ().
Sets the hop count to hopCount .
另请参阅 hopCount ().
Returns the number of bytes in the control field.
返回
true
if this object and the given
other
不相等;则返回
false
.
返回
true
if this object and the given
other
相等;否则返回
false
.
Writes the extended control field field 到 debug stream.