Package com.sun.jna.platform.linux
Klasse Udev.UdevDevice
java.lang.Object
com.sun.jna.PointerType
com.sun.jna.platform.linux.Udev.UdevDevice
- Alle implementierten Schnittstellen:
NativeMapped
- Umschließende Schnittstelle:
Udev
To introspect a local device on a system, a udev device object can be created
via
Udev.UdevContext.deviceNewFromSyspath(String)
and friends. The device
object allows one to query current state, read and write attributes and
lookup properties of the device in question.-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungGets the devnode of this deviceGets the devtype of this deviceGets the parent of this devicegetParentWithSubsystemDevtype
(String subsystem, String devtype) Gets the parent of this device matching a subsystem and devtypegetPropertyValue
(String key) Retrieves a device property from this deviceGets the subsystem of this devicegetSysattrValue
(String sysattr) Retrieves a device attribute from this deviceGets the sysname of this deviceGets the syspath of this deviceref()
Acquire a further reference to this object.void
unref()
Drop a reference to this object.Von Klasse geerbte Methoden com.sun.jna.PointerType
equals, fromNative, getPointer, hashCode, nativeType, setPointer, toNative, toString
-
Konstruktordetails
-
UdevDevice
public UdevDevice()
-
-
Methodendetails
-
ref
Acquire a further reference to this object.- Gibt zurück:
- 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. -
getParent
Gets the parent of this device- Gibt zurück:
- the parent device. No additional reference to this device is acquired, but the child device owns a reference to the parent device. On failure, NULL is returned.
-
getParentWithSubsystemDevtype
Gets the parent of this device matching a subsystem and devtype- Parameter:
subsystem
- The subsystem to matchdevtype
- The device type to match- Gibt zurück:
- the parent device. No additional reference to this device is acquired, but the child device owns a reference to the parent device. On failure, NULL is returned.
-
getSyspath
Gets the syspath of this device- Gibt zurück:
- a string that describes the syspath. On failure, may return NULL.
-
getSysname
Gets the sysname of this device- Gibt zurück:
- a string that describes the sysname. On failure, may return NULL.
-
getDevnode
Gets the devnode of this device- Gibt zurück:
- a string that describes the devnode. On failure, may return NULL.
-
getDevtype
Gets the devtype of this device- Gibt zurück:
- a string that describes the devtype. On failure, may return NULL.
-
getSubsystem
Gets the subsystem of this device- Gibt zurück:
- a string that describes the subsystem. On failure, may return NULL.
-
getSysattrValue
Retrieves a device attribute from this device- Parameter:
sysattr
- The attribute to retrieve.- Gibt zurück:
- a string of the requested value. On error, NULL is returned. Attributes that may contain NUL bytes should not be retrieved with udev_device_get_sysattr_value(); instead, read them directly from the files within the device's syspath.
-
getPropertyValue
Retrieves a device property from this device- Parameter:
key
- The property to retrieve.- Gibt zurück:
- a string of the requested value. On error, NULL is returned.
-