pub enum DeviceWatcherRequest {
WatchDevices {
responder: DeviceWatcherWatchDevicesResponder,
},
ConnectToDevice {
id: u64,
request: ServerEnd<DeviceMarker>,
control_handle: DeviceWatcherControlHandle,
},
}
Expand description
The DeviceWatcher provides clients a mechanism to discover camera devices present on the system. This is a temporary mechanism intended to be replaced by go/drivers-as-components, which will allow multiple instances of the same protocol to exist side-by-side. Clients are not required to maintain a connection to the Watcher in order to use established Camera connections.
Variants§
WatchDevices
Returns a list of available camera IDs when it has changed from the previously returned
list of IDs, or when it is called by a client for the first time. The returned list may be
empty, indicating no cameras are available. The IDs returned to the client will remain
consistent with respect to the physical devices they represent for the duration of the
client’s connection. Events will be sorted first by event type - existing
, added
,
removed
. Within each event type range, IDs will be provided in ascending order. Events
are coalesced by the server, so a given ID will only appear once in each list of events.
Please note that it is entirely possible for the list returned to be temporarily empty even if the local camera hardware is hardwired (vs plug-in like USB). The empty list condition is temporary on such a platform.
Camera applications should tolerate an empty list returned, and attempt to retry the
WatchDevices()
call.
Fields
responder: DeviceWatcherWatchDevicesResponder
ConnectToDevice
Acquires a camera interface for the given ID. If any clients already exist for this camera, the request is closed with the ZX_ERR_ALREADY_BOUND epitaph.
Implementations§
Source§impl DeviceWatcherRequest
impl DeviceWatcherRequest
pub fn into_watch_devices(self) -> Option<DeviceWatcherWatchDevicesResponder>
pub fn into_connect_to_device( self, ) -> Option<(u64, ServerEnd<DeviceMarker>, DeviceWatcherControlHandle)>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL