pub struct UniversalHidServiceClient<R: ReadWrite> { /* private fields */ }Expand description
Inspect and drive the device’s registered HID surfaces.
Implementations§
Source§impl<R: ReadWrite> UniversalHidServiceClient<R>
impl<R: ReadWrite> UniversalHidServiceClient<R>
pub fn new(inner: RemoteXpcClient<R>) -> Self
Sourcepub async fn list_connected_services(
&mut self,
) -> Result<Vec<HidSurface>, IdeviceError>
pub async fn list_connected_services( &mut self, ) -> Result<Vec<HidSurface>, IdeviceError>
Enumerate the device’s currently-registered HID surfaces.
Sourcepub async fn send_report(
&mut self,
service_id: u64,
report: Vec<u8>,
) -> Result<(), IdeviceError>
pub async fn send_report( &mut self, service_id: u64, report: Vec<u8>, ) -> Result<(), IdeviceError>
Deliver a raw HID report to one of the device’s HID surfaces.
Sourcepub async fn send_digitizer(
&mut self,
x: i32,
y: i32,
service_id: u64,
timestamp: Option<u64>,
) -> Result<(), IdeviceError>
pub async fn send_digitizer( &mut self, x: i32, y: i32, service_id: u64, timestamp: Option<u64>, ) -> Result<(), IdeviceError>
Send a single 19-byte gesture/pointer report at (x, y).
For an actual on-screen touch use
send_touchscreen.
Sourcepub async fn send_touchscreen(
&mut self,
state: u8,
x: u16,
y: u16,
timestamp: Option<u64>,
) -> Result<(), IdeviceError>
pub async fn send_touchscreen( &mut self, state: u8, x: u16, y: u16, timestamp: Option<u64>, ) -> Result<(), IdeviceError>
Send a single 58-byte mainTouchscreen report. state is
TOUCHSCREEN_STATE_CONTACT for an in-progress touch sample or
TOUCHSCREEN_STATE_RELEASE to lift.
Sourcepub async fn tap(&mut self, x: u16, y: u16) -> Result<(), IdeviceError>
pub async fn tap(&mut self, x: u16, y: u16) -> Result<(), IdeviceError>
A tap on the touchscreen: one contact sample, a short hold, then a release at the same point.
Sourcepub async fn drag(
&mut self,
x1: u16,
y1: u16,
x2: u16,
y2: u16,
steps: u32,
delay_ms: u64,
) -> Result<(), IdeviceError>
pub async fn drag( &mut self, x1: u16, y1: u16, x2: u16, y2: u16, steps: u32, delay_ms: u64, ) -> Result<(), IdeviceError>
A drag on the touchscreen from (x1, y1) to (x2, y2): a stream of
steps contact samples advancing linearly, a final contact at the end
point, then a release. delay_ms is slept between samples so the gesture
recognizer sees a velocity (a too-fast drag reads as a tap). This is the
real touch-drag used for scrolling/swiping content. steps is clamped to
at least 1.