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...

Defines

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


Functions

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.


Detailed Description

D-BUS interface for generic device operations.


Function Documentation

DBusHandlerResult device_add_capability DBusConnection *  connection,
DBusMessage *  message
[static]
 

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 919 of file main.c.

References DIE, ds_device_find(), ds_property_get_string(), ds_property_set_string(), HalDevice, HalDevice_s::in_gdl, 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
[static]
 

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 552 of file main.c.

References DIE, ds_device_find(), ds_property_iter_begin(), ds_property_iter_get(), ds_property_iter_get_bool(), ds_property_iter_get_double(), ds_property_iter_get_int(), ds_property_iter_get_key(), ds_property_iter_get_string(), ds_property_iter_get_type(), ds_property_iter_has_more(), ds_property_iter_next(), HalDevice, HalProperty, HalPropertyIterator, and raise_no_such_device().

Referenced by filter_function().

DBusHandlerResult device_get_property DBusConnection *  connection,
DBusMessage *  message
[static]
 

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 645 of file main.c.

References DIE, ds_device_find(), ds_property_find(), ds_property_iter_get_bool(), ds_property_iter_get_double(), ds_property_iter_get_int(), ds_property_iter_get_string(), ds_property_iter_get_type(), HalDevice, HalProperty, raise_no_such_device(), raise_no_such_property(), and raise_syntax().

Referenced by filter_function().

DBusHandlerResult device_get_property_type DBusConnection *  connection,
DBusMessage *  message
[static]
 

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 737 of file main.c.

References DIE, ds_device_find(), ds_property_find(), ds_property_iter_get_type(), HalDevice, HalProperty, raise_no_such_device(), raise_no_such_property(), and raise_syntax().

Referenced by filter_function().

DBusHandlerResult device_property_exists DBusConnection *  connection,
DBusMessage *  message
[static]
 

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 1057 of file main.c.

References DIE, ds_device_find(), ds_property_exists(), HalDevice, raise_no_such_device(), and raise_syntax().

Referenced by filter_function().

DBusHandlerResult device_query_capability DBusConnection *  connection,
DBusMessage *  message
[static]
 

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 1114 of file main.c.

References DIE, ds_device_find(), ds_property_get_string(), HalDevice, raise_no_such_device(), and raise_syntax().

Referenced by filter_function().

DBusHandlerResult device_remove_property DBusConnection *  connection,
DBusMessage *  message
[static]
 

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 997 of file main.c.

References DIE, ds_device_find(), ds_property_remove(), HalDevice, raise_no_such_device(), raise_no_such_property(), and raise_syntax().

Referenced by filter_function().

DBusHandlerResult device_set_property DBusConnection *  connection,
DBusMessage *  message
[static]
 

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 810 of file main.c.

References DIE, ds_device_find(), ds_property_set_bool(), ds_property_set_double(), ds_property_set_int(), ds_property_set_string(), HalDevice, raise_no_such_device(), raise_property_type_error(), and raise_syntax().

Referenced by filter_function().


Generated on Sat Feb 7 22:11:50 2004 for HAL by doxygen 1.3.5