QKnxNetIpServerInfo Class

The QKnxNetIpServerInfo class stores information about a KNXnet/IP server. 更多...

头: #include <QKnxNetIpServerInfo>
qmake: QT += knx

公共函数

QKnxNetIpServerInfo (QKnxNetIpServerInfo && other )
QKnxNetIpServerInfo (const QKnxNetIpServerInfo & other )
QKnxNetIpServerInfo ()
QKnxNetIpServerInfo & operator= (QKnxNetIpServerInfo && other )
QKnxNetIpServerInfo & operator= (const QKnxNetIpServerInfo & other )
~QKnxNetIpServerInfo ()
QHostAddress controlEndpointAddress () const
quint16 controlEndpointPort () const
QString deviceName () const
QKnxNetIpHpai endpoint () const
QKnxNetIpDib extendedHardware () const
QKnxNetIpDib hardware () const
QHostAddress hostAddress () const
QKnxAddress individualAddress () const
quint16 maskVersion () const
quint16 maximumLocalApduLength () const
QKnx::MediumStatus mediumStatus () const
QNetworkInterface networkInterface () const
QKnxNetIpDib services () const
QVector<QKnxServiceInfo> supportedServices () const
void swap (QKnxNetIpServerInfo & other )
QKnxNetIpDib tunnelingInfo () const
QVector<QKnxNetIpTunnelingSlotInfo> tunnelingSlotInfos () const
bool operator!= (const QKnxNetIpServerInfo & other ) const
bool operator== (const QKnxNetIpServerInfo & other ) const

详细描述

A KNXnet/IP server information object contains the information provided by the server during its discovery (using for example QKnxNetIpServerDiscoveryAgent ) that the client needs to establish a connection. This includes the device name and individual address of the server, a KNXnet/IP transport connection endpoint, and the services supported by the server.

KNXnet/IP servers are typically connected to one KNX subnetwork and to an IP network. Therefore, they have one KNX individual address returned by individualAddress () and one IP address returned by controlEndpointAddress ().

A KNXnet/IP server can support the following service types: core, device management, tunneling, routing, remote logging and configuration, and object server. The supported services are returned by supportedServices () as a vector of QKnxServiceInfo objects or by services () as a QKnxNetIpDib object which can be accessed via QKnxNetIpServiceFamiliesDibProxy .

Furthermore, as specified by the KNX application note AN185, the server info may contain additional tunneling and extend device hardware information. If the information is present, it is made accessible through the mediumStatus (), maximumLocalApduLength (), maskVersion (),和 tunnelingSlotInfos () functions. It is also possible to introspect the raw structures via their corresponding proxy objects.

Here is an example on how to use the extended device information proxy in a search that is started using the QKnxNetIpServerDiscoveryAgent :

const auto servers = agent.discoveredServers();
for (auto server : servers) {
    const auto dib = server.extendedHardware();
    QKnxNetIpExtendedDeviceDibProxy proxy(dib);
    if (!proxy.isValid())
        continue;
    qDebug() << "Medium status:" << proxy.mediumStatus()
        << "Maximum local APDU length:" << proxy.maximumLocalApduLength()
        << "Device mask:" << proxy.deviceDescriptorType0();
}
					

另请参阅 QKnxAddress , QKnxNetIpHpai , QKnxNetIpHpaiProxy , QKnxNetIpDib , QKnxNetIpDeviceDibProxy , QKnxNetIpServiceFamiliesDibProxy ,和 Qt KNXnet/IP Connection Classes .

成员函数文档编制

QKnxNetIpServerInfo:: QKnxNetIpServerInfo ( QKnxNetIpServerInfo && other )

Move-constructs an object instance, making it point to the same object that other 所指向的。

QKnxNetIpServerInfo:: QKnxNetIpServerInfo (const QKnxNetIpServerInfo & other )

构造副本为 other .

QKnxNetIpServerInfo:: QKnxNetIpServerInfo ()

Creates a KNXnet/IP server information object.

QKnxNetIpServerInfo &QKnxNetIpServerInfo:: operator= ( QKnxNetIpServerInfo && other )

