toTopicWithQos method

MqttSubscribeMessage toTopicWithQos(
  1. String? topic,
  2. MqttQos? withQos
)

Adds a new subscription topic with the specified Qos levelMqttQos.

Implementation

MqttSubscribeMessage toTopicWithQos(String? topic, MqttQos? withQos) {
  final subTopic = MqttSubscriptionTopic(topic);
  final option = MqttSubscriptionOption();
  option.maximumQos = withQos;
  _payload!.addSubscription(subTopic, option);
  return this;
}