Builder Class

class QKnxNetIpConfigDibProxy ::Builder

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

公共函数

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 )

详细描述

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

成员函数文档编制

QKnxNetIpDib Builder:: create () const

创建并返回 QKnxNetIpDib .

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

另请参阅 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.

注意: 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.