Builder Class
class QKnxNetIpDisconnectRequestProxy::BuilderThe QKnxNetIpDisconnectRequestProxy::Builder class provides the means to read a KNXnet/IP disconnection request from the generic QKnxNetIpFrame class and to create a disconnection request frame based on the information. More...
Public Functions
QKnxNetIpFrame | create() const |
Builder & | setChannelId(quint8 channelId) |
Builder & | setControlEndpoint(const QKnxNetIpHpai &hpai) |
Detailed Description
A KNXnet/IP client terminates a data channel connection to a KNXnet/IP server by sending a disconnection request to the server's control endpoint. The client should try to disconnect gracefully, even under error conditions.
The server may disconnect from the client by sending a disconnection request due to internal problems or reception of invalid data packets. However, it is recommended to let the client terminate the connection.
The KNXnet/IP device receiving the disconnection request acknowledges the operation with a KNXnet/IP disconnection response frame, QKnxNetIpDisconnectResponseProxy, which signals the final termination of a 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 disconnection request is:
auto netIpFrame = QKnxNetIpDisconnectRequestProxy::builder() .setChannelId(200) .setControlEndpoint(QKnxNetIpHpaiProxy::builder() .setHostAddress(QHostAddress::LocalHost) .setPort(3671).create()) .create();
Member Function Documentation
QKnxNetIpFrame Builder::create() const
Creates and returns a KNXnet/IP disconnection request frame.
Note: The returned frame may be invalid depending on the values used during setup.
See also isValid().
Builder &Builder::setChannelId(quint8 channelId)
Sets the ID of the communication channel between the KNXnet/IP client and server to channelId and returns a reference to the builder.
Builder &Builder::setControlEndpoint(const QKnxNetIpHpai &hpai)
Sets the control endpoint of the KNXnet/IP device sending the disconnection request to hpai and returns a reference to the builder.