Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions include/mqtt/client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,17 @@ class client : public endpoint<std::mutex, std::lock_guard, PacketIdBytes> {
user_name_ = force_move(name);
}

/**
* @brief Clear username.
*
* This function should be called before calling connect().<BR>
* See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901071<BR>
* 3.1.3.5 User Name
*/
void set_user_name() {
user_name_ = nullopt;
}

/**
* @brief Set password.
* @param password password
Expand All @@ -933,6 +944,17 @@ class client : public endpoint<std::mutex, std::lock_guard, PacketIdBytes> {
password_ = force_move(password);
}

/**
* @brief Clear password.
*
* This function should be called before calling connect().<BR>
* See https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901072<BR>
* 3.1.3.6 Password
*/
void set_password() {
password_ = nullopt;
}

/**
* @brief Set will.
* @param w will
Expand Down