(&self, udid: &str, button: &str, duration_ms: u32)
| 691 | } |
| 692 | |
| 693 | pub fn press_button(&self, udid: &str, button: &str, duration_ms: u32) -> Result<(), AppError> { |
| 694 | let udid = CString::new(udid).map_err(|e| AppError::bad_request(e.to_string()))?; |
| 695 | let button = CString::new(button).map_err(|e| AppError::bad_request(e.to_string()))?; |
| 696 | unsafe { |
| 697 | let mut error = ptr::null_mut(); |
| 698 | bool_result( |
| 699 | ffi::xcw_native_press_button( |
| 700 | udid.as_ptr(), |
| 701 | button.as_ptr(), |
| 702 | duration_ms, |
| 703 | &mut error, |
| 704 | ), |
| 705 | error, |
| 706 | ) |
| 707 | } |
| 708 | } |
| 709 | |
| 710 | pub fn send_button( |
| 711 | &self, |
no test coverage detected