Expand description
The C ABI for device profiles.
These wrap [pamoja_profile] for callers that reach the SDK through the flat
C boundary. A profile is a named, pre-wired bundle: a control policy, a
publish topic, and a power schedule, so someone who can put a sensor to good
use does not also have to choose algorithms and tuning constants by hand.
Two things cross. A PamojaProfile is the manifest, which loads from and
saves to JSON, so a profile ships as a file that a community can publish and
a device can read. A PamojaController is the decision logic that manifest
describes: hand it a reading and it says what the output should do and
whether the reading crossed a threshold worth raising.
The whole presentation layer, which declares how a profile appears on a dashboard, travels inside the manifest JSON rather than as its own set of calls. That keeps one representation of a profile across every language, and it is the same JSON the dashboard already consumes.
Assembling a running node from a profile stays in Rust, because the Rust
Node is generic over its sensor, actuator, transport, and codec, and the
four together do not cross a C ABI. Nothing is lost: the controller holds the
decisions, and the caller drives their own hardware around it.
Structs§
- Pamoja
Control Spec - A control policy, flattened so every variant crosses as one value.
- Pamoja
Controller - An opaque handle to a profile’s decision logic.
- Pamoja
Power Schedule - How often a node samples as its battery drains, in whole seconds.
- Pamoja
Profile - An opaque handle to a device profile.
- Pamoja
Reaction - What a controller decided about one reading.
Enums§
- Pamoja
Alert Kind - Which threshold a reading crossed, if any.
- Pamoja
Control Kind - Which control policy a profile applies to each reading.
Functions§
- pamoja_
controller_ ⚠evaluate - Decides what one reading calls for.
- pamoja_
controller_ ⚠free - Releases a controller handle.
- pamoja_
controller_ level - Creates a controller that warns before a falling level reaches empty.
- pamoja_
controller_ monitor - Creates a controller that reports readings without judging them.
- pamoja_
controller_ setpoint - Creates a controller that holds a reading near a setpoint.
- pamoja_
controller_ surge - Creates a controller that warns when a reading changes too fast.
- pamoja_
profile_ ⚠control - Returns the control policy a profile applies.
- pamoja_
profile_ ⚠controller - Builds the decision logic a profile describes.
- pamoja_
profile_ flood_ sensor - Creates a flood sensor, which warns when a level rises too fast.
- pamoja_
profile_ ⚠free - Releases a profile handle.
- pamoja_
profile_ ⚠from_ json - Loads a profile from its JSON manifest.
- pamoja_
profile_ irrigation_ node - Creates an irrigation node, which opens a valve as soil moisture falls.
- pamoja_
profile_ ⚠name - Returns a profile’s stable name.
- pamoja_
profile_ ⚠power - Returns the sampling schedule a profile keeps as its battery drains.
- pamoja_
profile_ ⚠power_ plan - Assembles a profile’s schedule into a power governor.
- pamoja_
profile_ ⚠to_ json - Serializes a profile to its JSON manifest.
- pamoja_
profile_ ⚠topic - Returns the topic a profile publishes each reading to.
- pamoja_
profile_ vaccine_ fridge_ monitor - Creates a cold-chain fridge monitor, which holds 5 C and flags an excursion.
- pamoja_
profile_ well_ level - Creates a well-level monitor, which warns before a tank runs dry.