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 .
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.
Returns the description type of this KNXnet/IP structure if the object that was passed during construction was valid; otherwise returns QKnx::NetIp::Unknown .
返回
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.
返回 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 ().
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.
Returns the mandatory tunneling slot information carried by this KNXnet/IP DIB structure or a 默认构造值 in case of an error.