pub struct DeviceMockController { /* private fields */ }Expand description
Controller allowing programmatic mutation of simulated device telemetry and sensors.
Implementations§
Source§impl DeviceMockController
impl DeviceMockController
Sourcepub fn new() -> Self
pub fn new() -> Self
Obtains a controller handle connected to the global hardware telemetry simulation.
Sourcepub fn reset_to_defaults(&self)
pub fn reset_to_defaults(&self)
Resets all simulated device telemetry and sensors to standard factory defaults.
Sourcepub fn battery(&self) -> BatteryInfo
pub fn battery(&self) -> BatteryInfo
Gets a copy of current battery info.
Sourcepub fn set_battery(&self, info: BatteryInfo)
pub fn set_battery(&self, info: BatteryInfo)
Updates battery info and notifies reactive signals.
Sourcepub fn set_battery_level(&self, level: f32)
pub fn set_battery_level(&self, level: f32)
Updates battery level in range [0.0, 1.0].
Sourcepub fn thermal(&self) -> ThermalState
pub fn thermal(&self) -> ThermalState
Gets current thermal state.
Sourcepub fn set_thermal(&self, state: ThermalState)
pub fn set_thermal(&self, state: ThermalState)
Updates thermal state and notifies reactive signals.
Sourcepub fn network(&self) -> NetworkStatus
pub fn network(&self) -> NetworkStatus
Gets current network status.
Sourcepub fn set_network(&self, status: NetworkStatus)
pub fn set_network(&self, status: NetworkStatus)
Updates network status and notifies reactive signals.
Sourcepub fn set_online(&self, is_online: bool)
pub fn set_online(&self, is_online: bool)
Sets online status.
Sourcepub fn screen(&self) -> ScreenGeometry
pub fn screen(&self) -> ScreenGeometry
Gets current screen geometry.
Sourcepub fn set_screen(&self, screen: ScreenGeometry)
pub fn set_screen(&self, screen: ScreenGeometry)
Updates screen geometry and notifies reactive signals.
Sourcepub fn set_safe_area(&self, insets: SafeAreaInsets)
pub fn set_safe_area(&self, insets: SafeAreaInsets)
Sets screen safe area insets (notches, dynamic island).
Sourcepub fn display_refresh(&self) -> DisplayRefreshInfo
pub fn display_refresh(&self) -> DisplayRefreshInfo
Gets current display refresh info.
Sourcepub fn set_display_refresh(&self, info: DisplayRefreshInfo)
pub fn set_display_refresh(&self, info: DisplayRefreshInfo)
Updates display refresh characteristics and capabilities.
Sourcepub fn geolocation(&self) -> GeolocationInfo
pub fn geolocation(&self) -> GeolocationInfo
Gets current geolocation telemetry snapshot.
Sourcepub fn set_geolocation(&self, info: GeolocationInfo)
pub fn set_geolocation(&self, info: GeolocationInfo)
Sets full geolocation telemetry and notifies reactive use_geolocation() signals.
Sourcepub fn set_coordinates(
&self,
latitude: f64,
longitude: f64,
altitude_m: Option<f64>,
accuracy_m: f64,
)
pub fn set_coordinates( &self, latitude: f64, longitude: f64, altitude_m: Option<f64>, accuracy_m: f64, )
Convenience helper injecting a deterministic MockOverride geolocation fix.
Sourcepub fn clear_geolocation(&self)
pub fn clear_geolocation(&self)
Clears any simulated geolocation fix back to unavailable (GeolocationSource::None).
Sourcepub fn compass(&self) -> CompassReading
pub fn compass(&self) -> CompassReading
Gets current compass / magnetometer reading.
Sourcepub fn set_compass(&self, reading: CompassReading)
pub fn set_compass(&self, reading: CompassReading)
Updates compass / magnetometer reading and notifies reactive use_compass() signals.
Sourcepub fn imu(&self) -> ImuReading
pub fn imu(&self) -> ImuReading
Gets current 6-DoF IMU reading.
Sourcepub fn set_imu(&self, reading: ImuReading)
pub fn set_imu(&self, reading: ImuReading)
Updates 6-DoF IMU reading and notifies reactive use_imu() signals.
Sourcepub fn barometer(&self) -> BarometerReading
pub fn barometer(&self) -> BarometerReading
Gets current barometric pressure reading.
Sourcepub fn set_barometer(&self, reading: BarometerReading)
pub fn set_barometer(&self, reading: BarometerReading)
Updates barometric pressure reading and notifies reactive use_barometer() signals.
Sourcepub fn ambient_light(&self) -> AmbientLightReading
pub fn ambient_light(&self) -> AmbientLightReading
Gets current ambient light sensor reading.
Sourcepub fn set_ambient_light(&self, reading: AmbientLightReading)
pub fn set_ambient_light(&self, reading: AmbientLightReading)
Updates ambient light sensor reading and notifies reactive use_ambient_light() signals.
pub fn proximity(&self) -> ProximityReading
pub fn set_proximity(&self, reading: ProximityReading)
pub fn hinge_angle(&self) -> HingeAngleReading
pub fn set_hinge_angle(&self, reading: HingeAngleReading)
pub fn radio_signal(&self) -> RadioSignalReading
pub fn set_radio_signal(&self, reading: RadioSignalReading)
pub fn ambient_spl(&self) -> AmbientSplReading
pub fn set_ambient_spl(&self, reading: AmbientSplReading)
pub fn pedometer(&self) -> PedometerReading
pub fn set_pedometer(&self, reading: PedometerReading)
pub fn heart_rate(&self) -> HeartRateReading
pub fn set_heart_rate(&self, reading: HeartRateReading)
Sourcepub fn trigger_memory_pressure(&self, level: MemoryPressure)
pub fn trigger_memory_pressure(&self, level: MemoryPressure)
Triggers a system memory pressure notification across all registered callbacks.