SmallEarthTech.AntPlus.Extensions.Hosting
1.0.0
dotnet add package SmallEarthTech.AntPlus.Extensions.Hosting --version 1.0.0
NuGet\Install-Package SmallEarthTech.AntPlus.Extensions.Hosting -Version 1.0.0
<PackageReference Include="SmallEarthTech.AntPlus.Extensions.Hosting" Version="1.0.0" />
paket add SmallEarthTech.AntPlus.Extensions.Hosting --version 1.0.0
#r "nuget: SmallEarthTech.AntPlus.Extensions.Hosting, 1.0.0"
// Install SmallEarthTech.AntPlus.Extensions.Hosting as a Cake Addin #addin nuget:?package=SmallEarthTech.AntPlus.Extensions.Hosting&version=1.0.0 // Install SmallEarthTech.AntPlus.Extensions.Hosting as a Cake Tool #tool nuget:?package=SmallEarthTech.AntPlus.Extensions.Hosting&version=1.0.0
Small Earth Technology ANT+ Hosting Extensions
If you use dependency injection to compose your apps, check this extension out! With a few lines added to the DI container/host builder, the complete library is ready to be used by the app. Here's a snippet from the WPF sample -
// dependency services
_host = Host.CreateDefaultBuilder(Environment.GetCommandLineArgs()).
UseSerilog().
UseAntPlus(). // this adds all the required dependencies to use the ANT+ class library
ConfigureServices(services =>
{
// add the implementation of IAntRadio to the host
services.AddSingleton<IAntRadio, AntRadio>();
}).
Build();
.
.
.
// create the device collection - this starts scanning for devices
AntDevices = _host.Services.GetRequiredService<AntCollection>();
MAUI apps can also invoke UseAntPlus()
to add the dependencies to MauiApp.CreateBuilder()
.
An ==important== benefit of using dependency injection is that you can now add ANT devices not supported by the current ANT+ Class Library. A detailed guide on how to do this is available in the documentation. You can also set the global ANT device timeout from a variety of sources such as the command line, appsettings.json, etc. and let the DI container inject them into the ANT+ Class Library.
Addtional Links
- Documentation
- Examples Overview
- Issues - Mention hosting extensions in the issue title.
- Discussions - Post questions and join discussions.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Microsoft.Extensions.Hosting (>= 8.0.0)
- Microsoft.Maui.Core (>= 8.0.80)
- SmallEarthTech.AntPlus (>= 4.0.0)
- SmallEarthTech.AntRadioInterface (>= 3.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 136 | 8/24/2024 |
Hosting extensions for the ANT+ Class Library supporting .NET MAUI and Window applications using depencency injection (made easy!).