Builder Class

class QKnxNetIpCriProxy ::Builder

The QKnxNetIpCriProxy::Builder class creates a KNXnet/IP connection request information structure (CRI). 更多...

公共函数

QKnxNetIpCri create () const
Builder & setAdditionalData (const QKnxByteArray & additionalData )
Builder & setConnectionType (QKnxNetIp::ConnectionType type )
Builder & setIndividualAddress (const QKnxAddress & address )
Builder & setTunnelLayer (QKnxNetIp::TunnelLayer layer )

详细描述

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();
					

成员函数文档编制

QKnxNetIpCri Builder:: create () const

创建并返回 QKnxNetIpCri 结构。

注意: The returned structure may be invalid depending on the values used during setup.

另请参阅 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();
					

另请参阅 setTunnelLayer () 和 setIndividualAddress ().

Builder &Builder:: setConnectionType ( QKnxNetIp::ConnectionType type )

Sets the connection type to type and returns a reference to the builder.

什么都不做若 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.

什么都不做若 address is not of type QKnxAddress::Type::Individual .

注意: The current KNX specification foresees setting an individual address only in the case of extended tunneling connection requests.

该函数在 Qt 5.12 引入。

另请参阅 setTunnelLayer () 和 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.

什么都不做若 layer is not a QKnx::NetIp::TunnelLayer 值。

另请参阅 setAdditionalData () 和 setIndividualAddress ().