org.freedesktop.DeviceKit

org.freedesktop.DeviceKit — DeviceKit interface

Methods

InhibitShutdown       (out 's'             cookie)
UninhibitShutdown     (in  's'             cookie)
EnumerateBySubsystem  (in  'as'            subsystems,
                       out 'a(sssasa{ss})' result)
EnumerateByNativePath (in  'as'            native_paths,
                       out 'a(sssasa{ss})' result)

Signals

DeviceEvent ('s'     action,
             's'     subsystem,
             's'     native_path,
             's'     device_file,
             'as'    device_file_symlinks,
             'a{ss}' properties)

Implemented Interfaces

Objects implementing org.freedesktop.DeviceKit also implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties

Properties

'daemon-version' read      's'

Description

The DeviceKit service is available via the system message bus. To access the service, use the org.freedesktop.DeviceKit interface on the /org/freedesktop/DeviceKit object on the D-Bus system bus service with the well-known name org.freedesktop.DeviceKit.

$ dbus-send --system \
            --print-reply \
            --dest=org.freedesktop.DeviceKit \
            /org/freedesktop/DeviceKit \
            org.freedesktop.DeviceKit.EnumerateBySubsystem \
            array:string:mmc

method return sender=:1.175 -> dest=:1.219 reply_serial=2
   array [
      struct {
         string "mmc"
         string "/sys/devices/pci0000:00/0000:00:1e.0/0000:05:00.2/mmc_host/mmc0/mmc0:e624"
         string ""
         array [
         ]
         array [
            dict entry(
               string "UDEV_LOG"
               string "3"
            )
            dict entry(
               string "SUBSYSTEM"
               string "mmc"
            )
            dict entry(
               string "DEVPATH"
               string "/devices/pci0000:00/0000:00:1e.0/0000:05:00.2/mmc_host/mmc0/mmc0:e624"
            )
            dict entry(
               string "MMC_NAME"
               string "SD04G"
            )
            dict entry(
               string "DRIVER"
               string "mmcblk"
            )
            dict entry(
               string "MMC_TYPE"
               string "SD"
            )
         ]
      }
   ]
            

Details

InhibitShutdown ()

InhibitShutdown (out 's' cookie)

Keep the daemon from exiting on inactivity; this is useful for mechanisms that wants the daemon around for listening on signals.

cookie:

The cookie that is used to stop inhibiting the daemon.


UninhibitShutdown ()

UninhibitShutdown (in  's' cookie)

Allow the daemon to exit when it's inactive. The cookie parameter is the return value from InhibitShutdown().

cookie:

The cookie.


EnumerateBySubsystem ()

EnumerateBySubsystem (in  'as'            subsystems,
                      out 'a(sssasa{ss})' result)

Enumerate devices on the system by subsystem. If the subsystems parameter is empty devices from all subsystems will be returned. See the DeviceEvent() signal for a description of the return value.

subsystems:

List of subsystems to get devices from. If an empty array is passed devices from all subsystems is returned.

result:

The result as an array of structures containing the subsystem, native_path, device_file, device_file_symlinks and properties.


EnumerateByNativePath ()

EnumerateByNativePath (in  'as'            native_paths,
                       out 'a(sssasa{ss})' result)

Enumerate devices on the system given a list of native paths. See the DeviceEvent() signal for a description of the return value.

native_paths:

List of native paths.

result:

The result as an array of structures containing the subsystem, native_path, device_file, device_file_symlinks and properties.

Signal Details

The DeviceEvent signal

DeviceEvent ('s'     action,
             's'     subsystem,
             's'     native_path,
             's'     device_file,
             'as'    device_file_symlinks,
             'a{ss}' properties)

This signal is emitted when an event occurs on a device such as change, add, remove.

action:

The OS specific event.

subsystem:

The subsystem the device belongs to.

native_path:

The OS specific native path of the device.

device_file:

The UNIX special device file for the device.

device_file_symlinks:

A list of symlinks pointing to the UNIX special device file.

properties:

A set of key/value pairs with OS specific properties for the device.

Property Details

The "daemon-version" property

'daemon-version'  read      's'

Version of the running daemon, e.g. 002.