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 presentation layer, which declares how a profile appears on a dashboard,
crosses as the JSON object a manifest carries under presentation, through
pamoja_profile_presentation_json and pamoja_profile_with_presentation_json.
That keeps one representation of a profile across every language, and it is
the same JSON the dashboard already consumes; each binding gives it a typed
shape on its own side.
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.
Constants§
- PAMOJA_
ALERT_ CODE_ LEN - The most bytes a custom alert’s code carries across the boundary, terminator included; a longer code is cut to fit.
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_ ⚠control_ kind - Returns the control kind a profile names, as its manifest writes it.
- pamoja_
profile_ ⚠control_ params_ json - Returns the parameters a custom control kind carries, as the JSON object of
every field the manifest wrote beside
kind. - pamoja_
profile_ ⚠controller - Builds the decision logic a profile describes.
- pamoja_
profile_ ⚠description - Returns what a profile is for, in the words its manifest carries.
- 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_ ⚠new - Creates a profile of the host’s own from its parts, with no description and no presentation.
- pamoja_
profile_ ⚠new_ custom - Creates a profile of the host’s own whose control is a kind the library does not ship, decided by code the host registers.
- 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_ ⚠presentation_ json - Returns how a profile presents itself on a dashboard, as the JSON object its
manifest carries under
presentation. - pamoja_
profile_ ⚠reads_ quantity - Returns the quantity a profile says it reads, such as
temperature. - pamoja_
profile_ ⚠reads_ unit - Returns the unit a profile’s numbers are in, such as
celsius. - 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.
- pamoja_
profile_ ⚠with_ description - Returns a copy of a profile carrying a description of what it is for.
- pamoja_
profile_ ⚠with_ presentation_ json - Returns a copy of a profile carrying a dashboard presentation.
- pamoja_
profile_ ⚠with_ reads - Returns a copy of a profile that says what it reads.