pub struct OdpmDeviceProxy { /* private fields */ }Implementations§
Source§impl OdpmDeviceProxy
impl OdpmDeviceProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.hardware.google.odpm/OdpmDevice.
Sourcepub fn take_event_stream(&self) -> OdpmDeviceEventStream
pub fn take_event_stream(&self) -> OdpmDeviceEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn get_rail_metadata(
&self,
) -> QueryResponseFut<OdpmDeviceGetRailMetadataResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn get_rail_metadata( &self, ) -> QueryResponseFut<OdpmDeviceGetRailMetadataResult, DefaultFuchsiaResourceDialect> ⓘ
Returns metadata for all actively-monitored rails.
Sourcepub fn get_available_rails(
&self,
) -> QueryResponseFut<OdpmDeviceGetAvailableRailsResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn get_available_rails( &self, ) -> QueryResponseFut<OdpmDeviceGetAvailableRailsResult, DefaultFuchsiaResourceDialect> ⓘ
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,
) -> QueryResponseFut<OdpmDeviceSetChannelRailResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn set_channel_rail( &self, channel_id: u32, rail_name: &str, ) -> QueryResponseFut<OdpmDeviceSetChannelRailResult, DefaultFuchsiaResourceDialect> ⓘ
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,
) -> QueryResponseFut<OdpmDeviceGetPowerWattsResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn get_power_watts( &self, payload: &Options, ) -> QueryResponseFut<OdpmDeviceGetPowerWattsResult, DefaultFuchsiaResourceDialect> ⓘ
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,
) -> QueryResponseFut<OdpmDeviceGetCurrentAmperesResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn get_current_amperes( &self, payload: &Options, ) -> QueryResponseFut<OdpmDeviceGetCurrentAmperesResult, DefaultFuchsiaResourceDialect> ⓘ
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,
) -> QueryResponseFut<OdpmDeviceGetEnergyJoulesResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn get_energy_joules( &self, payload: &Options, ) -> QueryResponseFut<OdpmDeviceGetEnergyJoulesResult, DefaultFuchsiaResourceDialect> ⓘ
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,
) -> QueryResponseFut<OdpmDeviceSetPollingConfigResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn set_polling_config( &self, payload: &PollingConfig, ) -> QueryResponseFut<OdpmDeviceSetPollingConfigResult, DefaultFuchsiaResourceDialect> ⓘ
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,
) -> QueryResponseFut<OdpmDeviceGetPollingConfigResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn get_polling_config( &self, ) -> QueryResponseFut<OdpmDeviceGetPollingConfigResult, DefaultFuchsiaResourceDialect> ⓘ
Retrieves the current polling configuration parameters.
Sourcepub fn reset_polling_config(
&self,
) -> QueryResponseFut<OdpmDeviceResetPollingConfigResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn reset_polling_config( &self, ) -> QueryResponseFut<OdpmDeviceResetPollingConfigResult, DefaultFuchsiaResourceDialect> ⓘ
Resets polling configuration parameters to the driver’s default values.
Trait Implementations§
Source§impl Clone for OdpmDeviceProxy
impl Clone for OdpmDeviceProxy
Source§impl Debug for OdpmDeviceProxy
impl Debug for OdpmDeviceProxy
Source§impl OdpmDeviceProxyInterface for OdpmDeviceProxy
impl OdpmDeviceProxyInterface for OdpmDeviceProxy
type GetRailMetadataResponseFut = QueryResponseFut<Result<Vec<RailMetadata>, i32>>
type GetAvailableRailsResponseFut = QueryResponseFut<Result<Vec<RailMetadata>, i32>>
type SetChannelRailResponseFut = QueryResponseFut<Result<(), i32>>
type GetPowerWattsResponseFut = QueryResponseFut<Result<Vec<PowerReading>, i32>>
type GetCurrentAmperesResponseFut = QueryResponseFut<Result<Vec<CurrentReading>, i32>>
type GetEnergyJoulesResponseFut = QueryResponseFut<Result<Vec<EnergyReading>, i32>>
type SetPollingConfigResponseFut = QueryResponseFut<Result<(), i32>>
type GetPollingConfigResponseFut = QueryResponseFut<Result<PollingConfig, i32>>
type ResetPollingConfigResponseFut = QueryResponseFut<Result<(), i32>>
fn get_rail_metadata(&self) -> Self::GetRailMetadataResponseFut
fn get_available_rails(&self) -> Self::GetAvailableRailsResponseFut
fn set_channel_rail( &self, channel_id: u32, rail_name: &str, ) -> Self::SetChannelRailResponseFut
fn get_power_watts(&self, payload: &Options) -> Self::GetPowerWattsResponseFut
fn get_current_amperes( &self, payload: &Options, ) -> Self::GetCurrentAmperesResponseFut
fn get_energy_joules( &self, payload: &Options, ) -> Self::GetEnergyJoulesResponseFut
fn set_polling_config( &self, payload: &PollingConfig, ) -> Self::SetPollingConfigResponseFut
fn get_polling_config(&self) -> Self::GetPollingConfigResponseFut
fn reset_polling_config(&self) -> Self::ResetPollingConfigResponseFut
Source§impl Proxy for OdpmDeviceProxy
impl Proxy for OdpmDeviceProxy
Source§type Protocol = OdpmDeviceMarker
type Protocol = OdpmDeviceMarker
Proxy controls.