MakoIoT.Device
1.0.69.37961
dotnet add package MakoIoT.Device --version 1.0.69.37961
NuGet\Install-Package MakoIoT.Device -Version 1.0.69.37961
<PackageReference Include="MakoIoT.Device" Version="1.0.69.37961" />
paket add MakoIoT.Device --version 1.0.69.37961
#r "nuget: MakoIoT.Device, 1.0.69.37961"
// Install MakoIoT.Device as a Cake Addin #addin nuget:?package=MakoIoT.Device&version=1.0.69.37961 // Install MakoIoT.Device as a Cake Tool #tool nuget:?package=MakoIoT.Device&version=1.0.69.37961
Mako-IoT.Device
This is the composition framework of MAKO-IoT. These components provide backbone for your solution.
Projects structure
Create two nanoFramework projects:
MyProject.Device (nanoFramework Class Library)
Implement your logic here. You will be able to unit test this project (without hardware!). Place everything your software needs to do here, abstracting hardware-specific operations with interfaces. For example, if you want to blink a LED - create IBlinker interface here with void Blink(bool isOn); method.
MyProject.Device.App (nanoFramework Application)
This is the entry point to your software. Use DeviceBuilder to link all components together (MAKO IoT and your code) in the Main() method of Program class. Also, implement your hardware-specific logic here. For example, concrete blinker class for the interface above: LedBlinker : IBlinker. Link the interface with the class in ConfigureDI section of DeviceBuilder.
public class Program
{
public static void Main()
{
DeviceBuilder.Create()
.ConfigureDI(services =>
{
//dependency injection registrations go here
})
//add other MAKO-IoT components & configuration here
.Build()
.Start();
Thread.Sleep(Timeout.InfiniteTimeSpan);
}
}
See Blink sample
Device events
You can attach handlers to DeviceStarting and DeviceStopped events:
var builder = DeviceBuilder.Create();
builder.DeviceStarting += device =>
{
//do something on start
};
builder.DeviceStopped += device =>
{
//do something on stop
};
builder.Build().Start();
Device start behavior
With IDeviceStartBehavior you can intercept device startup. For example, based on certain condition either continue normal operation go into configuration mode.
public class MyDeviceStartBehavior : IDeviceStartBehavior
{
public bool DeviceStarting()
{
if (normalOperationMode)
return true; //continue normal device startup
return false; //don't continue device startup
}
}
public class Program
{
public static void Main()
{
DeviceBuilder.Create()
.ConfigureDI(services =>
{
services.AddSingleton(typeof(IDeviceStartBehavior), typeof(MyDeviceStartBehavior));
}).Build().Start();
Thread.Sleep(Timeout.InfiniteTimeSpan);
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net is compatible. |
-
- MakoIoT.Device.Services.Interface (>= 1.0.48.22567)
- nanoFramework.CoreLibrary (>= 1.15.5)
- nanoFramework.DependencyInjection (>= 1.1.11)
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.69.37961 | 44 | 11/28/2024 |
1.0.67.59807 | 49 | 11/26/2024 |
1.0.66.8997 | 74 | 11/25/2024 |
1.0.65.58783 | 80 | 11/19/2024 |
1.0.64.19809 | 125 | 10/18/2024 |
1.0.63.63404 | 83 | 10/16/2024 |
1.0.62.29514 | 84 | 9/26/2024 |
1.0.61.29719 | 89 | 9/20/2024 |
1.0.60.55995 | 89 | 9/12/2024 |
1.0.59.53404 | 98 | 8/27/2024 |
1.0.58.20500 | 118 | 8/10/2024 |
1.0.57.14777 | 73 | 8/5/2024 |
1.0.56.61472 | 87 | 6/12/2024 |
1.0.55.5721 | 109 | 5/17/2024 |
1.0.54.63609 | 123 | 4/9/2024 |
1.0.53.24180 | 100 | 4/8/2024 |
1.0.52.63211 | 125 | 4/3/2024 |
1.0.51.45151 | 106 | 3/22/2024 |
1.0.50.17678 | 121 | 3/21/2024 |
1.0.49.6323 | 175 | 1/5/2024 |
1.0.48.60571 | 147 | 12/30/2023 |
1.0.47.685 | 158 | 12/7/2023 |
1.0.46.2121 | 128 | 12/1/2023 |
1.0.45.15740 | 150 | 11/17/2023 |
1.0.44.43607 | 122 | 11/16/2023 |
1.0.43.29125 | 122 | 11/11/2023 |
1.0.42.40216 | 126 | 11/10/2023 |
1.0.41.32684 | 125 | 11/8/2023 |
1.0.40.18601 | 131 | 11/7/2023 |
1.0.39.25121 | 118 | 11/7/2023 |
1.0.38.15761 | 162 | 10/10/2023 |
1.0.37.45390 | 148 | 10/7/2023 |
1.0.36.19472 | 131 | 10/6/2023 |
1.0.35.50262 | 122 | 10/6/2023 |
1.0.33.13068 | 208 | 5/25/2023 |
1.0.32.25738 | 176 | 5/24/2023 |
1.0.31.21550 | 184 | 5/24/2023 |
1.0.29.14811 | 172 | 5/22/2023 |
1.0.28.30730 | 157 | 5/22/2023 |
1.0.26.23643 | 162 | 5/22/2023 |
1.0.25.10113 | 170 | 5/22/2023 |
1.0.24.11452 | 179 | 5/22/2023 |