QKnxNetIpExtendedDeviceDibProxy Class

The QKnxNetIpExtendedDeviceDibProxy class provides the means to read the extended device information of a KNXnet/IP device from the generic QKnxNetIpDib class and to create a KNXnet/IP extended device information block (DIB) structure. 更多...

头: #include <QKnxNetIpExtendedDeviceDibProxy>
qmake: QT += knx
Since: Qt 5.12

该类在 Qt 5.12 引入。

公共类型

class Builder

公共函数

QKnxNetIpExtendedDeviceDibProxy (const QKnxNetIpDib & dib )
QKnxNetIp::DescriptionType descriptionType () const
quint16 deviceDescriptorType0 () const
bool isValid () const
quint16 maximumLocalApduLength () const
QKnx::MediumStatus mediumStatus () const

静态公共成员

QKnxNetIpExtendedDeviceDibProxy::Builder builder ()

详细描述

A KNXnet/IP extended device information DIB structure contains specific information about a KNXnet/IP device, such as the KNX medium status, maximum local APDU length and the device descriptor type (mask version).

In most programs, this class will not be used directly. Instead, the QKnxNetIpServerDiscoveryAgent and QKnxNetIpServerInfo are provided.

注意: When using QKnxNetIpExtendedDeviceDibProxy, care must be taken to ensure that the referenced KNXnet/IP DIB structure outlives the proxy on all code paths, lest the proxy ends up referencing deleted data.

Reading the extended device information can be achieved like this:

auto dib = QKnxNetIpDib::fromBytes(...);
QKnxNetIpExtendedDeviceDibProxy proxy(dib);
if (!proxy.isValid())
    return;
auto mediumStatus = proxy.mediumStatus();
auto adpuLength = proxy.maximumLocalApduLength();
auto descriptorType = proxy.deviceDescriptorType0();
					

另请参阅 builder () 和 Qt KNXnet/IP Connection Classes .

成员函数文档编制

QKnxNetIpExtendedDeviceDibProxy:: QKnxNetIpExtendedDeviceDibProxy (const QKnxNetIpDib & dib )

Constructs a proxy object with the specified KNXnet/IP DIB structure dib to read the extended device information of a KNXnet/IP device.

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

Returns a builder object to create a KNXnet/IP device information DIB structure.

QKnxNetIp::DescriptionType QKnxNetIpExtendedDeviceDibProxy:: descriptionType () const

Returns the description type of this KNXnet/IP structure if the object that was passed during construction was valid; otherwise returns QKnx::NetIp::Unknown .

quint16 QKnxNetIpExtendedDeviceDibProxy:: deviceDescriptorType0 () const

返回 device descriptor type (mask version) carried by this KNXnet/IP DIB structure if the object that was passed during construction was valid; otherwise returns a 默认构造值 which can be 0 .

bool QKnxNetIpExtendedDeviceDibProxy:: isValid () const

返回 true if the KNXnet/IP structure to create the object is a valid KNXnet/IP DIB structure; otherwise returns false .

quint16 QKnxNetIpExtendedDeviceDibProxy:: maximumLocalApduLength () const

返回 maximum local APDU length carried by this KNXnet/IP DIB structure if the object that was passed during construction was valid; otherwise returns a 默认构造值 which can be 0 .

QKnx::MediumStatus QKnxNetIpExtendedDeviceDibProxy:: mediumStatus () const

Returns the medium status contained inside the KNXnet/IP DIB structure if the object that was passed during construction was valid; otherwise returns QKnx::Unknown .