Main Page | Modules | Data Structures | File List | Data Fields | Related Pages

D-BUS interface org.freedesktop.Hal.Device
[HAL daemon]

D-BUS interface for generic device operations. More...

Data Structures

struct  PendingUpdate_s
 Structure for queing updates. More...


Defines

#define MAX_CAP_SIZE   2048
 Maximum string length for capabilities; quite a hack :-/.


Typedefs

typedef PendingUpdate_s PendingUpdate
 Structure for queing updates.


Functions

gboolean foreach_property_append (HalDevice *device, HalProperty *p, gpointer user_data)
DBusHandlerResult device_get_all_properties (DBusConnection *connection, DBusMessage *message)
 Get all properties on a device.

DBusHandlerResult device_get_property (DBusConnection *connection, DBusMessage *message)
 Get a property on a device.

DBusHandlerResult device_get_property_type (DBusConnection *connection, DBusMessage *message)
 Get the type of a property on a device.

DBusHandlerResult device_set_property (DBusConnection *connection, DBusMessage *message)
 Set a property on a device.

DBusHandlerResult device_add_capability (DBusConnection *connection, DBusMessage *message)
 This function is used to modify the Capabilities property.

DBusHandlerResult device_remove_property (DBusConnection *connection, DBusMessage *message)
 Remove a property on a device.

DBusHandlerResult device_property_exists (DBusConnection *connection, DBusMessage *message)
 Determine if a property exists.

DBusHandlerResult device_query_capability (DBusConnection *connection, DBusMessage *message)
 Determine if a device got a capability.

void device_property_atomic_update_begin (void)
 Begin an atomic update - this is useful for updating several properties in one go.

void device_property_atomic_update_end (void)
 End an atomic update.

void device_send_signal_property_modified (HalDevice *device, const char *key, dbus_bool_t added, dbus_bool_t removed)
void device_send_signal_condition (HalDevice *device, const char *condition_name, int first_arg_type,...)
 Emits a condition on a device; the device has to be in the GDL for this function to have effect.


Variables

int atomic_count = 0
 Counter for atomic updating.

int num_pending_updates = 0
 Number of updates pending.

PendingUpdatepending_updates_head = NULL

Detailed Description

D-BUS interface for generic device operations.


Function Documentation

DBusHandlerResult device_add_capability DBusConnection *  connection,
DBusMessage *  message
 

This function is used to modify the Capabilities property.

The reason for having a dedicated function is that the HAL daemon will broadcast a signal on the Manager interface to tell applications that the device have got a new capability.

This is useful as capabilities can be merged after the device is created. One example of this is networking cards under Linux 2.6; the net.ethernet capability is not merged when the device is initially found by looking in /sys/devices; it is merged when the /sys/classes tree is searched.

Note that the signal is emitted every time this method is invoked even though the capability already existed. This is useful in the above scenario when the PCI class says ethernet networking card but we yet don't have enough information to fill in the net.* and net.ethernet.* fields since this only happens when we visit the /sys/classes tree.

void Device.AddCapability(string capability)

raises org.freedesktop.Hal.NoSuchDevice,

Parameters:
connection D-BUS connection
message Message
Returns:
What to do with the message

Definition at line 933 of file hald_dbus.c.

References DIE, manager_send_signal_new_capability(), MAX_CAP_SIZE, raise_no_such_device(), and raise_syntax().

Referenced by filter_function().

DBusHandlerResult device_get_all_properties DBusConnection *  connection,
DBusMessage *  message
 

Get all properties on a device.

map{string, any} Device.GetAllProperties()

raises org.freedesktop.Hal.NoSuchDevice

Parameters:
connection D-BUS connection
message Message
Returns:
What to do with the message

Definition at line 607 of file hald_dbus.c.

References DIE, and raise_no_such_device().

Referenced by filter_function().

DBusHandlerResult device_get_property DBusConnection *  connection,
DBusMessage *  message
 

Get a property on a device.

any Device.GetProperty(string key) string Device.GetPropertyString(string key) int Device.GetPropertyInteger(string key) bool Device.GetPropertyBoolean(string key) double Device.GetPropertyDouble(string key)

raises org.freedesktop.Hal.NoSuchDevice, org.freedesktop.Hal.NoSuchProperty

Parameters:
connection D-BUS connection
message Message
Returns:
What to do with the message

Definition at line 664 of file hald_dbus.c.

References DIE, raise_no_such_device(), raise_no_such_property(), and raise_syntax().

