MQTT控制报文格式 -- PUBREC – Publish received (QoS 2 publish received, part 1)
- PUBREC 数据包是对 QoS 2 的 PUBLISH 数据包的响应。它是 QoS 2 协议交换的第二个数据包。
- 该数据包剩余长度为2
- 该数据包没有Payload
- 该数据包可变包头长度为2个字节
1. 固定包头 Fixed Header
Bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
byte 1 |
MQTT Control Packet type (5) |
Reserved |
||||||
|
0 |
1 |
0 |
1 |
0 |
0 |
0 |
0 |
byte 2 |
Remaining Length (2) |
|||||||
|
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
2. 可变包头 Variable Header
Bit |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
byte 1 |
Packet Identifier MSB |
|||||||
byte 2 |
Packet Identifier LSB |