#[non_exhaustive]pub enum Request {
Release,
StartEmulating {
last_serial: u32,
sequence: u32,
},
StopEmulating {
last_serial: u32,
},
Frame {
last_serial: u32,
timestamp: u64,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Release
Notification that the client is no longer interested in this device.
Note that releasing a device does not guarantee another device becomes available.
The EIS implementation will release any resources related to this device and send the ei_device.destroyed event once complete.
StartEmulating
Notify the EIS implementation that the given device is about to start sending events. This should be seen more as a transactional boundary than a time-based boundary. The primary use-cases for this are to allow for setup on the EIS implementation side and/or UI updates to indicate that a device is sending events now and for out-of-band information to sync with a given event sequence.
There is no actual requirement that events start immediately once emulation starts and there is no requirement that a client calls ei_device.stop_emulating after the most recent events. For example, in a remote desktop use-case the client would call ei_device.start_emulating once the remote desktop session starts (rather than when the device sends events) and ei_device.stop_emulating once the remote desktop session stops.
The sequence number identifies this transaction between start/stop emulating. It must go up by at least 1 on each call to ei_device.start_emulating. Wraparound must be handled by the EIS implementation but callers must ensure that detection of wraparound is possible.
It is a protocol violation to request ei_device.start_emulating after ei_device.start_emulating without an intermediate stop_emulating.
It is a protocol violation to send this request for a client of an ei_handshake.context_type other than sender.
Fields
StopEmulating
Notify the EIS implementation that the given device is no longer sending events. See ei_device.start_emulating for details.
It is a protocol violation to send this request for a client of an ei_handshake.context_type other than sender.
Frame
Generate a frame event to group the current set of events into a logical hardware event. This function must be called after one or more events on any of ei_pointer, ei_pointer_absolute, ei_scroll, ei_button, ei_keyboard or ei_touchscreen has been requested by the EIS implementation.
The EIS implementation should not process changes to the device state until the ei_device.frame event. For example, pressing and releasing a key within the same frame is a logical noop.
The given timestamp applies to all events in the current frame. The timestamp must be in microseconds of CLOCK_MONOTONIC.
It is a protocol violation to send this request for a client of an ei_handshake.context_type other than sender.