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 .
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 ().
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 ().
Constructs an empty invalid frame header object.
Destroys the frame header object and releases all allocated resources.
Returns the byte at position index in the header.
Returns an array of bytes that represent the KNXnet/IP frame header.
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.
返回
true
if this is a default constructed header, otherwise returns
false
. A header is considered null if it contains no initialized values.
返回
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 ().
Returns the protocol version of the KNXnet/IP frame.
另请参阅 setProtocolVersion (), isNull (),和 isValid ().
Returns the service type identifier of the KNXnet/IP frame.
另请参阅 setServiceType ().
Sets the KNXnet/IP frame's data size to dataSize and updates the total size accordingly.
另请参阅 dataSize ().
Sets the protocol version of the KNXnet/IP frame header to version .
另请参阅 protocolVersion ().
Sets the service type identifier of the KNXnet/IP frame to type .
另请参阅 serviceType ().
Sets the size of the KNXnet/IP frame header to size .
另请参阅 size ().
Returns the size of the KNXnet/IP frame header.
另请参阅 setSize (), isNull (),和 isValid ().
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 ().
返回
true
if this object and the given
other
不相等;则返回
false
.
返回
true
if this object and the given
other
相等;否则返回
false
.
Writes the KNXnet/IP frame header header 到 debug stream.