Builder Class

class QKnxNetIpConnectResponseProxy ::Builder

The QKnxNetIpConnectResponseProxy::Builder class provides the means to create a KNXnet/IP connection response frame. 更多...

公共函数

QKnxNetIpFrame create () const
Builder & setChannelId (quint8 channelId )
Builder & setDataEndpoint (const QKnxNetIpHpai & hpai )
Builder & setResponseData (const QKnxNetIpCrd & crd )
Builder & setStatus (QKnxNetIp::Error status )

详细描述

A KNXnet/IP connection response contains the status of the corresponding connection request. If the server accepted the request, the frame also contains an identifier and the host address protocol information (HPAI) of the data endpoint that the server prepared for the communication channel.

In most programs, this class will not be used directly. Instead, the QKnxNetIpTunnel or QKnxNetIpDeviceManagement class is used to establish a functional connection to a KNXnet/IP server.

The common way to create a connection response is:

QKnxNetIpHpai hpai;
QKnxNetIpCrdProxy data;
auto netIpFrame = QKnxNetIpConnectResponseProxy::builder()
    .setChannelId(200)
    .setStatus(QKnx::NetIp::Error::None)
    .setDataEndpoint(hpai)
    .setResponseData(data)
    .create();
					

成员函数文档编制

QKnxNetIpFrame Builder:: create () const

Creates and returns a KNXnet/IP connection response frame.

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

另请参阅 isValid ().

Builder &Builder:: setChannelId ( quint8 channelId )

Sets the ID of the communication channel prepared by the KNXnet/IP server to channelId and returns a reference to the builder.

Builder &Builder:: setDataEndpoint (const QKnxNetIpHpai & hpai )

Sets the data endpoint of the KNXnet/IP server to hpai and returns a reference to the builder.

Builder &Builder:: setResponseData (const QKnxNetIpCrd & crd )

Sets the connection response data (CRD) to crd and returns a reference to the builder.

Builder &Builder:: setStatus ( QKnxNetIp::Error status )

Sets the status of the connection request received from a KNXnet/IP client to status and returns a reference to the builder.