Skip to content

Commit

Permalink
feat!(binding_mqtt): remove discoveryTimeout config parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed May 29, 2024
1 parent 96f76e4 commit 77e39d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
4 changes: 2 additions & 2 deletions lib/src/binding_mqtt/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const mqttContextUri = "http://www.example.org/mqtt-binding#";
/// The default prefix used in MQTT-related compact URIs (CURIEs) in TDs.
const defaultMqttPrefix = "mqv";

/// Default timeout length used for reading properties and discovering TDs.
const defaultTimeout = Duration(seconds: 10);
/// Default timeout length used for reading properties.
const defaultReadTimeout = Duration(seconds: 10);

/// Default duration MQTT connections are kept alive in seconds.
const defaultKeepAlivePeriod = 20;
Expand Down
15 changes: 5 additions & 10 deletions lib/src/binding_mqtt/mqtt_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ import "constants.dart";
/// The default [QoS] values for the different operation types will be used if
/// no Quality of Service is defined in the respective form.
///
/// If no [readTimeout] or [discoveryTimeout] is defined, a [defaultTimeout] of
/// 10 seconds will be used. Furthermore, the [keepAlivePeriod] defaults to 20
/// seconds.
/// If no [readTimeout] is defined, a [defaultReadTimeout] of
/// 10 seconds will be used.
/// Furthermore, the [keepAlivePeriod] defaults to a [defaultKeepAlivePeriod] of
/// 20 seconds.
class MqttConfig {
/// Creates a new [MqttConfig] object.
MqttConfig({
this.defaultReadQoS = QoS.atMostOnce,
this.defaultWriteQoS = QoS.atMostOnce,
this.defaultActionQoS = QoS.atMostOnce,
this.defaultSubscribeQoS = QoS.atLeastOnce,
this.readTimeout = defaultTimeout,
this.discoveryTimeout = defaultTimeout,
this.readTimeout = defaultReadTimeout,
this.keepAlivePeriod = defaultKeepAlivePeriod,
});

Expand All @@ -50,11 +50,6 @@ class MqttConfig {
/// If no value has been read until the timeout has expired, the operation
/// will be canceled.
final Duration readTimeout;

/// Timeout value used for discovery using MQTT.
///
/// The discovery process will be aborted once the timeout has expired.
final Duration discoveryTimeout;
}

/// Enum for indicating the default Quality of Service (QoS) that should be used
Expand Down

0 comments on commit 77e39d6

Please sign in to comment.