QKnxNetIpTunnelingInfoDibProxy Class

The QKnxNetIpTunnelingInfoDibProxy class provides the means to read the maximum ADPU length supported by a KNXnet/IP tunneling interface and tunneling slot information from the generic QKnxNetIpDib class and to create a KNXnet/IP tunneling information block (DIB) structure. 更多...

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

该类在 Qt 5.12 引入。

公共类型

class Builder

公共函数

QKnxNetIpTunnelingInfoDibProxy (const QKnxNetIpDib & dib )
QKnxNetIp::DescriptionType descriptionType () const
bool isValid () const
quint16 maximumInterfaceApduLength () const
QVector<QKnxNetIpTunnelingSlotInfo> optionalSlotInfos () const
QKnxNetIpTunnelingSlotInfo tunnelingSlotInfo () const

静态公共成员

QKnxNetIpTunnelingInfoDibProxy::Builder builder ()

详细描述

If a KNXnet/IP server supports tunneling, it can send more detailed information about the supported tunnel connections. The tunneling slot info class can be used to represent this information. Usually it includes the individual addresses used for the connection once it has been established and whether the connection slot is available at all.

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

注意: When using QKnxNetIpTunnelingInfoDibProxy, 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 application layer protocol data unit (APDU) length and default tunneling slot information can be achieved like this:

auto dib = QKnxNetIpDib::fromBytes(...);
QKnxNetIpTunnelingInfoDibProxy proxy(dib);
if (!proxy.isValid())
    return;
quint16 apduLength = proxy.maximumInterfaceApduLength();
auto tunnelingSlotInfo = proxy.tunnelingSlotInfo(); // mandatory
					

另请参阅 builder (), QKnxNetIpTunnelingSlotInfo , Qt KNX Tunneling Classes ,和 Qt KNXnet/IP Connection Classes .

成员函数文档编制

QKnxNetIpTunnelingInfoDibProxy:: QKnxNetIpTunnelingInfoDibProxy (const QKnxNetIpDib & dib )

Constructs a proxy object with the specified KNXnet/IP DIB structure dib to read the maximum APDU length and tunneling slot information.

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

Returns a builder object to create a KNXnet/IP tunneling info DIB structure.

QKnxNetIp::DescriptionType QKnxNetIpTunnelingInfoDibProxy:: 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 .

bool QKnxNetIpTunnelingInfoDibProxy:: isValid () const

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

A KNXnet/IP tunneling information DIB structure is considered valid if it contains the maximum APDU length and at least one tunneling slot information object.

quint16 QKnxNetIpTunnelingInfoDibProxy:: maximumInterfaceApduLength () const

返回 maximum APDU length carried by this KNXnet/IP DIB structure.

注意: If the object passed during construction was invalid, the function returns a 默认构造值 which can be 0 .

另请参阅 isValid ().

QVector < QKnxNetIpTunnelingSlotInfo > QKnxNetIpTunnelingInfoDibProxy:: optionalSlotInfos () const

Returns a vector of QKnxNetIpTunnelingSlotInfo objects carried by this KNXnet/IP DIB structure if the object that was passed during construction was valid; otherwise returns an empty vector.

QKnxNetIpTunnelingSlotInfo QKnxNetIpTunnelingInfoDibProxy:: tunnelingSlotInfo () const

Returns the mandatory tunneling slot information carried by this KNXnet/IP DIB structure or a 默认构造值 in case of an error.