| Modifier and Type | Class and Description |
|---|---|
| public static class | Udev.UdevContext
All functions require a libudev context to operate. |
| public static class | Udev.UdevDevice
To introspect a local device on a system, a udev device object can be created
via |
| public static class | Udev.UdevEnumerate
To enumerate local devices on the system, an enumeration object can be
created via |
| public static class | Udev.UdevListEntry
Whenever libudev returns a list of objects, the |
| Modifier and Type | Field and Description |
|---|---|
| public static final Udev |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: 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.A udev device object. udev_deviceGets the devnode of a udev device |
| public String | Returns: 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.A udev device object. udev_deviceGets the devtype of a udev device |
| public Udev. | Returns: 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.A udev device object. udev_deviceGets the parent of a udev device |
| public Udev. | Returns: 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.A udev device object. udev_device,The subsystem to match subsystem, String The device type to match devtype)Gets the parent of a udev device matching a subsystem and devtype |
| public String | Returns: a pointer to a constant string of the requested value. On error, NULL is returned.A udev device object. udev_device,The property to retrieve. key)Retrieves a device property from a udev device. |
| public String | Returns: 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.A udev device object. udev_deviceGets the subsystem of a udev device |
| public String | Returns: 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.A udev device object. udev_device,The attribute to retrieve. sysattr)Retrieves a device attributesfrom a udev device. |
| public String | Returns: 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.A udev device object. udev_deviceGets the sysname of a udev device |
| public String | Returns: 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.A udev device object. udev_deviceGets the syspath of a udev device |
| public Udev. | Returns: a pointer to the allocated udev device. On failure, NULL is returned, anderrno is set appropriately.A udev context object. udev,The path of the device in syspath)/sys.Allocates a new udev device object and returns a pointer to it. |
| public Udev. | Returns: the argument that was passed, unmodified.A udev device object. udev_deviceAcquire further references to a udev device object. |
| public Udev. | Returns: always returns NULL.A udev device object. udev_deviceDrop a reference to a udev device object. |
| public int | Returns: an integer greater than, or equal to, 0 on success.The udev enumerate object to modify. udev_enumerate,The subsystem to match subsystem)Modify filters of a udev enumerate object to match a subsystem. |
| public Udev. | Returns: 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.The udev enumerate object. udev_enumerateGet the first list entry from a udev enumerate object. |
| public Udev. | Returns: On success, returns a pointer to the allocated udev monitor. On failure, NULL is returned.A udev context object. udevCreate a udev enumerate object. |
| public Udev. | Returns: the argument that was passed, unmodified.A udev enumerate object. udev_enumerateAcquire further references to a udev enumerate object. |
| public int | Returns: an integer greater than, or equal to, 0 on success.The udev enumerate object, with optional filters. udev_enumerateQuery a udev enumerate object. |
| public Udev. | Returns: always returns NULL.A udev enumerate object. udev_enumerateDrop a reference to a udev enumerate object. |
| public String | Returns: 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.A udev list entry list_entryGet the name of the udev list entry |
| public Udev. | Returns: On success, returns a pointer to the next list entry. If no such entry can be found, or on failure, NULL is returned.the current list entry list_entryGets the next entry in the enumeration. |
| public Udev. | Returns: On success, returns a pointer to the allocated udev context. On failure, NULL is returned.Allocates a new udev context object and returns a pointer to it. |
| public Udev. | Returns: the argument that was passed, unmodified.A udev context object. udevAcquire further references to a udev context object. |
| public Udev. | Returns: always returns NULL.A udev context object. udevDrop a reference to a udev context object. |
| INSTANCE | back to summary |
|---|---|
| public static final Udev INSTANCE | |
| udev_device_get_devnode | back to summary |
|---|---|
| public String udev_device_get_devnode(Udev. Gets the devnode of a udev device
| |
| udev_device_get_devtype | back to summary |
|---|---|
| public String udev_device_get_devtype(Udev. Gets the devtype of a udev device
| |
| udev_device_get_parent | back to summary |
|---|---|
| public Udev. Gets the parent of a udev device
| |
| udev_device_get_parent_with_subsystem_devtype | back to summary |
|---|---|
| public Udev. Gets the parent of a udev device matching a subsystem and devtype
| |
| udev_device_get_property_value | back to summary |
|---|---|
| public String udev_device_get_property_value(Udev. Retrieves a device property from a udev device.
| |
| udev_device_get_subsystem | back to summary |
|---|---|
| public String udev_device_get_subsystem(Udev. Gets the subsystem of a udev device
| |
| udev_device_get_sysattr_value | back to summary |
|---|---|
| public String udev_device_get_sysattr_value(Udev. Retrieves a device attributesfrom a udev device.
| |
| udev_device_get_sysname | back to summary |
|---|---|
| public String udev_device_get_sysname(Udev. Gets the sysname of a udev device
| |
| udev_device_get_syspath | back to summary |
|---|---|
| public String udev_device_get_syspath(Udev. Gets the syspath of a udev device
| |
| udev_device_new_from_syspath | back to summary |
|---|---|
| public Udev. 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
| |
| udev_device_ref | back to summary |
|---|---|
| public Udev. Acquire further references to a udev device object.
| |
| udev_device_unref | back to summary |
|---|---|
| public Udev. Drop a reference to a udev device object. Once the reference count hits 0, the device object is destroyed and freed.
| |
| udev_enumerate_add_match_subsystem | back to summary |
|---|---|
| public int udev_enumerate_add_match_subsystem(Udev. Modify filters of a udev enumerate object to match a subsystem.
| |
| udev_enumerate_get_list_entry | back to summary |
|---|---|
| public Udev. Get the first list entry from a udev enumerate object.
| |
| udev_enumerate_new | back to summary |
|---|---|
| public Udev. Create a udev enumerate object. Initially, the reference count of the enumerate object is 1.
| |
| udev_enumerate_ref | back to summary |
|---|---|
| public Udev. Acquire further references to a udev enumerate object.
| |
| udev_enumerate_scan_devices | back to summary |
|---|---|
| public int udev_enumerate_scan_devices(Udev. Query a udev enumerate object. Scans
| |
| udev_enumerate_unref | back to summary |
|---|---|
| public Udev. Drop a reference to a udev enumerate object. Once the reference count hits 0, the enumerate object is destroyed and freed.
| |
| udev_list_entry_get_name | back to summary |
|---|---|
| public String udev_list_entry_get_name(Udev. Get the name of the udev list entry
| |
| udev_list_entry_get_next | back to summary |
|---|---|
| public Udev. Gets the next entry in the enumeration.
| |
| udev_new | back to summary |
|---|---|
| public Udev. 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.
| |
| udev_ref | back to summary |
|---|---|
| public Udev. Acquire further references to a udev context object.
| |
| udev_unref | back to summary |
|---|---|
| public Udev. Drop a reference to a udev context object. Once the reference count hits 0, the context object is destroyed and freed.
| |
udev_new. It is used to track library state and link
objects together. No global state is used by libudev, everything is always
linked to a udev context. Furthermore, multiple different udev contexts can
be used in parallel by multiple threads. However, a single context must not
be accessed by multiple threads in parallel. The caller is responsible for
providing suitable locking if they intend to use it from multiple threads.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Udev. | Returns: the allocated udev device. On failure, NULL is returned, anderrno is set appropriately.The path of the device in syspath)/sys.Creates a udev device object based on information found in |
| public Udev. | Returns: On success, returns the allocated enumerator. On failure, NULL is returned.Create a udev enumerate object. |
| public Udev. | |
| public void |
| UdevContext | back to summary |
|---|---|
| public UdevContext() | |
| deviceNewFromSyspath | back to summary |
|---|---|
| public Udev. Creates a udev device object based on information found in
| |
| enumerateNew | back to summary |
|---|---|
| public Udev. Create a udev enumerate object. Initially, the reference count of the enumerate object is 1.
| |
| ref | back to summary |
|---|---|
| public Udev. Acquire a further reference to this object.
| |
| unref | back to summary |
|---|---|
| public void unref() Drop a reference to this object. Once the reference count hits 0, the context object is destroyed and freed. | |
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.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: a string that describes the devnode. On failure, may return NULL.Gets the devnode of this device |
| public String | Returns: a string that describes the devtype. On failure, may return NULL.Gets the devtype of this device |
| public Udev. | Returns: 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.Gets the parent of this device |
| public Udev. | Returns: 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.The subsystem to match subsystem, String The device type to match devtype)Gets the parent of this device matching a subsystem and devtype |
| public String | Returns: a string of the requested value. On error, NULL is returned.The property to retrieve. key)Retrieves a device property from this device |
| public String | Returns: a string that describes the subsystem. On failure, may return NULL.Gets the subsystem of this device |
| public String | Returns: 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.The attribute to retrieve. sysattr)Retrieves a device attribute from this device |
| public String | Returns: a string that describes the sysname. On failure, may return NULL.Gets the sysname of this device |
| public String | Returns: a string that describes the syspath. On failure, may return NULL.Gets the syspath of this device |
| public Udev. | |
| public void |
| UdevDevice | back to summary |
|---|---|
| public UdevDevice() | |
| getDevnode | back to summary |
|---|---|
| public String getDevnode() Gets the devnode of this device
| |
| getDevtype | back to summary |
|---|---|
| public String getDevtype() Gets the devtype of this device
| |
| getParent | back to summary |
|---|---|
| public Udev. Gets the parent of this device
| |
| getParentWithSubsystemDevtype | back to summary |
|---|---|
| public Udev. Gets the parent of this device matching a subsystem and devtype
| |
| getPropertyValue | back to summary |
|---|---|
| public String getPropertyValue(String key) Retrieves a device property from this device | |
| getSubsystem | back to summary |
|---|---|
| public String getSubsystem() Gets the subsystem of this device
| |
| getSysattrValue | back to summary |
|---|---|
| public String getSysattrValue(String sysattr) Retrieves a device attribute from this device | |
| getSysname | back to summary |
|---|---|
| public String getSysname() Gets the sysname of this device
| |
| getSyspath | back to summary |
|---|---|
| public String getSyspath() Gets the syspath of this device
| |
| ref | back to summary |
|---|---|
| public Udev. Acquire a further reference to this object.
| |
| unref | back to summary |
|---|---|
| public void unref() Drop a reference to this object. Once the reference count hits 0, the context object is destroyed and freed. | |
UdevContext#enumerateNew().
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: an integer greater than, or equal to, 0 on success.The subsystem to match subsystem)Modify filters of this object to match a subsystem. |
| public Udev. | Returns: On success, returns the first entry in the list of found devices. If the list is empty, or on failure, NULL is returned.Get the first list entry from this object. |
| public Udev. | |
| public int | |
| public void |
| UdevEnumerate | back to summary |
|---|---|
| public UdevEnumerate() | |
| addMatchSubsystem | back to summary |
|---|---|
| public int addMatchSubsystem(String subsystem) Modify filters of this object to match a subsystem.
| |
| getListEntry | back to summary |
|---|---|
| public Udev. Get the first list entry from this object.
| |
| ref | back to summary |
|---|---|
| public Udev. Acquire a further reference to this object.
| |
| scanDevices | back to summary |
|---|---|
| public int scanDevices() Query this object. Scans
| |
| unref | back to summary |
|---|---|
| public void unref() Drop a reference to this object. Once the reference count hits 0, the context object is destroyed and freed. | |
udev_list_entry API
should be used to iterate, access and modify those lists.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: A string representing the syspath. On failure, NULL is returned.Get the name of this entry, which is the path of the device in |
| public Udev. | Returns: On success, returns the next list entry. If no such entry can be found, or on failure, NULL is returned.Gets the next entry in the enumeration. |
| UdevListEntry | back to summary |
|---|---|
| public UdevListEntry() | |
| getName | back to summary |
|---|---|
| public String getName() Get the name of this entry, which is the path of the device in
| |
| getNext | back to summary |
|---|---|
| public Udev. Gets the next entry in the enumeration.
| |