The QKnxNetIpStructHeader class is a KNXnet/IP structure header. 更多...
头: | #include <QKnxNetIpStructHeader> |
qmake: | QT += knx |
QKnxNetIpStructHeader (CodeType code , quint16 dataSize , bool mandatory ) | |
QKnxNetIpStructHeader (CodeType codeType , quint16 dataFieldSize ) | |
QKnxNetIpStructHeader (CodeType codeType ) | |
QKnxNetIpStructHeader () | |
~QKnxNetIpStructHeader () | |
quint8 | byte (quint8 index ) const |
QKnxByteArray | bytes () const |
CodeType | code () const |
quint16 | dataSize () const |
typename std::enable_if<is_type<T, QKnxNetIp::SearchParameterType>::value, bool>::type | isMandatory () const |
bool | isNull () const |
bool | isValid () const |
void | setCode (CodeType codeType ) |
void | setDataSize (quint16 dataFieldSize ) |
typename std::enable_if<is_type<T, QKnxNetIp::SearchParameterType>::value, void>::type | setMandatory (bool value ) |
quint8 | size () const |
quint16 | totalSize () const |
bool | operator!= (const QKnxNetIpStructHeader<CodeType> & other ) const |
bool | operator== (const QKnxNetIpStructHeader<CodeType> & other ) const |
QKnxNetIpStructHeader<CodeType> | fromBytes (const QKnxByteArray & bytes , quint16 index = 0) |
QDebug | operator<< (QDebug debug , const QKnxNetIpStructHeader<CodeType> & header ) |
The first octet of the structure is the length of the structure and the second octet is an identifier that specifies the type of the structure.
If the structure's amount of data exceeds 252 octets, the first octet is
0xff
and the next two octets contain the length as a 16 bit value. The fourth octet is then the identifier specifying the type of the structure.
另请参阅 Qt KNXnet/IP Connection Classes .
Constructs a valid header object and sets the KNXnet/IP structure identifier to code , the data size to dataSize , and the mandatory flag to mandatory . Additionally it updates the header and total size of the structure.
另请参阅 isValid (), code (), setCode (), dataSize (), setDataSize (),和 setMandatory ().
Constructs a valid header object and sets the KNXnet/IP structure identifier to codeType and the data size to dataFieldSize and updates the header size and total size accordingly.
另请参阅 isValid (), code (), setCode (), dataSize (),和 setDataSize ().
Constructs a valid header object and sets the KNXnet/IP structure identifier to codeType .
另请参阅 isValid (), code (),和 setCode ().
Constructs an empty invalid header object.
Destroys the 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 structure header.
Returns the KNXnet/IP structure's code identifier.
另请参阅 setCode ().
Returns the size of the KNXnet/IP structure data if the header is valid, otherwise returns
null
.
The data size excludes the size of the KNXnet/IP structure header.
另请参阅 setDataSize (), isNull (), isValid (), size (),和 totalSize ().
[static]
QKnxNetIpStructHeader
<
CodeType
> QKnxNetIpStructHeader::
fromBytes
(const
QKnxByteArray
&
bytes
,
quint16
index
= 0)
Constructs the KNXnet/IP structure header from the byte array bytes starting at the position index inside the array.
返回
true
if the mandatory bit is set; otherwise returns
false
.
该函数在 Qt 5.12 引入。
返回
true
if this is a default constructed header, otherwise returns
false
. A header is considered null if it contains no initialized values.
另请参阅 isValid ().
返回
true
if the KNXnet/IP structure header contains initialized values and is in itself valid, otherwise returns
false
. A valid KNXnet/IP structure header consist of a given total size and a known
code
标识符。
另请参阅 isNull ().
Sets the KNXnet/IP structure's code identifier to codeType .
另请参阅 code ().
Sets the KNXnet/IP structure data size to dataFieldSize and updates the header and total size accordingly.
另请参阅 dataSize ().
Sets the KNXnet/IP structure's mandatory bit to value .
该函数在 Qt 5.12 引入。
另请参阅 isMandatory ().
Returns the size of the KNXnet/IP structure header.
Returns the total size of the KNXnet/IP structure if the header is valid, otherwise returns
null
. The total size includes the size of the header and the size of the KNXnet/IP structure 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 structure header header 到 debug stream.