Table of Contents

Class Profile

Namespace
Pamoja.Profile
Assembly
Pamoja.Profile.dll

A named, ready-to-run node assembled from pamoja capabilities.

public sealed class Profile : IDisposable
Inheritance
Profile
Implements
Inherited Members

Remarks

A profile is a pre-wired bundle: a control policy, a publish topic, and a power schedule. Instantiate one rather than choosing algorithms and tuning constants by hand. The presentation a dashboard reads travels inside the manifest JSON, so ToJson() carries the whole profile.

Properties

Control

Gets the control policy applied to each reading.

public ControlPolicy Control { get; }

Property Value

ControlPolicy

Name

Gets the profile's stable, human-readable name.

public string Name { get; }

Property Value

string

Power

Gets the sampling schedule kept as the battery drains.

public PowerSchedule Power { get; }

Property Value

PowerSchedule

PowerPlan

Gets the schedule assembled into a power governor.

public PowerPlan PowerPlan { get; }

Property Value

PowerPlan

Topic

Gets the topic each reading is published to.

public string Topic { get; }

Property Value

string

Methods

Controller()

Builds the decision logic this profile describes.

public Controller Controller()

Returns

Controller

The controller, which the caller disposes.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

FloodSensor()

A flood sensor, which warns when a level rises too fast.

public static Profile FloodSensor()

Returns

Profile

The profile.

FromJson(string)

Loads a profile from its JSON manifest.

public static Profile FromJson(string manifest)

Parameters

manifest string

The manifest.

Returns

Profile

The profile.

Exceptions

PamojaException

The manifest is malformed.

IrrigationNode()

An irrigation node, which opens a valve as soil moisture falls.

public static Profile IrrigationNode()

Returns

Profile

The profile.

ToJson()

Serializes this profile to its JSON manifest.

public string ToJson()

Returns

string

The manifest.

Exceptions

PamojaException

The profile cannot be serialized.

VaccineFridgeMonitor()

A cold-chain fridge monitor, which holds 5 C and flags an excursion.

public static Profile VaccineFridgeMonitor()

Returns

Profile

The profile.

WellLevel()

A well-level monitor, which warns before a tank runs dry.

public static Profile WellLevel()

Returns

Profile

The profile.