Referenced by filter_function().

DBusHandlerResult device_get_property_type DBusConnection *  connection,
DBusMessage *  message
 

Get the type of a property on a device.

int Device.GetPropertyType(string key)

raises org.freedesktop.Hal.NoSuchDevice, org.freedesktop.Hal.NoSuchProperty

Parameters:
connection D-BUS connection
message Message
Returns:
What to do with the message

Definition at line 752 of file hald_dbus.c.

References DIE, raise_no_such_device(), raise_no_such_property(), and raise_syntax().

Referenced by filter_function().

void device_property_atomic_update_begin void   ) 
 

Begin an atomic update - this is useful for updating several properties in one go.

Note that an atomic update is recursive - use with caution!

Definition at line 1191 of file hald_dbus.c.

References atomic_count.

Referenced by force_unmount().

void device_property_atomic_update_end void   ) 
 

End an atomic update.

Note that an atomic update is recursive - use with caution!

Definition at line 1201 of file hald_dbus.c.

References PendingUpdate_s::added, atomic_count, DIE, PendingUpdate_s::key, PendingUpdate_s::next, num_pending_updates, PendingUpdate, PendingUpdate_s::removed, and PendingUpdate_s::udi.

Referenced by force_unmount().

DBusHandlerResult device_property_exists DBusConnection *  connection,
DBusMessage *  message
 

Determine if a property exists.

bool Device.PropertyExists(string key)

raises org.freedesktop.Hal.NoSuchDevice,

Parameters:
connection D-BUS connection
message Message
Returns:
What to do with the message

Definition at line 1061 of file hald_dbus.c.

References DIE, raise_no_such_device(), and raise_syntax().

Referenced by filter_function().

DBusHandlerResult device_query_capability DBusConnection *  connection,
DBusMessage *  message
 

Determine if a device got a capability.

bool Device.QueryCapability(string capability_name)

raises org.freedesktop.Hal.NoSuchDevice,

Parameters:
connection D-BUS connection
message Message
Returns:
What to do with the message

Definition at line 1117 of file hald_dbus.c.

References DIE, raise_no_such_device(), and raise_syntax().

Referenced by filter_function().

DBusHandlerResult device_remove_property DBusConnection *  connection,
DBusMessage *  message
 

Remove a property on a device.

void Device.RemoveProperty(string key)

raises org.freedesktop.Hal.NoSuchDevice, org.freedesktop.Hal.NoSuchProperty

Parameters:
connection D-BUS connection
message Message
Returns:
What to do with the message

Definition at line 1004 of file hald_dbus.c.

References DIE, raise_no_such_device(), raise_no_such_property(), and raise_syntax().

Referenced by filter_function().

void device_send_signal_condition HalDevice *  device,
const char *  condition_name,
int  first_arg_type,
  ...
 

Emits a condition on a device; the device has to be in the GDL for this function to have effect.

Is intended for non-continuous events on the device like ProcesserOverheating, BlockDeviceGotDevice, e.g. conditions that are exceptional and may not be inferred by looking at properties (though some may).

This function accepts a number of parameters that are passed along in the D-BUS message. The recipient is supposed to extract the parameters himself, by looking at the HAL specification.

Parameters:
udi The UDI for this device
condition_name Name of condition
first_arg_type Type of the first argument
... value of first argument, list of additional type-value pairs. Must be terminated with DBUS_TYPE_INVALID

Definition at line 1347 of file hald_dbus.c.

References DIE.

Referenced by force_unmount(), and force_unmount_of_all_childs().

DBusHandlerResult device_set_property DBusConnection *  connection,
DBusMessage *  message
 

Set a property on a device.

void Device.SetProperty(string key, any value) void Device.SetPropertyString(string key, string value) void Device.SetPropertyInteger(string key, int value) void Device.SetPropertyBoolean(string key, bool value) void Device.SetPropertyDouble(string key, double value)

raises org.freedesktop.Hal.NoSuchDevice, org.freedesktop.Hal.NoSuchProperty org.freedesktop.Hal.TypeMismatch

Parameters:
connection D-BUS connection
message Message
Returns:
What to do with the message

Todo:
check permissions of the sender vs property to be modified

Definition at line 824 of file hald_dbus.c.

References DIE, raise_no_such_device(), raise_property_type_error(), and raise_syntax().

Referenced by filter_function().


Generated on Sat Apr 24 19:57:47 2004 for HAL by doxygen 1.3.6-20040222