Class Udev.UdevEnumerate

java.lang.Object
com.sun.jna.PointerType
oshi.jna.platform.linux.Udev.UdevEnumerate
All Implemented Interfaces:
com.sun.jna.NativeMapped
Enclosing interface:
Udev

public static class Udev.UdevEnumerate
extends com.sun.jna.PointerType
To enumerate local devices on the system, an enumeration object can be created via Udev.UdevContext.enumerateNew().
  • Constructor Summary

    Constructors 
    Constructor Description
    UdevEnumerate()  
  • Method Summary

    Modifier and Type Method Description
    int addMatchSubsystem​(java.lang.String subsystem)
    Modify filters of this object to match a subsystem.
    Udev.UdevListEntry getListEntry()
    Get the first list entry from this object.
    Udev.UdevEnumerate ref()
    Acquire a further reference to this object.
    int scanDevices()
    Query this object.
    void unref()
    Drop a reference to this object.

    Methods inherited from class com.sun.jna.PointerType

    equals, fromNative, getPointer, hashCode, nativeType, setPointer, toNative, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • ref

      public Udev.UdevEnumerate ref()
      Acquire a further reference to this object.
      Returns:
      this object, unmodified.
    • unref

      public void unref()
      Drop a reference to this object. Once the reference count hits 0, the context object is destroyed and freed.
    • addMatchSubsystem

      public int addMatchSubsystem​(java.lang.String subsystem)
      Modify filters of this object to match a subsystem.
      Parameters:
      subsystem - The subsystem to match
      Returns:
      an integer greater than, or equal to, 0 on success.
    • scanDevices

      public int scanDevices()
      Query this object. Scans /sys for all devices which match the given filters. No filters will return all currently available devices.
      Returns:
      an integer greater than, or equal to, 0 on success.
    • getListEntry

      public Udev.UdevListEntry getListEntry()
      Get the first list entry from this object.
      Returns:
      On success, returns the first entry in the list of found devices. If the list is empty, or on failure, NULL is returned.