Here is the Connect frame format from the MQTT protocol.
Refer to the end of the post for more information for various fields.
The official definition can be found here.

byte

content (hexa)

content

1

1

control packet type

0

reserved

 

2

?

remaining lenght

 

?

(10+size(client_size)+client_size)

3

0

Length MSB

 

0

4

0

Length LSB

4

5

4

M

d

6

5

Q

1

7

5

T

4

8

5

T

4

9

0

Protocol
level

4

10

c

User Name Flag (1)

Password Flag (1)

Will Retain (0)

Will QoS (01)

e

Will Flag (1)

Clean Session (1)

Reserved (0)

11

0

Keep Alive
MSB

0

12

0

Keep Alive
LSB

a

13

?

client lenght

?

14

?

client id

?

MQTT Control Packet type:
This is present for each frame, it announces the coming frame.

Remaining Length:
Length of the rest of the frame. “4 + topic_length + payload_length” is the formula used to calculate this length.

Back Next

Connect
Tagged on:                             

3 thoughts on “Connect

Leave a Reply