![]() |
VOOZH | about |
dotnet add package nanoFramework.System.Device.Model --version 1.2.862
NuGet\Install-Package nanoFramework.System.Device.Model -Version 1.2.862
<PackageReference Include="nanoFramework.System.Device.Model" Version="1.2.862" />
<PackageVersion Include="nanoFramework.System.Device.Model" Version="1.2.862" />Directory.Packages.props
<PackageReference Include="nanoFramework.System.Device.Model" />Project file
paket add nanoFramework.System.Device.Model --version 1.2.862
#r "nuget: nanoFramework.System.Device.Model, 1.2.862"
#:package nanoFramework.System.Device.Model@1.2.862
#addin nuget:?package=nanoFramework.System.Device.Model&version=1.2.862Install as a Cake Addin
#tool nuget:?package=nanoFramework.System.Device.Model&version=1.2.862Install as a Cake Tool
This library is experimental, it may change and it may be moved to a different package in the future. Avoid taking direct dependency on it.
This library provides a set of attributes which allow to annotate devices.
They can be used for:
Model is representing language independent description of the device. The attributes represent a C# mapping from C# types into the model.
Every class producing telemetry or exposing some commands should put a telemetry attribute on it
[Interface("LPS25H - Piezoresistive pressure and thermometer sensor")]
public class Lps25h : IDisposable
[Interface(...)] attribute:
Every method or property producing telemetry should have [Telemetry] attribute on it.
For properties providing name of the Telemetry is optional as it can be deduced from the property name.
Telemetry can be put on:
out argument
out arguments are currently out of scope but are considered [Telemetry]
public Temperature Temperature => Temperature.FromDegreesCelsius(42.5f + ReadInt16(Register.Temperature) / 480f);
[Telemetry("Humidity")]
public bool TryReadHumidity(out RelativeHumidity humidity) => TryReadHumidityCore(out humidity);
[Telemetry("Pressure")]
public Pressure ReadPressure() { /*...*/ }
Vector3) it should have additional displayName providedTelemetry attribute with the same name on the same InterfaceProperties should be put on properties or methods which describe the device or change its functioning. They should only be used on things which don't change value between calls (unless it's been written to or a command has been executed on the device). Specifially reading (telemetry) from the device should not change the state of the property.
Usage is similar to Telemetry with some additions:
PowerMode) is used on i.e. SetPowerMode and ReadPowerMode they will be merged into a single model property[Property]
public Sampling HumiditySampling { get { /*...*/ } set { /* ... */ } }
[Property("PowerMode")]
public void SetPowerMode(Bme680PowerMode powerMode) { /*...*/ }
[Property("PowerMode")]
public Bme680PowerMode ReadPowerMode() { /*...*/ }
Components represent references to other (instances) of interfaces.
They can only be put on the properties, the return type of the property or its ancestor class should have an Interface attribute.
[Component]
public SenseHatTemperatureAndHumidity TemperatureAndHumidity { get; private set; }
// ...
public class SenseHatTemperatureAndHumidity : Hts221.Hts221 { /* ... */ }
// ...
[Interface("HTS221 - Capacitive digital sensor for relative humidity and temperature")]
public class Hts221 : IDisposable { /* ... */ }
Commands can be something which can be executed on the device and they can be put only on methods.
[Command]
public void PlayTone(double frequency, int duraton) { /* ... */ }
[Command]
protected override void SetDefaultConfiguration() { /* ... */ }
Only simple types can be serialized:
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net net is compatible. |
Showing the top 5 NuGet packages that depend on nanoFramework.System.Device.Model:
| Package | Downloads |
|---|---|
|
nanoFramework.Iot.Device.Mpu6886
This package includes the .NET IoT Core binding Iot.Device.Mpu6886 for .NET nanoFramework C# projects. |
|
|
nanoFramework.Iot.Device.Buzzer
This package includes the .NET IoT Core binding Iot.Device.Buzzer for .NET nanoFramework C# projects. |
|
|
nanoFramework.Iot.Device.Bmm150
This package includes the .NET IoT Core binding Iot.Device.Bmm150 for .NET nanoFramework C# projects. |
|
|
nanoFramework.Iot.Device.Bmxx80
This package includes the .NET IoT Core binding Iot.Device.Bmxx80 for .NET nanoFramework C# projects. |
|
|
nanoFramework.MagicBit
This package includes nanoFramework.MagicBit, a board package library for MagicBit in .NET nanoFramework C# projects. |
Showing the top 2 popular GitHub repositories that depend on nanoFramework.System.Device.Model:
| Repository | Stars |
|---|---|
|
nanoframework/Samples
🍬 Code samples from the nanoFramework team used in testing, proof of concepts and other explorational endeavours
|
|
|
nanoframework/nanoFramework.M5Stack
📦 Board support package for M5Stack, M5StickC and M5StickCPlus for .NET nanoFramework
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0-preview.77 | 517 | 5/27/2026 |
| 2.0.0-preview.54 | 709 | 5/11/2026 |
| 2.0.0-preview.42 | 322 | 4/29/2026 |
| 2.0.0-preview.29 | 209 | 4/20/2026 |
| 2.0.0-preview.4 | 301 | 1/19/2026 |
| 2.0.0-preview.3 | 93 | 1/13/2026 |
| 1.2.862 | 13,131 | 4/2/2025 |
| 1.2.848 | 4,023 | 3/10/2025 |
| 1.2.807 | 6,322 | 2/25/2025 |
| 1.2.771 | 4,946 | 2/4/2025 |
| 1.2.751 | 5,066 | 1/31/2025 |
| 1.2.693 | 10,100 | 12/16/2024 |
| 1.2.670 | 4,059 | 10/23/2024 |
| 1.2.628 | 9,691 | 8/28/2024 |
| 1.2.586 | 7,717 | 7/12/2024 |
| 1.2.418 | 25,509 | 11/9/2023 |
| 1.2.415 | 2,969 | 11/8/2023 |
| 1.2.414 | 257 | 11/8/2023 |
| 1.2.325 | 30,599 | 5/24/2023 |
| 1.2.295 | 10,708 | 5/3/2023 |