The QKnxLinkLayerFrame class is a frame that is sent over a communication channel established between a KNXnet/IP client and a KNXnet/IP server. 更多...
头: | #include <QKnxLinkLayerFrame> |
qmake: | QT += knx |
class | Builder |
enum class | MessageCode { Unknown, BusmonitorIndication, DataRequest, DataConfirmation, DataIndication, …, ResetRequest } |
QKnxLinkLayerFrame (QKnxLinkLayerFrame && other ) | |
QKnxLinkLayerFrame (const QKnxLinkLayerFrame & other ) | |
QKnxLinkLayerFrame (QKnxLinkLayerFrame::MessageCode messageCode , const QKnxByteArray & serviceInfo ) | |
QKnxLinkLayerFrame (QKnxLinkLayerFrame::MessageCode messageCode ) | |
QKnxLinkLayerFrame () | |
QKnxLinkLayerFrame & | operator= (QKnxLinkLayerFrame && other ) |
QKnxLinkLayerFrame & | operator= (const QKnxLinkLayerFrame & other ) |
~QKnxLinkLayerFrame () | |
void | addAdditionalInfo (const QKnxAdditionalInfo & info ) |
QVector<QKnxAdditionalInfo> | additionalInfos () const |
quint8 | additionalInfosSize () const |
QKnxByteArray | bytes () const |
void | clearAdditionalInfos () |
QKnxControlField | controlField () const |
const QKnxAddress | destinationAddress () const |
QKnxExtendedControlField | extendedControlField () const |
bool | isValid () const |
QKnx::MediumType | mediumType () const |
QKnxLinkLayerFrame::MessageCode | messageCode () const |
void | removeAdditionalInfo (QKnxAdditionalInfo::Type type ) |
void | removeAdditionalInfo (const QKnxAdditionalInfo & info ) |
QKnxByteArray | serviceInformation () const |
void | setControlField (const QKnxControlField & controlField ) |
void | setDestinationAddress (const QKnxAddress & destination ) |
void | setExtendedControlField (const QKnxExtendedControlField & controlFieldEx ) |
void | setMediumType (QKnx::MediumType type ) |
void | setMessageCode (QKnxLinkLayerFrame::MessageCode code ) |
void | setServiceInformation (const QKnxByteArray & data ) |
void | setSourceAddress (const QKnxAddress & source ) |
void | setTpdu (const QKnxTpdu & tpdu ) |
quint16 | size () const |
const QKnxAddress | sourceAddress () const |
void | swap (QKnxLinkLayerFrame & other ) |
QKnxTpdu | tpdu () const |
bool | operator!= (const QKnxLinkLayerFrame & other ) const |
bool | operator== (const QKnxLinkLayerFrame & other ) const |
QKnxLinkLayerFrame::Builder | builder () |
QKnxLinkLayerFrame | fromBytes (const QKnxByteArray & data , quint16 index , quint16 size , QKnx::MediumType mediumType = QKnx::MediumType::NetIP) |
QDebug | operator<< (QDebug debug , const QKnxLinkLayerFrame & frame ) |
Following the KNXnet/IP tunneling specifications, only the MessageCode values listed below are valid link layer frame message codes to be sent via a KNXnet/IP tunnel connection:
DataRequest
(
L_Data.req
)
DataConfirmation
(
L_Data.con
)
DataIndication
(
L_Data.ind
)
BusmonitorIndication
(
L_Busmon.ind
)
RawRequest
(
L_Raw.req
)
RawIndication
(
L_Raw.ind
)
RawConfirmation
(
L_Raw.con
)
ResetRequest
(
M_Reset.req
)
The Qt KNX module implements only KNXnet/IP tunnel connections, and therefore only the above message codes can be used.
The message code is also to be chosen depending on the application service (encoded with the QKnxTpdu::ApplicationControlField ) held in QKnxTpdu . The application services are split into categories according to the addressing method.
另请参阅 Qt KNX Tunneling Classes .
This enum holds the message code of the link layer frame sent via a KNXnet/IP tunnel connection.
常量 | 值 | 描述 |
---|---|---|
QKnxLinkLayerFrame::MessageCode::Unknown
|
0x00
|
An unknown message code. |
QKnxLinkLayerFrame::MessageCode::BusmonitorIndication
|
0x2b
|
A
L_Busmon.ind
message code that is used in server-to-client communication on KNX bus monitor.
|
QKnxLinkLayerFrame::MessageCode::DataRequest
|
0x11
|
A
L_Data.req
message code that is used in client-to-server communication on KNX data link layer.
|
QKnxLinkLayerFrame::MessageCode::DataConfirmation
|
0x2e
|
A
l{L_Data.con}
message code that is used in server-to-client communication on KNX data link layer.
|
QKnxLinkLayerFrame::MessageCode::DataIndication
|
0x29
|
A
L_Data.ind
message code that is used in server-to-client communication on KNX data link layer.
|
QKnxLinkLayerFrame::MessageCode::RawRequest
|
0x10
|
A
L_Raw.req
message code that is used in client-to-server communication in common external message interface (cEMI) raw mode.
|
QKnxLinkLayerFrame::MessageCode::RawIndication
|
0x2d
|
A
L_Raw.ind
message code that is used in server-to-client communication in cEMI raw mode.
|
QKnxLinkLayerFrame::MessageCode::RawConfirmation
|
0x2f
|
A
L_Raw.con
message code that is used in server-to-client communication in cEMI raw mode.
|
QKnxLinkLayerFrame::MessageCode::ResetRequest
|
0xf1
|
A
M_Reset.req
message code that is used in client-to-server communication on KNX data link layer and in cEMI raw mode.
|
Move-constructs an object instance, making it point to the same object that other 所指向的。
构造副本为 other .
Constructs a link layer frame starting with messageCode and sets the service information to serviceInfo .
The medium type is set to
QKnx::MediumType
NetIP
.
另请参阅 setMediumType ().
Constructs a link layer frame starting with
messageCode
. The medium type is set to
QKnx::MediumType
NetIP
.
注意: The link layer frame will be otherwise empty and needs to be set manually.
另请参阅 setMediumType ().
Constructs an empty link layer frame with the medium type set to
QKnx::MediumType
NetIP
.
另请参阅 setMediumType ().
移动赋值 other to this object instance.
赋值指定 other 到此对象。
Destroys the link layer management frame and frees all allocated resources.
Adds the KNX additional info parameter info to the additional information field. The information is sorted in ascending order based on its type.
另请参阅 QKnxAdditionalInfo and QKnxAdditionalInfo::type ().
Returns a vector of additional information contained in the frame.
另请参阅 QKnxAdditionalInfo .
Returns the size in bytes of the whole additional information field.
[static]
QKnxLinkLayerFrame::Builder
QKnxLinkLayerFrame::
builder
()
Returns an instance of a generic link layer frame builder.
Returns an array of bytes that represent the link layer frame if it is valid; otherwise returns a default-constructed frame.
Removes all additional information from the frame.
Returns the control field of the frame.
另请参阅 setControlField ().
Returns the destination address.
另请参阅 setDestinationAddress ().
Returns the extended control field of the frame.
另请参阅 setExtendedControlField ().
[static]
QKnxLinkLayerFrame
QKnxLinkLayerFrame::
fromBytes
(const
QKnxByteArray
&
data
,
quint16
index
,
quint16
size
,
QKnx::MediumType
mediumType
= QKnx::MediumType::NetIP)
Constructs a link layer frame from the byte array data starting at the position index inside the array using the number of bytes specified by size . Sets the medium type of the frame to mediumType
返回
true
if the link layer frame is valid, returns
false
否则。
注意:
Validation is only supported for
QKnx::MediumType
NetIP
, for other medium types the function always returns
false
.
Returns the medium type to be used to send the link layer frame.
另请参阅 setMediumType ().
Returns the message code of the link layer frame.
另请参阅 setMessageCode ().
Removes all additional information of the type type .
另请参阅 QKnxAdditionalInfo and QKnxAdditionalInfo::Type .
Removes the first occurrence of the additional information info from the frame's additional information field.
另请参阅 QKnxAdditionalInfo .
Returns the service information the frame carries. This is the frame without the message code.
另请参阅 setServiceInformation ().
Sets the control field of the frame to controlField .
另请参阅 controlField ().
Sets the destination address to destination .
另请参阅 destinationAddress ().
Sets the extended control field of the frame to controlFieldEx .
另请参阅 extendedControlField ().
Sets the medium type to be used to send the LinkLayer frame to type .
另请参阅 mediumType ().
Sets the message code of the link layer frame to code .
另请参阅 messageCode ().
Sets the service information based on a byte array with all the fields encoded into it to data .
另请参阅 serviceInformation ().
Sets the source address to source .
另请参阅 sourceAddress ().
Sets the TPDU of the frame to tpdu . The TPDU is read by the network, transport, and application layer services.
另请参阅 tpdu ().
Returns the number of bytes of the link layer frame.
Returns the source address.
另请参阅 setSourceAddress ().
交换 other 与此对象。此操作非常快且从不失败。
Returns the TPDU of the frame. The TPDU is read by the network, transport, and application layer services.
另请参阅 setTpdu ().
返回
true
if this object and the given
other
不相等;则返回
false
.
返回
true
if this object and the given
other
相等;否则返回
false
.
Writes the link layer frame frame 到 debug stream.