packetdatatypes.h
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef PACKETDATATYPES_H
#define PACKETDATATYPES_H
#include "mqtt5properties.h"
struct ConnectData
{
char protocol_level_byte = 0;
// Flags
bool user_name_flag = false;
bool password_flag = false;
bool will_retain = false;
char will_qos = false;
bool will_flag = false;
bool clean_start = false;
uint16_t keep_alive = 0;
// Content from properties
uint16_t client_receive_max;
uint32_t session_expire;
uint32_t max_outgoing_packet_size;
uint16_t max_outgoing_topic_aliases = 0; // Default MUST BE 0, meaning server won't initiate aliases;
bool request_response_information = false;
bool request_problem_information = false;
std::string authenticationMethod;
std::string authenticationData;
// Content from Payload
std::string client_id;
WillPublish willpublish;
std::string username;
std::string password;
Mqtt5PropertyBuilder builder;
ConnectData();
};
struct ConnAckData
{
// Flags
bool sessionPresent = false;
ReasonCodes reasonCode = ReasonCodes::ImplementationSpecificError; // default something that is never a parse result;
std::string authData;
};
struct AuthPacketData
{
std::string method;
std::string data;
ReasonCodes reasonCode = ReasonCodes::ImplementationSpecificError; // default something that is never a parse result;
};
struct DisconnectData
{
ReasonCodes reasonCode = ReasonCodes::Success;
std::string reasonString;
bool session_expiry_interval_set = false;
uint32_t session_expiry_interval = 0;
};
struct SubAckData
{
uint16_t packet_id;
std::string reasonString;
std::vector<uint8_t> subAckCodes;
};
struct PubRecData
{
ReasonCodes reasonCode = ReasonCodes::Success; // Default when not specified, or MQTT3;
};
#endif // PACKETDATATYPES_H