Examples Overview

These examples illustrate how to use the class libraries.

AntUsbStick Class Library

This example implements the Small Earth Technology ANT radio interface. This class library is used by the example applications. It supports Garmin/Dynastream ANT USB sticks and some development boards with USB interfaces. It is also available on NuGet.

  Important

Projects that consume this library must set the platform target to x86. This is due to the native DLLs that are a part of this library.

AntUsbStick provides two primary classes to consuming applications - AntRadio and AntChannel. AntRadio handles global ANT USB stick radio settings and operation. AntChannel handles individual channel configuration and communication with ANT devices.

AntRadio implements IAntRadio, IAntConfiguration, IAntControl, ICrypto, IFitSettings, and IAntUsbRadio interfaces. This is specific to Garmin/Dynastream ANT USB sticks. UsbAntResponse derives from AntResponse. It provides access to ANT response messages specific to Garmin/Dynastream ANT USB sticks. UsbDeviceCapabilities derives from DeviceCapabilities. It provides access to ANT device capabilities specific to Garmin/Dynastream ANT USB sticks.

WpfUsbStickApp WPF Application

The WpfUsbStickApp example demonstrates a host builder, using the hosting extensions, connecting to a Garmin/Dynastream ANT USB stick, enumerating ANT devices via the AntCollection service, and interacting with ANT devices. The ANT USB stick class library is initialized for continuous receive scan mode.

  Note

This project uses the AntUsbSick library. Therefore, the platform target is set to x86. This is due to the native DLLs that are a part of this project.

AntMulticastServer Console Application

  Caution

This application is no longer being updated or maintained. It was intended to support Xamarin apps. Xamarin has been superceded by .NET MAUI.

This application creates an IPv6 UdpClient bound to port number 2000. The UdpClient directs all messages received from the AntDeviceCollection to the multicast group [::] (all interfaces on the local subnet), port number 55436. A Xamarin client example (Android only) is available as a separate solution at XamAntClientApp.

.NET MAUI/gRPC Example Projects

This group of examples is comprised of four projects. AntGrpcShared is a class library providing a gRPC client/server to be consumed by the other projects. AntGrpcService is a Windows service that provides services to connect to and communicate with an ANT USB stick. The MauiAntClientApp is a .NET MAUI project and gRPC client that is used to demonstrate Windows/Android applications that work with the remote server application on a local subnet. I have not tested the other platforms supported by .NET MAUI.

See the MAUI-gRPC Examples topic for more information.