AntDevice Class

Base class for all ANT devices.

Definition

Namespace: SmallEarthTech.AntPlus
Assembly: SmallEarthTech.AntPlus (in SmallEarthTech.AntPlus.dll) Version: 7.0.0+09c2d7a7f0bf2c05495d6305ac56abb150641a86
C#
public abstract class AntDevice : ObservableObject, 
	IDisposable
Inheritance
ObservableObject    AntDevice
Derived
More
Implements
IDisposable

Remarks

An important consideration is an appropriate timeout to determine if a device has gone offline - battery has died, device has been turned off, device is out of range of receiver, ane/or the RF environment the device and receiver are operating in. Most devices broadcast at 4Hz, with the notable exception of Geocache and Asset Tracker. A reasonable rule of thumb is to set the timeout at 8 messages times the channel period per second; typically 2 seconds. Consult the device profile documentation at https://www.thisisant.com for a device and consult the channel period defined for master devices.

Constructors

AntDevice(ChannelId, IAntChannel, ILogger, TimeoutOptions) Initializes a new instance of the AntDevice class.
AntDevice(ChannelId, IAntChannel, ILogger, Int32)Initializes a new instance of the AntDevice class.

Properties

ChannelCountThis is a multiple of the base transmission frequency. All derived classes must implement this property. See the master Channel Period specified in the specific ANT device specification for the count value.
ChannelIdGets the channel identifier.
DeviceImageStreamGets the device image stream from the embedded resource image associated with the derived device class.
OfflineGets a value indicating whether this AntDevice is offline.

Methods

Dispose Releases the resources used by the current instance of the class.
OnUnknownDataPageReceived(Byte) Raises the UnknownDataPageReceived event with the provided raw data page bytes.
OnUnknownDataPageReceivedTEnum(Int32, Byte) Raises the UnknownDataPageReceived event with the provided raw data page bytes and includes the data page index in the log.
ParseParses the specified data page.
RequestDataPageTRequests the data page.
SendExtAcknowledgedMessageSends an acknowledged message to the ANT device.
ToString Returns a string representation of the current derived AntDevice.

Events

DeviceWentOfflineOccurs when no messages have been received from the device within the specified timeout duration.
UnknownDataPageReceived Occurs when an unrecognized data page is received and provides the raw page bytes to subscribers.

Fields

_loggerThe logger for derived classes to use.

See Also