fidl_test_hardwarepowercontrol_common/
fidl_test_hardwarepowercontrol_common.rs1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const DEFAULT_CHARGING_CURRENT_UA: i32 = 250014;
12
13pub const DEFAULT_FULL_CAPACITY_UAH: u32 = 420000;
14
15pub const DEFAULT_LEVEL_PERCENT: f32 = 98.7;
16
17pub const DEFAULT_PRESENT_VOLTAGE_MV: u32 = 4752;
18
19pub const DEFAULT_REMAINING_CHARGE_UAH: u32 = 382000;
20
21pub const DEFAULT_ROUNDED_LEVEL_PERCENT: f32 = 99.0;
22
23pub const DEFAULT_TEMPERATURE_MC: i32 = 380;
24
25#[derive(Clone, Debug, PartialEq)]
26pub struct ControlSetBatteryStatusRequest {
27 pub status: fidl_fuchsia_hardware_power_battery_common::Status,
28}
29
30impl fidl::Persistable for ControlSetBatteryStatusRequest {}
31
32pub mod control_ordinals {
33 pub const SET_BATTERY_STATUS: u64 = 0x4c2c27ba4c60ea21;
34}
35
36mod internal {
37 use super::*;
38
39 impl fidl::encoding::ValueTypeMarker for ControlSetBatteryStatusRequest {
40 type Borrowed<'a> = &'a Self;
41 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
42 value
43 }
44 }
45
46 unsafe impl fidl::encoding::TypeMarker for ControlSetBatteryStatusRequest {
47 type Owned = Self;
48
49 #[inline(always)]
50 fn inline_align(_context: fidl::encoding::Context) -> usize {
51 8
52 }
53
54 #[inline(always)]
55 fn inline_size(_context: fidl::encoding::Context) -> usize {
56 16
57 }
58 }
59
60 unsafe impl<D: fidl::encoding::ResourceDialect>
61 fidl::encoding::Encode<ControlSetBatteryStatusRequest, D>
62 for &ControlSetBatteryStatusRequest
63 {
64 #[inline]
65 unsafe fn encode(
66 self,
67 encoder: &mut fidl::encoding::Encoder<'_, D>,
68 offset: usize,
69 _depth: fidl::encoding::Depth,
70 ) -> fidl::Result<()> {
71 encoder.debug_check_bounds::<ControlSetBatteryStatusRequest>(offset);
72 fidl::encoding::Encode::<ControlSetBatteryStatusRequest, D>::encode(
74 (
75 <fidl_fuchsia_hardware_power_battery_common::Status as fidl::encoding::ValueTypeMarker>::borrow(&self.status),
76 ),
77 encoder, offset, _depth
78 )
79 }
80 }
81 unsafe impl<
82 D: fidl::encoding::ResourceDialect,
83 T0: fidl::encoding::Encode<fidl_fuchsia_hardware_power_battery_common::Status, D>,
84 > fidl::encoding::Encode<ControlSetBatteryStatusRequest, D> for (T0,)
85 {
86 #[inline]
87 unsafe fn encode(
88 self,
89 encoder: &mut fidl::encoding::Encoder<'_, D>,
90 offset: usize,
91 depth: fidl::encoding::Depth,
92 ) -> fidl::Result<()> {
93 encoder.debug_check_bounds::<ControlSetBatteryStatusRequest>(offset);
94 self.0.encode(encoder, offset + 0, depth)?;
98 Ok(())
99 }
100 }
101
102 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
103 for ControlSetBatteryStatusRequest
104 {
105 #[inline(always)]
106 fn new_empty() -> Self {
107 Self { status: fidl::new_empty!(fidl_fuchsia_hardware_power_battery_common::Status, D) }
108 }
109
110 #[inline]
111 unsafe fn decode(
112 &mut self,
113 decoder: &mut fidl::encoding::Decoder<'_, D>,
114 offset: usize,
115 _depth: fidl::encoding::Depth,
116 ) -> fidl::Result<()> {
117 decoder.debug_check_bounds::<Self>(offset);
118 fidl::decode!(
120 fidl_fuchsia_hardware_power_battery_common::Status,
121 D,
122 &mut self.status,
123 decoder,
124 offset + 0,
125 _depth
126 )?;
127 Ok(())
128 }
129 }
130}