pub struct OdpmDeviceSynchronousProxy { /* private fields */ }Implementations§
Source§impl OdpmDeviceSynchronousProxy
impl OdpmDeviceSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<OdpmDeviceEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<OdpmDeviceEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
Sourcepub fn get_rail_metadata(
&self,
___deadline: MonotonicInstant,
) -> Result<OdpmDeviceGetRailMetadataResult, Error>
pub fn get_rail_metadata( &self, ___deadline: MonotonicInstant, ) -> Result<OdpmDeviceGetRailMetadataResult, Error>
Returns metadata for all actively-monitored rails.
Sourcepub fn get_available_rails(
&self,
___deadline: MonotonicInstant,
) -> Result<OdpmDeviceGetAvailableRailsResult, Error>
pub fn get_available_rails( &self, ___deadline: MonotonicInstant, ) -> Result<OdpmDeviceGetAvailableRailsResult, Error>
Returns metadata for all available power rails supported by the hardware (both actively-monitored and unmonitored).
measurement_startis reported for rails that are actively monitored or were previously monitored.measurement_stopandenergy_ujare reported only for rails that have been swapped out, retaining only the most recent completed measurement window (rather than an entry per session or an aggregate across sessions). If a stopped rail is swapped back onto an active channel, its previous stopped reading (measurement_stopandenergy_uj) is cleared and a new measurement window begins.
Returns ZX_ERR_INTERNAL if internal rail state cannot be retrieved.
Sourcepub fn set_channel_rail(
&self,
channel_id: u32,
rail_name: &str,
___deadline: MonotonicInstant,
) -> Result<OdpmDeviceSetChannelRailResult, Error>
pub fn set_channel_rail( &self, channel_id: u32, rail_name: &str, ___deadline: MonotonicInstant, ) -> Result<OdpmDeviceSetChannelRailResult, Error>
Reconfigures an internal telemetry channel (channel_id) to monitor rail_name
(matched case-insensitively against name, regulator_name, or schematic_name).
The new assignment is visible to all clients: readings for channel_id from
GetPowerWatts, GetCurrentAmperes, and GetEnergyJoules then refer to rail_name
and restart from a new measurement window. Clients that cache GetRailMetadata can
detect the change by re-querying it and comparing name or measurement_start.
Returns:
ZX_OK(as a no-op) ifchannel_idis already actively monitoringrail_name.ZX_ERR_NOT_FOUNDifrail_namedoes not match any available rail.ZX_ERR_INVALID_ARGSifchannel_idis invalid, is an external shunt channel, or if the requested rail is an external shunt rail or belongs to a different PMIC thanchannel_id.ZX_ERR_ALREADY_BOUNDif the requested rail is already monitored on a different active channel.ZX_ERR_UNAVAILABLEif the hardware operation fails.ZX_ERR_INTERNALif an internal driver error occurs.
Sourcepub fn get_power_watts(
&self,
payload: &Options,
___deadline: MonotonicInstant,
) -> Result<OdpmDeviceGetPowerWattsResult, Error>
pub fn get_power_watts( &self, payload: &Options, ___deadline: MonotonicInstant, ) -> Result<OdpmDeviceGetPowerWattsResult, Error>
Returns the power consumption for all actively-monitored rails.
Returns ZX_ERR_NOT_SUPPORTED if the requested measurement type is not supported.
Returns ZX_ERR_UNAVAILABLE if the hardware read fails.
Returns ZX_ERR_INTERNAL if internal rail state is inconsistent.
Sourcepub fn get_current_amperes(
&self,
payload: &Options,
___deadline: MonotonicInstant,
) -> Result<OdpmDeviceGetCurrentAmperesResult, Error>
pub fn get_current_amperes( &self, payload: &Options, ___deadline: MonotonicInstant, ) -> Result<OdpmDeviceGetCurrentAmperesResult, Error>
Returns the current for all actively-monitored rails.
Returns ZX_ERR_NOT_SUPPORTED if the requested measurement type is not supported.
Returns ZX_ERR_UNAVAILABLE if the hardware read fails.
Returns ZX_ERR_INTERNAL if internal rail state is inconsistent.
Sourcepub fn get_energy_joules(
&self,
payload: &Options,
___deadline: MonotonicInstant,
) -> Result<OdpmDeviceGetEnergyJoulesResult, Error>
pub fn get_energy_joules( &self, payload: &Options, ___deadline: MonotonicInstant, ) -> Result<OdpmDeviceGetEnergyJoulesResult, Error>
Returns the energy consumption for all actively-monitored rails.
Returns ZX_ERR_NOT_SUPPORTED if the requested measurement type is not supported.
Returns ZX_ERR_UNAVAILABLE if the hardware read fails.
Returns ZX_ERR_INTERNAL if internal rail state is inconsistent.
Sourcepub fn set_polling_config(
&self,
payload: &PollingConfig,
___deadline: MonotonicInstant,
) -> Result<OdpmDeviceSetPollingConfigResult, Error>
pub fn set_polling_config( &self, payload: &PollingConfig, ___deadline: MonotonicInstant, ) -> Result<OdpmDeviceSetPollingConfigResult, Error>
Overrides polling configuration parameters. Any omitted fields in PollingConfig
remain unchanged.
Returns ZX_ERR_INVALID_ARGS if poll_interval is less than MIN_POLL_INTERVAL or
polls_per_series_entry == 0.
Sourcepub fn get_polling_config(
&self,
___deadline: MonotonicInstant,
) -> Result<OdpmDeviceGetPollingConfigResult, Error>
pub fn get_polling_config( &self, ___deadline: MonotonicInstant, ) -> Result<OdpmDeviceGetPollingConfigResult, Error>
Retrieves the current polling configuration parameters.
Sourcepub fn reset_polling_config(
&self,
___deadline: MonotonicInstant,
) -> Result<OdpmDeviceResetPollingConfigResult, Error>
pub fn reset_polling_config( &self, ___deadline: MonotonicInstant, ) -> Result<OdpmDeviceResetPollingConfigResult, Error>
Resets polling configuration parameters to the driver’s default values.
Trait Implementations§
Source§impl Debug for OdpmDeviceSynchronousProxy
impl Debug for OdpmDeviceSynchronousProxy
Source§impl From<Channel> for OdpmDeviceSynchronousProxy
Available on Fuchsia only.
impl From<Channel> for OdpmDeviceSynchronousProxy
Source§impl From<OdpmDeviceSynchronousProxy> for NullableHandle
Available on Fuchsia only.
impl From<OdpmDeviceSynchronousProxy> for NullableHandle
Source§fn from(value: OdpmDeviceSynchronousProxy) -> Self
fn from(value: OdpmDeviceSynchronousProxy) -> Self
Source§impl FromClient for OdpmDeviceSynchronousProxy
Available on Fuchsia only.
impl FromClient for OdpmDeviceSynchronousProxy
Source§type Protocol = OdpmDeviceMarker
type Protocol = OdpmDeviceMarker
Source§fn from_client(value: ClientEnd<OdpmDeviceMarker>) -> Self
fn from_client(value: ClientEnd<OdpmDeviceMarker>) -> Self
Source§impl SynchronousProxy for OdpmDeviceSynchronousProxy
Available on Fuchsia only.
impl SynchronousProxy for OdpmDeviceSynchronousProxy
Source§type Proxy = OdpmDeviceProxy
type Proxy = OdpmDeviceProxy
Source§type Protocol = OdpmDeviceMarker
type Protocol = OdpmDeviceMarker
Proxy controls.