pub struct PowerReadback { /* private fields */ }Expand description
One commissioned MMXU total active power mapping. Configure distinct mappings for independently monitored sources. A new mapping starts without a sample.
Implementations§
Source§impl PowerReadback
impl PowerReadback
Sourcepub fn new(
domain: &str,
logical_node: &str,
source: MeasurementSource,
peer: Ski,
unit: UnitId,
max_age: Duration,
) -> Result<Self, InvalidMeasurementMapping>
pub fn new( domain: &str, logical_node: &str, source: MeasurementSource, peer: Ski, unit: UnitId, max_age: Duration, ) -> Result<Self, InvalidMeasurementMapping>
Bind MMXU TotW at a logical device and node to an authenticated SHIP identity and the exact SPINE device/entity discovered on that association. Call Self::commission after the actor resolves its measurement descriptions.
Sourcepub fn commission(
&mut self,
peer: &Ski,
engine: &Engine,
actor: &MonitoringApplianceActor,
) -> Result<(), InvalidMeasurementMapping>
pub fn commission( &mut self, peer: &Ski, engine: &Engine, actor: &MonitoringApplianceActor, ) -> Result<(), InvalidMeasurementMapping>
Verify the authenticated session’s advertised use case, exact entity, actor-resolved total-power ID, and original SPINE measurement description in watts. Run this after the initial description exchange and whenever the peer changes its discovery or descriptions. Recommissioning this peer discards the current sample.
Sourcepub fn observe(
&mut self,
source: MeasurementSource,
peer: &Ski,
event: &MonitoringEvent,
utc: Duration,
now: Duration,
)
pub fn observe( &mut self, source: MeasurementSource, peer: &Ski, event: &MonitoringEvent, utc: Duration, now: Duration, )
Feed an event with the use case and authenticated SHIP identity supplied by its connection. Supply synchronized UTC since the Unix epoch at reception and a monotonic reading from the clock used for MMS reads. Only absolute timestamps with a known offset can establish freshness across merged notifications.
Sourcepub fn disconnect(&mut self)
pub fn disconnect(&mut self)
Mark a lost or detached connection unavailable immediately. Reattach the actor and call Self::commission before admitting newer values.
Sourcepub fn answer_read(
&self,
request: &ConfirmedRequest<'_>,
now: Duration,
) -> Answer
pub fn answer_read( &self, request: &ConfirmedRequest<'_>, now: Duration, ) -> Answer
Serve direct named reads of TotW$mag$f (signed watts), TotW$q and
TotW$t. Missing or expired watts return MMS temporarily-unavailable.
Encode the returned answer with the association’s original invoke ID.