TimeoutOptions Class

This class provides timeout options. The AntCollection class uses the options pattern and propagates a timeout to AntDevices that are instantiated by AntCollection.

Definition

Namespace: SmallEarthTech.AntPlus
Assembly: SmallEarthTech.AntPlus (in SmallEarthTech.AntPlus.dll) Version: 4.0.0.0+01fc5ca24e8f030354f28ec9cef320bc5cbb0ef6
C#
public sealed class TimeoutOptions
Inheritance
Object    TimeoutOptions

Remarks

The application host builder retrieves configuration options from various sources such as the command line or appsettings.json. If the configuration can't find TimeoutOptions, the collection will default to MissedMessages. If both Timeout and MissedMessages are defined. Timeout is ignored and MissedMessages is used. Prefer MissedMessages as this will scale the ANT device timeout based on the specific data broadcast rate of an ANT device. Asset trackers broadcast 16 times a second and Geocaches broadcast once every 2 seconds. Other devices typically broadcast 4 times a second.

For example, your appsettings.json file would have this entry -

C#
{
  "TimeoutOptions": {
    "MissedMessages": 8,
    "Timeout": null
  }
}
The command line could define the timeout "--TimeoutOptions:MissedMessages=8".

Timeouts can be disabled by setting Timeout to -1 and ignoring or setting MissedMessages to null.

Constructors

TimeoutOptionsInitializes a new instance of the TimeoutOptions class

Properties

MissedMessages Gets or sets the number of missed messages before an ANT device goes offline.
Timeout Gets or sets the timeout before an ANT device goes offline.

Methods

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also