Builder Class
class QKnxNetIpCriProxy::BuilderThe QKnxNetIpCriProxy::Builder class creates a KNXnet/IP connection request information structure (CRI). More...
Public Functions
QKnxNetIpCri | create() const |
Builder & | setAdditionalData(const QKnxByteArray &additionalData) |
Builder & | setConnectionType(QKnxNetIp::ConnectionType type) |
Builder & | setIndividualAddress(const QKnxAddress &address) |
Builder & | setTunnelLayer(QKnxNetIp::TunnelLayer layer) |
Detailed Description
The connection request information structure contains additional information needed for different types of communication channels to fulfill a connection request.
The common way to create such a CRI structure is:
auto cri = QKnxNetIpCriProxy::builder() .setConnectionType(QKnxNetIp::ConnectionType::Tunnel) .setTunnelLayer(QKnxNetIp::TunnelLayer::Link) .create();
Member Function Documentation
QKnxNetIpCri Builder::create() const
Creates and returns a QKnxNetIpCri structure.
Note: The returned structure may be invalid depending on the values used during setup.
See also isValid().
Builder &Builder::setAdditionalData(const QKnxByteArray &additionalData)
Sets the additional data to additionalData and returns a reference to the builder.
The current KNX specification foresees additional data only in the case of tunneling.
The common way to use the function is:
QKnxAddress ia { QKnxAddress::Type::Individual, 2013 }; auto cri = QKnxNetIpCriProxy::builder() .setConnectionType(QKnxNetIp::ConnectionType::Tunnel) .setAdditionalData(QKnxByteArray { quint8(QKnxNetIp::TunnelLayer::Link), // tunnel layer 0x00 // reserved byte } + ia.bytes() // address for extended connection request ).create();
The above code is equivalent to the more expressive one shown here:
auto cri = QKnxNetIpCriProxy::builder() .setConnectionType(QKnxNetIp::ConnectionType::Tunnel) .setTunnelLayer(QKnxNetIp::TunnelLayer::Link) .setIndividualAddress({ QKnxAddress::Type::Individual, 2013 }) .create();
See also setTunnelLayer() and setIndividualAddress().
Builder &Builder::setConnectionType(QKnxNetIp::ConnectionType type)
Sets the connection type to type and returns a reference to the builder.
Does nothing if type is not a QKnx::NetIp::ConnectionType.
Builder &Builder::setIndividualAddress(const QKnxAddress &address)
Sets the individual address of the extended connection request information to address and returns a reference to the builder.
Does nothing if address is not of type QKnxAddress::Type::Individual.
Note: The current KNX specification foresees setting an individual address only in the case of extended tunneling connection requests.
This function was introduced in Qt 5.12.
See also setTunnelLayer() and setAdditionalData().
Builder &Builder::setTunnelLayer(QKnxNetIp::TunnelLayer layer)
Sets the additional data to the requested KNX tunneling layer layer and returns a reference to the builder.
Does nothing if layer is not a QKnx::NetIp::TunnelLayer value.
See also setAdditionalData() and setIndividualAddress().
© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.