Interface UdevDeviceAvailabilityListener

All Superinterfaces:
UdevDeviceListener

public interface UdevDeviceAvailabilityListener extends UdevDeviceListener
Listener interface to listen to device availability. Devices can be owned by different components while they exist and this listener is used to detect when they are claimed or become available again after being released.
Version:
2023-09-18
  • Method Details

    • onDeviceAvailable

      void onDeviceAvailable(UdevService service, UdevDevice device)
      Called when a device is available. This is called after a device has been added as well as when a previously owned device is released. The callback can claim exclusive use of the device by calling UdevService.claimDevice() and release it by calling UdevService.removeOwner() or UdevService.releaseDevice() .
      Parameters:
      service - the UdevService
      device - the available
    • onDeviceUnavailable

      void onDeviceUnavailable(UdevService service, UdevDevice device)
      Called when a UdevDevice is claimed. All listeners will be notified even if they didn't receive a onDeviceAvailable() callback or even if the listener object is the owner.
      Parameters:
      service - the UdevService
      device - the device being removed