Device


Object Hierarchy:

GUdev.Device GUdev.Device GUdev.Device GLib.Object GLib.Object GLib.Object->GUdev.Device

Description:

[ CCode ( type_id = "g_udev_device_get_type ()" ) ]
public class Device : Object

The Device class is used to get information about a specific device.

Note that you cannot instantiate a Device object yourself. Instead you must use Client to obtain Device objects.

To get basic information about a device, use get_subsystem, get_devtype, get_name, get_number, get_sysfs_path, get_driver, get_action, get_seqnum , get_device_type, get_device_number, get_device_file, get_device_file_symlinks.

To navigate the device tree, use get_parent and get_parent_with_subsystem.

To access udev properties for the device, use get_property_keys, has_property, get_property, get_property_as_int, get_property_as_uint64, get_property_as_double, get_property_as_boolean and get_property_as_strv.

To access sysfs attributes for the device, use get_sysfs_attr_keys, has_sysfs_attr, get_sysfs_attr, get_sysfs_attr_as_int, get_sysfs_attr_as_uint64, get_sysfs_attr_as_double, get_sysfs_attr_as_boolean and get_sysfs_attr_as_strv.

Note that all getters on Device are non-reffing – returned values are owned by the object, should not be freed and are only valid as long as the object is alive.

By design, Device will not react to changes for a device – it only contains a snapshot of information when the Device object was created. To work with changes, you typically connect to the uevent signal on a Client and get a new Device whenever an event happens.


Namespace: GUdev
Package: gudev-1.0

Content:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class GLib.Object



2022 vala-language.org