The QKnxNetIpFrame class represents the base for all KNXnet/IP related communication. 更多...
头: | #include <QKnxNetIpFrame> |
qmake: | QT += knx |
QKnxNetIpFrame (QKnxNetIpFrame && other ) | |
QKnxNetIpFrame (const QKnxNetIpFrame & other ) | |
QKnxNetIpFrame (const QKnxNetIpFrameHeader & header , const QKnxNetIpConnectionHeader & connectionHeader , const QKnxByteArray & data = {}) | |
QKnxNetIpFrame (QKnxNetIp::ServiceType type , const QKnxNetIpConnectionHeader & connectionHeader , const QKnxByteArray & data = {}) | |
QKnxNetIpFrame (QKnxNetIp::ServiceType type , const QKnxByteArray & data = {}) | |
QKnxNetIpFrame () | |
QKnxNetIpFrame & | operator= (QKnxNetIpFrame && other ) |
QKnxNetIpFrame & | operator= (const QKnxNetIpFrame & other ) |
~QKnxNetIpFrame () | |
QKnxByteArray | bytes () const |
quint8 | channelId () const |
QKnxNetIpConnectionHeader | connectionHeader () const |
QKnxByteArray | connectionTypeSpecificHeaderItems () const |
const QKnxByteArray & | constData () const |
QKnxByteArray | data () const |
quint16 | dataSize () const |
QKnxNetIpFrameHeader | header () const |
bool | isNull () const |
bool | isValid () const |
quint8 | protocolVersion () const |
quint8 | sequenceNumber () const |
QKnxNetIp::ServiceType | serviceType () const |
quint8 | serviceTypeSpecificValue () const |
void | setConnectionHeader (const QKnxNetIpConnectionHeader & header ) |
void | setData (const QKnxByteArray & data ) |
void | setHeader (const QKnxNetIpFrameHeader & header ) |
void | setServiceType (QKnxNetIp::ServiceType type ) |
quint16 | size () const |
void | swap (QKnxNetIpFrame & other ) |
bool | operator!= (const QKnxNetIpFrame & other ) const |
bool | operator== (const QKnxNetIpFrame & other ) const |
QKnxNetIpFrame | fromBytes (const QKnxByteArray & bytes , quint16 index = 0) |
QDebug | operator<< (QDebug debug , const QKnxNetIpFrame & frame ) |
The communication between KNXnet/IP devices is based on KNXnet/IP frames. A KNXnet/IP frame is a data packet sent over the non-KNX network protocol that consists of a header, comparable to the IP header of an Internet protocol data packet, and optional data of variable length. The type of the KNXnet/IP frame is described by a KNXnet/IP service type identifier in the header.
另请参阅 Qt KNXnet/IP Connection Classes .
Move-constructs an object instance, making it point to the same object that other 所指向的。
构造副本为 other .
Creates a new KNXnet/IP frame with the given frame header header , connection header set to connectionHeader , and data set to data .
Creates a new KNXnet/IP frame with the given service type type , connection header set to connectionHeader , and data set to data .
Creates a new KNXnet/IP frame with the given service type type and data set to data .
Constructs an empty invalid KNXnet/IP frame object.
移动赋值 other to this object instance.
赋值指定 other 到此对象。
Destroys the KNXnet/IP frame object and releases all allocated resources.
Returns an array of bytes that represent the KNXnet/IP frame.
Returns the KNXnet/IP frame's channel ID if a connection header is set.
注意: By default the function returns null.
Returns the KNXnet/IP frame's connection header.
另请参阅 setConnectionHeader ().
Returns a byte array with connection type specific header items of the KNXnet/IP frame if a connection header is set.
注意: The returned array can be empty.
Returns the data part of the KNXnet/IP frame as constant reference.
注意: If a connection header is set, it is not considered part of the returned data.
Returns the data part of the KNXnet/IP frame.
注意: If a connection header is set, it is not considered part of the returned data.
另请参阅 setData ().
Returns the size of the KNXnet/IP frame data. The data size excludes the size of the KNXnet/IP frame header and the optional connection header.
[static]
QKnxNetIpFrame
QKnxNetIpFrame::
fromBytes
(const
QKnxByteArray
&
bytes
,
quint16
index
= 0)
Constructs the KNXnet/IP frame from the byte array bytes 起始于位置 index inside the array.
Returns the KNXnet/IP frame header.
另请参阅 setHeader ().
返回
true
if this is a default constructed frame, otherwise returns
false
. A frame is considered null if it contains no initialized values.
返回
true
if the frame contains initialized values and is in itself valid, otherwise returns
false
. A valid KNXnet/IP frame consists of at least a valid header and a size in bytes corresponding to the KNXnet/IP frame header
QKnxNetIpFrameHeader::totalSize
.
Returns the KNXnet/IP frame protocol version.
Returns the KNXnet/IP frame's sequence number if a connection header is set.
注意: By default the function returns null.
Returns the KNXnet/IP frame's service type or QKnxNetIp::Unknown for a default generated frame.
另请参阅 setServiceType ().
Returns the service type specific value of the KNXnet/IP frame if a connection header is set.
注意: By default the function returns null.
Sets the KNXnet/IP frame's connection header to header and updates the total size accordingly.
另请参阅 connectionHeader ().
Sets the data part of the KNXnet/IP frame to data and updates the total size accordingly.
注意: The data part passed may not contain the connection header.
另请参阅 data ().
Sets the KNXnet/IP frame header to header .
另请参阅 header ().
Sets the KNXnet/IP frame's service type to type .
另请参阅 serviceType ().
Returns the size in bytes of the KNXnet/IP frame. The size includes the size of the KNXnet/IP frame header, the optional connection header, and the frame's data part.
交换 other 与此对象。此操作非常快且从不失败。
返回
true
if this object and the given
other
不相等;则返回
false
.
返回
true
if this object and the given
other
相等;否则返回
false
.
Writes the KNXnet/IP frame 到 debug stream.