QKnxNetIpStruct Class

template <typename CodeType> class QKnxNetIpStruct

The QKnxNetIpStruct class represents a generic data structure encapsulated in a KNXnet/IP frame. 更多...

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

公共函数

QKnxNetIpStruct (const QKnxNetIpStructHeader<CodeType> & headerField , const QKnxByteArray & dataField = {})
QKnxNetIpStruct (CodeType codeType , const QKnxByteArray & dataField = {})
QKnxNetIpStruct ()
QKnxByteArray bytes () const
CodeType code () const
const QKnxByteArray & constData () const
QKnxByteArray data () const
quint16 dataSize () const
QKnxNetIpStructHeader<CodeType> header () const
bool isNull () const
bool isValid () const
void setData (const QKnxByteArray & dataField )
void setHeader (const QKnxNetIpStructHeader<CodeType> & headerField )
quint16 size () const
bool operator!= (const QKnxNetIpStruct<CodeType> & other ) const
bool operator== (const QKnxNetIpStruct<CodeType> & other ) const

静态公共成员

QKnxNetIpStruct<CodeType> fromBytes (const QKnxByteArray & bytes , quint16 index = 0)
QDebug operator<< (QDebug debug , const QKnxNetIpStruct<QKnxNetIp::HostProtocol> & hpai )
QDebug operator<< (QDebug debug , const QKnxNetIpStruct<QKnxNetIp::ConnectionType> & cr )
QDebug operator<< (QDebug debug , const QKnxNetIpStruct<QKnxNetIp::DescriptionType> & dib )
QDebug operator<< (QDebug debug , const QKnxNetIpStruct<QKnxNetIp::SearchParameterType> & srp )

详细描述

The following types of KNXnet/IP structures can be encapsulated in QKnxNetIpFrame : QKnxNetIpHpai for host protocol address information (HPAI), QKnxNetIpCri for connection request information (CRI), QKnxNetIpCrd for connection response data (CRD) and QKnxNetIpDib for a description information block (DIB).

另请参阅 Qt KNXnet/IP Connection Classes .

成员函数文档编制

QKnxNetIpStruct:: QKnxNetIpStruct (const QKnxNetIpStructHeader < CodeType > & headerField , const QKnxByteArray & dataField = {})

Creates a new KNXnet/IP structure with the specified headerField and payload dataField .

The header is expected to be fully set up and all values describing the payload are expected to match the specified payload.

注意: No adjustments are made to the function arguments.

QKnxNetIpStruct:: QKnxNetIpStruct ( CodeType codeType , const QKnxByteArray & dataField = {})

Creates a new KNXnet/IP structure with the specified codeType and payload dataField .

QKnxNetIpStruct:: QKnxNetIpStruct ()

Creates an empty invalid KNXnet/IP structure.

QKnxByteArray QKnxNetIpStruct:: bytes () const

Returns an array of bytes representing the KNXnet/IP structure including the header and the payload.

CodeType QKnxNetIpStruct:: code () const

Returns the generic code stored in the KNXnet/IP structure.

const QKnxByteArray &QKnxNetIpStruct:: constData () const

Returns the data stored in the KNXnet/IP structure.

QKnxByteArray QKnxNetIpStruct:: data () const

Returns the data stored in the KNXnet/IP structure.

另请参阅 setData ().

quint16 QKnxNetIpStruct:: dataSize () const

Returns the size of the data stored in the KNXnet/IP structure.

[static] QKnxNetIpStruct < CodeType > QKnxNetIpStruct:: fromBytes (const QKnxByteArray & bytes , quint16 index = 0)

Constructs the KNXnet/IP structure from the byte array bytes starting at the position index inside the array.

另请参阅 isNull () 和 isValid ().

Returns the header stored in the KNXnet/IP structure.

另请参阅 setHeader ().

bool QKnxNetIpStruct:: isNull () const

返回 true if this is a default constructed structure; otherwise returns false .

bool QKnxNetIpStruct:: isValid () const

返回 true if the structure contains initialized values and is in itself valid; otherwise returns false .

另请参阅 isNull ().

void QKnxNetIpStruct:: setData (const QKnxByteArray & dataField )

Sets the data stored in the KNXnet/IP structure to dataField and updates the data size accordingly.

另请参阅 data ().

void QKnxNetIpStruct:: setHeader (const QKnxNetIpStructHeader < CodeType > & headerField )

Sets the header stored in the KNXnet/IP structure to headerField .

另请参阅 header ().

quint16 QKnxNetIpStruct:: size () const

Returns the size of the KNXnet/IP structure.

bool QKnxNetIpStruct:: operator!= (const QKnxNetIpStruct < CodeType > & other ) const

返回 true if this object and the given other 不相等;则返回 false .

bool QKnxNetIpStruct:: operator== (const QKnxNetIpStruct < CodeType > & other ) const

返回 true if this object and the given other 相等;否则返回 false .

相关非成员

QDebug operator<< ( QDebug debug , const QKnxNetIpStruct < QKnxNetIp::HostProtocol > & hpai )

Writes the KNXnet/IP host protocol address information structure hpai debug stream.

QDebug operator<< ( QDebug debug , const QKnxNetIpStruct < QKnxNetIp::ConnectionType > & cr )

Writes the KNXnet/IP connection request information structure cr debug stream.

QDebug operator<< ( QDebug debug , const QKnxNetIpStruct < QKnxNetIp::DescriptionType > & dib )

Writes the KNXnet/IP description information block structure dib debug stream.

QDebug operator<< ( QDebug debug , const QKnxNetIpStruct < QKnxNetIp::SearchParameterType > & srp )

Writes the KNXnet/IP extended search parameter request srp debug stream.

该函数在 Qt 5.12 引入。