Pamoja.Profile
0.1.17
dotnet add package Pamoja.Profile --version 0.1.17
NuGet\Install-Package Pamoja.Profile -Version 0.1.17
<PackageReference Include="Pamoja.Profile" Version="0.1.17" />
<PackageVersion Include="Pamoja.Profile" Version="0.1.17" />
<PackageReference Include="Pamoja.Profile" />
paket add Pamoja.Profile --version 0.1.17
#r "nuget: Pamoja.Profile, 0.1.17"
#:package Pamoja.Profile@0.1.17
#addin nuget:?package=Pamoja.Profile&version=0.1.17
#tool nuget:?package=Pamoja.Profile&version=0.1.17
Pamoja.Profile
Named, ready-to-run device profiles from plain data or a JSON manifest. One capability of pamoja, one memory-safe Rust core with bindings for TypeScript, Python, and C#.
Install
dotnet add package Pamoja.Profile
using Pamoja.Profile;
This pulls in Pamoja.Native, the compiled engine, and Pamoja.Power. dotnet add package Pamoja is the whole framework in one package.
Example
The guide project's example, spliced here as it ran in CI.
From bindings/dotnet/samples/Pamoja.Guides/ProfileGuide.cs:
// A profile is plain data, so a fleet ships one as a file rather than as code. The
// two power thresholds are optional and fall back to the documented defaults.
const string manifest = """
{
"name": "brooder-heater",
"topic": "poultry/brooder/temperature",
"control": {
"kind": "setpoint", "setpoint": 32.0, "hysteresis": 0.5,
"cooling": false, "safe_band": 4.0
},
"power": { "active_secs": 120, "saver_secs": 600, "critical_secs": 1800 }
}
""";
using var profile = Profile.FromJson(manifest);
Console.WriteLine($"{profile.Name} reports on {profile.Topic}");
Console.WriteLine(
$"wakes every {profile.Power.ActiveSecs}s while the battery is healthy");
Console.WriteLine($"saver mode below {profile.Power.SaverBelow * 100:F0}% charge");
// The manifest is the whole control loop. At 27.5 C the reading is below the
// deadband, so the lamp switches on, and it is more than 4 C from target, so the
// chicks are cold.
Reaction cold = profile.Controller().Evaluate(27.5f);
Console.WriteLine($"at 27.5 C: lamp {cold.Actuator}, alert {cold.Alert?.Kind}");
// Back inside the deadband the lamp is left as it was, and nothing is raised.
Reaction settled = profile.Controller().Evaluate(32.2f);
string quiet = settled.Alert?.Kind.ToString() ?? "none";
Console.WriteLine($"at 32.2 C: lamp {settled.Actuator}, alert {quiet}");
// Serializing writes the defaulted fields out in full, so a profile edited on a
// device and shared back carries no value the next reader has to infer.
string shared = profile.ToJson();
Console.WriteLine($"shared form names its defaults: {shared.Contains("saver_below")}");
The same capability in every language
| Language | Package | Reference |
|---|---|---|
| Rust | pamoja-profile |
reference, docs.rs, install |
| TypeScript | @pamoja/profile |
reference, install |
| Python | pamoja-profile |
reference, install |
| C# | Pamoja.Profile |
reference, install |
Documentation
Pamoja.Profilereference, every type in this namespace.- The Device profiles guide, with the same example in Rust, TypeScript, and Python.
- Every capability, and the install page.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Pamoja.Native (>= 0.1.17)
- Pamoja.Power (>= 0.1.17)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Pamoja.Profile:
| Package | Downloads |
|---|---|
|
Pamoja
The whole pamoja framework in one package: every capability of one memory-safe Rust core, behind an idiomatic C# facade, for IoT, robotics, and drones. |
|
|
Pamoja.Profiles
Profiles and robotics: A node instantiated by name with its policy and schedule, and the naming and encoding rules a robot's topics follow, with no ROS 2 or Zenoh installed. |
GitHub repositories
This package is not used by any popular GitHub repositories.