MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / rotate_crown

Method rotate_crown

packages/server/src/native/bridge.rs:738–760  ·  view source on GitHub ↗
(&self, udid: &str, delta: f64)

Source from the content-addressed store, hash-verified

736 }
737
738 pub fn rotate_crown(&self, udid: &str, delta: f64) -> Result<(), AppError> {
739 if !delta.is_finite() {
740 return Err(AppError::bad_request("Digital Crown delta must be finite."));
741 }
742 if self
743 .simulator(udid)
744 .ok()
745 .flatten()
746 .as_ref()
747 .map(|simulator| !simulator_is_watchos(simulator))
748 .unwrap_or(false)
749 {
750 return Err(digital_crown_error());
751 }
752 let udid = CString::new(udid).map_err(|e| AppError::bad_request(e.to_string()))?;
753 unsafe {
754 let mut error = ptr::null_mut();
755 bool_result(
756 ffi::xcw_native_rotate_crown(udid.as_ptr(), delta, &mut error),
757 error,
758 )
759 }
760 }
761
762 pub fn rotate_right(&self, udid: &str) -> Result<(), AppError> {
763 if self.simulator_has_fixed_orientation(udid).unwrap_or(false) {

Callers 4

mainFunction · 0.45
run_batch_stepFunction · 0.45
run_batch_stepFunction · 0.45
run_control_messageFunction · 0.45

Calls 6

simulator_is_watchosFunction · 0.85
digital_crown_errorFunction · 0.85
bool_resultFunction · 0.85
xcw_native_rotate_crownFunction · 0.85
simulatorMethod · 0.80

Tested by

no test coverage detected