40 class Connect :
public iot::mqtt::ControlPacket {
44 Connect(
const std::string& clientId,
47 const std::string& willTopic,
48 const std::string& willMessage,
51 const std::string& username,
52 const std::string& password,
56 std::vector<
char> serializeVP()
const override;
59 std::string getProtocol()
const;
60 uint8_t getLevel()
const;
61 uint8_t getConnectFlags()
const;
62 uint16_t getKeepAlive()
const;
64 std::string getClientId()
const;
66 bool getUsernameFlag()
const;
67 bool getPasswordFlag()
const;
68 bool getWillRetain()
const;
69 uint8_t getWillQoS()
const;
70 bool getWillFlag()
const;
71 bool getCleanSession()
const;
72 bool getReflect()
const;
74 std::string getWillTopic()
const;
75 std::string getWillMessage()
const;
76 std::string getUsername()
const;
77 std::string getPassword()
const;
80 iot::mqtt::types::String protocol;
81 iot::mqtt::types::UInt8 level;
82 iot::mqtt::types::UInt8 connectFlags;
83 iot::mqtt::types::UInt16 keepAlive;
84 iot::mqtt::types::String clientId;
85 iot::mqtt::types::String willTopic;
86 iot::mqtt::types::String willMessage;
87 iot::mqtt::types::String username;
88 iot::mqtt::types::String password;
90 bool usernameFlag =
false;
91 bool passwordFlag =
false;
92 bool willRetain =
false;
94 bool willFlag =
false;
95 bool cleanSession =
false;
97 bool reserved =
false;
void sendConnect(uint16_t keepAlive, const std::string &clientId, bool cleanSession, const std::string &willTopic, const std::string &willMessage, uint8_t willQoS, bool willRetain, const std::string &username, const std::string &password, bool loopPrevention=false)