![]() |
![]() |
![]() |
DeviceKit Reference Manual | ![]() |
---|---|---|---|---|
DevkitDevicePrivate; DevkitDevice; gboolean (*DevkitDeviceForeachFunc) (DevkitDevice *device, const char *key, const char *value, gpointer user_data); const char* devkit_device_get_subsystem (DevkitDevice *device); const char* devkit_device_get_native_path (DevkitDevice *device); const char* devkit_device_get_device_file (DevkitDevice *device); const char** devkit_device_get_device_file_symlinks (DevkitDevice *device); gboolean devkit_device_properties_foreach (DevkitDevice *device, DevkitDeviceForeachFunc func, gpointer user_data); gboolean devkit_device_has_property (DevkitDevice *device, const char *key); const char* devkit_device_get_property (DevkitDevice *device, const char *key); int devkit_device_get_property_as_int (DevkitDevice *device, const char *key); guint64 devkit_device_get_property_as_uint64 (DevkitDevice *device, const char *key); gboolean devkit_device_get_property_as_boolean (DevkitDevice *device, const char *key); char* devkit_device_dup_property_as_str (DevkitDevice *device, const char *key); char** devkit_device_dup_property_as_strv (DevkitDevice *device, const char *key);
This class wraps details about a device. Instances of this class are returned
to signals handlers for the "device-event" signal and in the result
for enumeration functions such as devkit_client_enumerate_by_subsystem()
.
gboolean (*DevkitDeviceForeachFunc) (DevkitDevice *device, const char *key, const char *value, gpointer user_data);
Callback function used in devkit_device_properties_foreach()
.
|
the DevkitDevice for we are iterating over. |
|
property key. |
|
property value. |
|
user data. |
Returns : |
return TRUE to top the iteration. |
const char* devkit_device_get_subsystem (DevkitDevice *device);
Get the OS specific subsystem for device
.
|
a DevkitDevice. |
Returns : |
the OS-specific subsystem for device .
|
const char* devkit_device_get_native_path (DevkitDevice *device);
Get the OS specific native path for device
.
|
a DevkitDevice. |
Returns : |
the OS-specific native path for device .
|
const char* devkit_device_get_device_file (DevkitDevice *device);
Get the UNIX device file, if any, for device
.
|
a DevkitDevice. |
Returns : |
the UNIX device file for device or NULL if no UNIX device file exists.
|
const char** devkit_device_get_device_file_symlinks (DevkitDevice *device);
Get a list of symlinks (in /dev
) that points to the UNIX device for device
.
|
a DevkitDevice. |
Returns : |
a NULL terminated string array of symlinks. This array is
owned by device and should not be freed by the caller.
|
gboolean devkit_device_properties_foreach (DevkitDevice *device, DevkitDeviceForeachFunc func, gpointer user_data);
Iterates over all properties of device
.
|
a DevkitDevice. |
|
a callback function of type DevkitDeviceForeachFunc |
|
data to pass to func
|
Returns : |
TRUE only if func short-circuited the iteration.
|
gboolean devkit_device_has_property (DevkitDevice *device, const char *key);
Check if a the property with the given key exists.
|
a DevkitDevice. |
|
name of property. |
Returns : |
TRUE only if the value for key exist.
|
const char* devkit_device_get_property (DevkitDevice *device, const char *key);
Look up the value for key
on device
.
|
a DevkitDevice. |
|
name of property. |
Returns : |
the value for key or NULL if key doesn't exist on device .
|
int devkit_device_get_property_as_int (DevkitDevice *device, const char *key);
Look up the value for key
on device
and convert it to an integer.
|
a DevkitDevice. |
|
name of property. |
Returns : |
the value for key or G_MAXINT if key doesn't exist or isn't an integer.
|
guint64 devkit_device_get_property_as_uint64 (DevkitDevice *device, const char *key);
Look up the value for key
on device
and convert it to an unsigned 64-bit integer.
|
a DevkitDevice. |
|
name of property. |
Returns : |
the value for key or G_MAXUINT64 if key doesn't exist or isn't a guint64.
|
gboolean devkit_device_get_property_as_boolean (DevkitDevice *device, const char *key);
Look up the value for key
on device
and convert it to an boolean.
|
a DevkitDevice. |
|
name of property. |
Returns : |
the value for key or FALSE if key doesn't exist or isn't a gboolean.
|
char* devkit_device_dup_property_as_str (DevkitDevice *device, const char *key);
Look up the value for key
on device
and return a duplicate string.
|
a DevkitDevice. |
|
name of property. |
Returns : |
the value of key on device or NULL if key doesn't exist. Caller must free this string with g_free() .
|
char** devkit_device_dup_property_as_strv (DevkitDevice *device, const char *key);
Look up the value for key
on device
and return the result of
splitting it into tokens split at white space points.
|
a DevkitDevice. |
|
name of property. |
Returns : |
the value of key on device split into tokens or NULL if key doesn't exist. Caller must free this string array with g_strfreev() .
|