Move-constructs an object instance, making it point to the same object that other 所指向的。

QKnxNetIpServerInfo &QKnxNetIpServerInfo:: operator= (const QKnxNetIpServerInfo & other )

赋值 other 到此对象。

QKnxNetIpServerInfo:: ~QKnxNetIpServerInfo ()

Deletes a KNXnet/IP server information object.

QHostAddress QKnxNetIpServerInfo:: controlEndpointAddress () const

Returns the host address of the control endpoint.

quint16 QKnxNetIpServerInfo:: controlEndpointPort () const

Returns the port number of the control endpoint.

QString QKnxNetIpServerInfo:: deviceName () const

Returns the device name.

QKnxNetIpHpai QKnxNetIpServerInfo:: endpoint () const

Returns a KNXnet/IP transport connection endpoint.

另请参阅 QKnxNetIpHpaiProxy .

QKnxNetIpDib QKnxNetIpServerInfo:: extendedHardware () const

Returns extended hardware information about the KNXnet/IP server hardware.

该函数在 Qt 5.12 引入。

另请参阅 QKnxNetIpExtendedDeviceDibProxy .

QKnxNetIpDib QKnxNetIpServerInfo:: hardware () const

Returns information about the KNXnet/IP server hardware.

另请参阅 QKnxNetIpDeviceDibProxy .

QHostAddress QKnxNetIpServerInfo:: hostAddress () const

Returns the host address which has been used to discover the KNXnet/IP server hardware.

该函数在 Qt 5.14 引入。

另请参阅 QHostAddress .

QKnxAddress QKnxNetIpServerInfo:: individualAddress () const

Returns the individual address of the server.

quint16 QKnxNetIpServerInfo:: maskVersion () const

Returns the mask version (device descriptor 0) of the discovered KNXnet/IP server if it supports extended device information; otherwise returns a 默认构造值 which can be 0 .

该函数在 Qt 5.12 引入。

quint16 QKnxNetIpServerInfo:: maximumLocalApduLength () const

Returns the maximum local application protocol data unit (APDU) length of the discovered KNXnet/IP server if it supports extended device information; otherwise returns a 默认构造值 which can be 0 .

该函数在 Qt 5.12 引入。

QKnx::MediumStatus QKnxNetIpServerInfo:: mediumStatus () const

Returns the medium status of the discovered KNXnet/IP server if it supports extended device information; otherwise returns QKnx::Unknown .

该函数在 Qt 5.12 引入。

QNetworkInterface QKnxNetIpServerInfo:: networkInterface () const

Returns the network interface which has been used to discover the KNXnet/IP server hardware.

该函数在 Qt 5.14 引入。

另请参阅 QNetworkInterface .

QKnxNetIpDib QKnxNetIpServerInfo:: services () const

Returns the services available on a KNXnet/IP server.

另请参阅 QKnxNetIpServiceFamiliesDibProxy .

QVector < QKnxServiceInfo > QKnxNetIpServerInfo:: supportedServices () const

Returns the services supported by a KNXnet/IP server.

void QKnxNetIpServerInfo:: swap ( QKnxNetIpServerInfo & other )

Swaps the server information object other with this object.

QKnxNetIpDib QKnxNetIpServerInfo:: tunnelingInfo () const

Returns tunneling information if available on a KNXnet/IP server.

该函数在 Qt 5.12 引入。

另请参阅 QKnxNetIpTunnelingInfoDibProxy .

QVector < QKnxNetIpTunnelingSlotInfo > QKnxNetIpServerInfo:: tunnelingSlotInfos () const

Returns the available tunneling slots of the discovered KNXnet/IP server if it supports providing this kind of information; otherwise returns an empty vector.

该函数在 Qt 5.12 引入。

bool QKnxNetIpServerInfo:: operator!= (const QKnxNetIpServerInfo & other ) const

返回 true if other points to a different item than this server information object. Otherwise, returns false .

bool QKnxNetIpServerInfo:: operator== (const QKnxNetIpServerInfo & other ) const

返回 true if other points to the same item as this server information object. Otherwise, returns false .