Package com.sun.jna.platform.linux
Schnittstelle Udev
- Alle Superschnittstellen:
Library
libudev.h provides APIs to introspect and enumerate devices on the local
system. Udev objects are opaque and must not be accessed by the caller via
different means than functions provided by libudev.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypSchnittstelleBeschreibungstatic class
All functions require a libudev context to operate.static class
To introspect a local device on a system, a udev device object can be created viaUdev.UdevContext.deviceNewFromSyspath(String)
and friends.static class
To enumerate local devices on the system, an enumeration object can be created viaUdev.UdevContext.enumerateNew()
.static class
Whenever libudev returns a list of objects, theudev_list_entry
API should be used to iterate, access and modify those lists.Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen com.sun.jna.Library
Library.Handler
-
Feldübersicht
FelderVon Schnittstelle geerbte Felder com.sun.jna.Library
OPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_CLASSLOADER, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_OPEN_FLAGS, OPTION_STRING_ENCODING, OPTION_STRUCTURE_ALIGNMENT, OPTION_SYMBOL_PROVIDER, OPTION_TYPE_MAPPER
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungudev_device_get_devnode
(Udev.UdevDevice udev_device) Gets the devnode of a udev deviceudev_device_get_devtype
(Udev.UdevDevice udev_device) Gets the devtype of a udev deviceudev_device_get_parent
(Udev.UdevDevice udev_device) Gets the parent of a udev deviceudev_device_get_parent_with_subsystem_devtype
(Udev.UdevDevice udev_device, String subsystem, String devtype) Gets the parent of a udev device matching a subsystem and devtypeudev_device_get_property_value
(Udev.UdevDevice udev_device, String key) Retrieves a device property from a udev device.udev_device_get_subsystem
(Udev.UdevDevice udev_device) Gets the subsystem of a udev deviceudev_device_get_sysattr_value
(Udev.UdevDevice udev_device, String sysattr) Retrieves a device attributesfrom a udev device.udev_device_get_sysname
(Udev.UdevDevice udev_device) Gets the sysname of a udev deviceudev_device_get_syspath
(Udev.UdevDevice udev_device) Gets the syspath of a udev deviceudev_device_new_from_syspath
(Udev.UdevContext udev, String syspath) Allocates a new udev device object and returns a pointer to it.udev_device_ref
(Udev.UdevDevice udev_device) Acquire further references to a udev device object.udev_device_unref
(Udev.UdevDevice udev_device) Drop a reference to a udev device object.int
udev_enumerate_add_match_subsystem
(Udev.UdevEnumerate udev_enumerate, String subsystem) Modify filters of a udev enumerate object to match a subsystem.udev_enumerate_get_list_entry
(Udev.UdevEnumerate udev_enumerate) Get the first list entry from a udev enumerate object.Create a udev enumerate object.udev_enumerate_ref
(Udev.UdevEnumerate udev_enumerate) Acquire further references to a udev enumerate object.int
udev_enumerate_scan_devices
(Udev.UdevEnumerate udev_enumerate) Query a udev enumerate object.udev_enumerate_unref
(Udev.UdevEnumerate udev_enumerate) Drop a reference to a udev enumerate object.udev_list_entry_get_name
(Udev.UdevListEntry list_entry) Get the name of the udev list entryudev_list_entry_get_next
(Udev.UdevListEntry list_entry) Gets the next entry in the enumeration.udev_new()
Allocates a new udev context object and returns a pointer to it.udev_ref
(Udev.UdevContext udev) Acquire further references to a udev context object.udev_unref
(Udev.UdevContext udev) Drop a reference to a udev context object.
-
Felddetails
-
INSTANCE
-
-
Methodendetails
-
udev_new
Udev.UdevContext udev_new()Allocates a new udev context object and returns a pointer to it. This object is opaque and must not be accessed by the caller via different means than functions provided by libudev. Initially, the reference count of the context is 1.- Gibt zurück:
- On success, returns a pointer to the allocated udev context. On failure, NULL is returned.
-
udev_ref
Acquire further references to a udev context object.- Parameter:
udev
- A udev context object.- Gibt zurück:
- the argument that was passed, unmodified.
-
udev_unref
Drop a reference to a udev context object. Once the reference count hits 0, the context object is destroyed and freed.- Parameter:
udev
- A udev context object.- Gibt zurück:
- always returns NULL.
-
udev_device_new_from_syspath
Allocates a new udev device object and returns a pointer to it. This object is opaque and must not be accessed by the caller via different means than functions provided by libudev. Initially, the reference count of the device is 1.Creates the device object based on information found in
/sys
, annotated with properties from the udev-internal device database. A syspath is any subdirectory of/sys
, with the restriction that a subdirectory of/sys/devices
(or a symlink to one) represents a real device and as such must contain a uevent file.- Parameter:
udev
- A udev context object.syspath
- The path of the device in/sys
.- Gibt zurück:
- a pointer to the allocated udev device. On failure, NULL is returned,
and
errno
is set appropriately.
-
udev_enumerate_new
Create a udev enumerate object. Initially, the reference count of the enumerate object is 1.- Parameter:
udev
- A udev context object.- Gibt zurück:
- On success, returns a pointer to the allocated udev monitor. On failure, NULL is returned.
-
udev_enumerate_ref
Acquire further references to a udev enumerate object.- Parameter:
udev_enumerate
- A udev enumerate object.- Gibt zurück:
- the argument that was passed, unmodified.
-
udev_enumerate_unref
Drop a reference to a udev enumerate object. Once the reference count hits 0, the enumerate object is destroyed and freed.- Parameter:
udev_enumerate
- A udev enumerate object.- Gibt zurück:
- always returns NULL.
-
udev_enumerate_add_match_subsystem
Modify filters of a udev enumerate object to match a subsystem.- Parameter:
udev_enumerate
- The udev enumerate object to modify.subsystem
- The subsystem to match- Gibt zurück:
- an integer greater than, or equal to, 0 on success.
-
udev_enumerate_scan_devices
Query a udev enumerate object. Scans/sys
for all devices which match the given filters. No matches will return all currently available devices.- Parameter:
udev_enumerate
- The udev enumerate object, with optional filters.- Gibt zurück:
- an integer greater than, or equal to, 0 on success.
-
udev_enumerate_get_list_entry
Get the first list entry from a udev enumerate object.- Parameter:
udev_enumerate
- The udev enumerate object.- Gibt zurück:
- On success, returns a pointer to the first entry in the list of found devices. If the list is empty, or on failure, NULL is returned.
-
udev_list_entry_get_next
Gets the next entry in the enumeration.- Parameter:
list_entry
- the current list entry- Gibt zurück:
- On success, returns a pointer to the next list entry. If no such entry can be found, or on failure, NULL is returned.
-
udev_list_entry_get_name
Get the name of the udev list entry- Parameter:
list_entry
- A udev list entry- Gibt zurück:
- a pointer to a constant string representing the requested value. The string is bound to the lifetime of the list entry itself. On failure, NULL is returned.
-
udev_device_ref
Acquire further references to a udev device object.- Parameter:
udev_device
- A udev device object.- Gibt zurück:
- the argument that was passed, unmodified.
-
udev_device_unref
Drop a reference to a udev device object. Once the reference count hits 0, the device object is destroyed and freed.- Parameter:
udev_device
- A udev device object.- Gibt zurück:
- always returns NULL.
-
udev_device_get_parent
Gets the parent of a udev device- Parameter:
udev_device
- A udev device object.- Gibt zurück:
- a pointer to the parent device. No additional reference to this device is acquired, but the child device owns a reference to such a parent device. On failure, NULL is returned.
-
udev_device_get_parent_with_subsystem_devtype
Udev.UdevDevice udev_device_get_parent_with_subsystem_devtype(Udev.UdevDevice udev_device, String subsystem, String devtype) Gets the parent of a udev device matching a subsystem and devtype- Parameter:
udev_device
- A udev device object.subsystem
- The subsystem to matchdevtype
- The device type to match- Gibt zurück:
- a pointer to the parent device. No additional reference to this device is acquired, but the child device owns a reference to such a parent device. On failure, NULL is returned.
-
udev_device_get_syspath
Gets the syspath of a udev device- Parameter:
udev_device
- A udev device object.- Gibt zurück:
- a pointer to a constant string that describes the syspath. The lifetime of this string is bound to the device it was requested on. On failure, may return NULL.
-
udev_device_get_sysname
Gets the sysname of a udev device- Parameter:
udev_device
- A udev device object.- Gibt zurück:
- a pointer to a constant string that describes the sysname. The lifetime of this string is bound to the device it was requested on. On failure, may return NULL.
-
udev_device_get_devnode
Gets the devnode of a udev device- Parameter:
udev_device
- A udev device object.- Gibt zurück:
- a pointer to a constant string that describes the devnode. The lifetime of this string is bound to the device it was requested on. On failure, may return NULL.
-
udev_device_get_devtype
Gets the devtype of a udev device- Parameter:
udev_device
- A udev device object.- Gibt zurück:
- a pointer to a constant string that describes the devtype. The lifetime of this string is bound to the device it was requested on. On failure, may return NULL.
-
udev_device_get_subsystem
Gets the subsystem of a udev device- Parameter:
udev_device
- A udev device object.- Gibt zurück:
- a pointer to a constant string that describes the subsystem. The lifetime of this string is bound to the device it was requested on. On failure, may return NULL.
-
udev_device_get_sysattr_value
Retrieves a device attributesfrom a udev device.- Parameter:
udev_device
- A udev device object.sysattr
- The attribute to retrieve.- Gibt zurück:
- a pointer to a constant 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.
-
udev_device_get_property_value
Retrieves a device property from a udev device.- Parameter:
udev_device
- A udev device object.key
- The property to retrieve.- Gibt zurück:
- a pointer to a constant string of the requested value. On error, NULL is returned.
-