The QKnxNetIpCriProxy class provides the means to read the connection request information (CRI) from the generic QKnxNetIpCri class and to create a KNXnet/IP CRI structure based on the information. 更多...
头: | #include <QKnxNetIpCriProxy> |
qmake: | QT += knx |
class | Builder |
QKnxNetIpCriProxy (const QKnxNetIpCri & cri ) | |
QKnxByteArray | additionalData () const |
QKnxNetIp::ConnectionType | connectionType () const |
QKnxAddress | individualAddress () const |
bool | isExtended () const |
bool | isValid () const |
QKnxNetIp::TunnelLayer | tunnelLayer () const |
QKnxNetIpCriProxy::Builder | builder () |
A KNXnet/IP CRI structure contains additional information needed for different types of communication channels to fulfill a connection request.
The structure may contain host protocol dependent and independent data, but the current KNX specification foresees additional data only in the case of tunneling.
注意: When using QKnxNetIpCriProxy, care must be taken to ensure that the referenced KNXnet/IP CRI structure outlives the proxy on all code paths, lest the proxy ends up referencing deleted data.
Reading the connection type and tunneling layer can be achieved like this:
auto cri = QKnxNetIpCri::fromBytes(...); QKnxNetIpCriProxy proxy(cri); if (!proxy.isValid()) return; if (proxy.connectionType() != QKnxNetIp::ConnectionType::Tunnel) return; auto layer = proxy.tunnelLayer(); // read the requested tunneling layer
另请参阅 builder () 和 Qt KNXnet/IP Connection Classes .
Constructs a proxy object with the specified a KNXnet/IP structure cri to read the connection request information (CRI).
Returns the additional data of this KNXnet/IP structure.
The current KNX specification foresees additional data only in the case of tunneling.
另请参阅 tunnelLayer () 和 individualAddress ().
[static]
QKnxNetIpCriProxy::Builder
QKnxNetIpCriProxy::
builder
()
Returns a builder object to create a KNXnet/IP connection request information structure.
Returns the connection type of this KNXnet/IP structure if the object that was passed during construction was valid; otherwise returns QKnx::NetIp::Unknown .
Returns the individual address of the extended connection request information structure if the object that was passed during construction was valid and an extended structure; otherwise returns QKnx::NetIp::Unknown .
该函数在 Qt 5.12 引入。
另请参阅 isExtended (), tunnelLayer (),和 additionalData ().
返回
true
if this is an extended connection request information (CRI) frame; otherwise returns
false
.
注意: No validation checks are performed on the given KNXnet/IP frame that was passed during construction.
该函数在 Qt 5.12 引入。
另请参阅 isValid ().
返回
true
if the KNXnet/IP structure to create the object is a valid KNXnet/IP CRI structure; otherwise returns
false
.
Returns the tunneling layer of this KNXnet/IP structure if the object that was passed during construction was valid and the connection type is QKnx::NetIp::Tunnel ,否则返回 QKnx::NetIp::Unknown .
另请参阅 additionalData () 和 individualAddress ().