authenticateAs method
Sets the authentication
Implementation
MqttConnectMessage authenticateAs(String? username, String? password) {
if (username != null) {
variableHeader!.connectFlags.usernameFlag = username.isNotEmpty;
payload.username = username;
}
if (password != null) {
variableHeader!.connectFlags.passwordFlag = password.isNotEmpty;
payload.password = password;
}
return this;
}