QKnxNetIpFrameHeader Class

The QKnxNetIpFrameHeader class is a KNXnet/IP frame header. 更多...

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

公共函数

QKnxNetIpFrameHeader (QKnxNetIp::ServiceType type , quint16 dataSize )
QKnxNetIpFrameHeader (QKnxNetIp::ServiceType type )
QKnxNetIpFrameHeader ()
~QKnxNetIpFrameHeader ()
quint8 byte (quint8 index ) const
QKnxByteArray bytes () const
quint16 dataSize () const
bool isNull () const
bool isValid () const
quint8 protocolVersion () const
QKnxNetIp::ServiceType serviceType () const
void setDataSize (quint16 dataSize )
void setProtocolVersion (quint8 version )
void setServiceType (QKnxNetIp::ServiceType type )
quint8 setSize (quint8 size )
quint8 size () const
quint16 totalSize () const
bool operator!= (const QKnxNetIpFrameHeader & other ) const
bool operator== (const QKnxNetIpFrameHeader & other ) const

静态公共成员

QKnxNetIpFrameHeader fromBytes (const QKnxByteArray & bytes , quint16 index = 0)
QDebug operator<< (QDebug debug , const QKnxNetIpFrameHeader & header )

详细描述

The QKnxNetIpFrameHeader class contains the data and meta data related to a KNXnet/IP frame. Every KNXnet/IP frame consists of at least the common KNXnet/IP header. The common KNXnet/IP header contains information about the protocol version, the header and total packet size, and a KNXnet/IP service type identifier.

另请参阅 Qt KNXnet/IP Connection Classes .

成员函数文档编制

QKnxNetIpFrameHeader:: QKnxNetIpFrameHeader ( QKnxNetIp::ServiceType type , quint16 dataSize )

Constructs a valid frame header object. Sets the KNXnet/IP service type identifier to type and the data size to dataSize and updates the total size accordingly.

注意: By default a KNXnet/IP Version 1.0 frame header is constructed.

另请参阅 isValid (), serviceType (), setServiceType (), dataSize (),和 setDataSize ().

QKnxNetIpFrameHeader:: QKnxNetIpFrameHeader ( QKnxNetIp::ServiceType type )

Constructs a valid frame header object and sets the KNXnet/IP service type identifier to type .

注意: By default a KNXnet/IP Version 1.0 frame header is constructed.

另请参阅 isValid (), serviceType (),和 setServiceType ().

QKnxNetIpFrameHeader:: QKnxNetIpFrameHeader ()

Constructs an empty invalid frame header object.

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

QKnxNetIpFrameHeader:: ~QKnxNetIpFrameHeader ()

Destroys the frame header object and releases all allocated resources.

quint8 QKnxNetIpFrameHeader:: byte ( quint8 index ) const

Returns the byte at position index in the header.

QKnxByteArray QKnxNetIpFrameHeader:: bytes () const

Returns an array of bytes that represent the KNXnet/IP frame header.

quint16 QKnxNetIpFrameHeader:: dataSize () const

Returns the size of the KNXnet/IP frame's data if the header is valid, otherwise returns null . The data size excludes the size of the KNXnet/IP frame's header.

另请参阅 setDataSize (), isNull (), isValid (), size (),和 totalSize ().

[static] QKnxNetIpFrameHeader QKnxNetIpFrameHeader:: fromBytes (const QKnxByteArray & bytes , quint16 index = 0)

Constructs the KNXnet/IP frame header from the byte array bytes 起始于位置 index inside the array.

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

bool QKnxNetIpFrameHeader:: isNull () const

返回 true if this is a default constructed header, otherwise returns false . A header is considered null if it contains no initialized values.

bool QKnxNetIpFrameHeader:: isValid () const

返回 true if the frame header contains initialized values and is in itself valid, otherwise returns false . A valid KNXnet/IP frame header consist of a header size, protocol version, a known serviceType identifier, and a minimum total size.

另请参阅 isNull ().

quint8 QKnxNetIpFrameHeader:: protocolVersion () const

Returns the protocol version of the KNXnet/IP frame.

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

QKnxNetIp::ServiceType QKnxNetIpFrameHeader:: serviceType () const

Returns the service type identifier of the KNXnet/IP frame.

另请参阅 setServiceType ().

void QKnxNetIpFrameHeader:: setDataSize ( quint16 dataSize )

Sets the KNXnet/IP frame's data size to dataSize and updates the total size accordingly.

另请参阅 dataSize ().

void QKnxNetIpFrameHeader:: setProtocolVersion ( quint8 version )

Sets the protocol version of the KNXnet/IP frame header to version .

另请参阅 protocolVersion ().

void QKnxNetIpFrameHeader:: setServiceType ( QKnxNetIp::ServiceType type )

Sets the service type identifier of the KNXnet/IP frame to type .

另请参阅 serviceType ().

quint8 QKnxNetIpFrameHeader:: setSize ( quint8 size )

Sets the size of the KNXnet/IP frame header to size .

另请参阅 size ().

quint8 QKnxNetIpFrameHeader:: size () const

Returns the size of the KNXnet/IP frame header.

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

quint16 QKnxNetIpFrameHeader:: totalSize () const

Returns the total size of the KNXnet/IP frame if the header is valid, otherwise returns null . The total size includes the size of the header and the size of the KNXnet/IP frame data.

另请参阅 isNull (), isValid (), size (),和 dataSize ().

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

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

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

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

相关非成员

QDebug operator<< ( QDebug debug , const QKnxNetIpFrameHeader & header )

Writes the KNXnet/IP frame header header debug stream.