Builder Class

class QKnxNetIpConfigDibProxy::Builder

The QKnxNetIpConfigDibProxy::Builder class creates a KNXnet/IP IP configuration DIB structure. More...

Public Functions

QKnxNetIpDib create() const
Builder &setAssignmentMethods(QKnxNetIp::AssignmentMethods methods)
Builder &setCapabilities(QKnxNetIp::Capabilities capabilities)
Builder &setDefaultGateway(const QHostAddress &gateway)
Builder &setIpAddress(const QHostAddress &ipAddress)
Builder &setSubnetMask(const QHostAddress &subnetMask)

Detailed Description

The common way to create such a DIB structure is:

// setup the IP configuration values

auto dib = QKnxNetIpConfigDibProxy::builder()
    .setIpAddress(address)
    .setSubnetMask(subnetMask)
    .setDefaultGateway(gateway)
    .setCapabilities(QKnxNetIp::Capabilities::Dhcp)
    .setAssignmentMethods(QKnxNetIp::AssignmentMethod::Dhcp)
    .create();

Member Function Documentation

QKnxNetIpDib Builder::create() const

Creates and returns a QKnxNetIpDib.

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

See also isValid().

Builder &Builder::setAssignmentMethods(QKnxNetIp::AssignmentMethods methods)

Sets the enabled IP address assignment methods for setting the current IP address to methods if the passed argument is valid and returns a reference to the builder.

Note: At least one method needs to be enabled.

Builder &Builder::setCapabilities(QKnxNetIp::Capabilities capabilities)

Sets the IP capabilities supported by the KNXnet/IP device to capabilities if the passed argument is valid and returns a reference to the builder.

Builder &Builder::setDefaultGateway(const QHostAddress &gateway)

Sets the default gateway to gateway if the passed argument is a valid QHostAddress and returns a reference to the builder.

Builder &Builder::setIpAddress(const QHostAddress &ipAddress)

Sets the fixed IP address to ipAddress if the passed argument is a valid QHostAddress and returns a reference to the builder. It will be used if the manual address assignment method is enabled.

Builder &Builder::setSubnetMask(const QHostAddress &subnetMask)

Sets the subnet mask to subnetMask if the passed argument is a valid QHostAddress and returns a reference to the builder. It will be used if the manual address assignment method is enabled.

© 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.