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

List HAL devices
[Misc tools for HAL]

A commandline tool, lshal, for displaying and, optionally, monitor the devices managed by the HAL daemon. Uses libhal. More...

Defines

#define DIE(expr)   do {printf("*** [DIE] %s:%s():%d : ", __FILE__, __FUNCTION__, __LINE__); printf expr; printf("\n"); exit(1); } while(0)
 Macro for terminating the program on an unrecoverable error.


Functions

void dump_devices ()
 Dump all devices to stdout.

void device_added (const char *udi)
 Invoked when a device is added to the Global Device List.

void device_removed (const char *udi)
 Invoked when a device is removed from the Global Device List.

void device_new_capability (const char *udi, const char *capability)
 Invoked when device in the Global Device List acquires a new capability.

void print_property (const char *udi, const char *key)
 Acquires and prints the value of of a property to stderr.

void property_modified (const char *udi, const char *key, dbus_bool_t is_removed, dbus_bool_t is_added)
 Invoked when a property of a device in the Global Device List is changed, and we have we have subscribed to changes for that device.

void device_condition (const char *udi, const char *condition_name, DBusMessage *message)
 Invoked when a property of a device in the Global Device List is changed, and we have we have subscribed to changes for that device.

void mainloop_integration (DBusConnection *dbus_connection)
 Invoked by libhal for integration with our mainloop.

void usage (int argc, char *argv[])
 Print out program usage.

int main (int argc, char *argv[])
 Entry point.


Detailed Description

A commandline tool, lshal, for displaying and, optionally, monitor the devices managed by the HAL daemon. Uses libhal.


Function Documentation

void device_added const char *  udi  )  [static]
 

Invoked when a device is added to the Global Device List.

Simply prints a message on stderr.

Parameters:
udi Universal Device Id

Definition at line 144 of file lshal.c.

References dump_devices().

Referenced by main().

void device_condition const char *  udi,
const char *  condition_name,
DBusMessage *  message
[static]
 

Invoked when a property of a device in the Global Device List is changed, and we have we have subscribed to changes for that device.

Parameters:
udi Univerisal Device Id
condition_name Name of condition
message D-BUS message with parameters

Todo:
FIXME print out message

Definition at line 252 of file lshal.c.

Referenced by main().

void device_new_capability const char *  udi,
const char *  capability
[static]
 

Invoked when device in the Global Device List acquires a new capability.

Prints the name of the capability to stderr.

Parameters:
udi Universal Device Id
capability Name of capability

Definition at line 169 of file lshal.c.

Referenced by main().

void device_removed const char *  udi  )  [static]
 

Invoked when a device is removed from the Global Device List.

Simply prints a message on stderr.

Parameters:
udi Universal Device Id

Definition at line 156 of file lshal.c.

References dump_devices().

Referenced by main().

int main int  argc,
char *  argv[]
 

Entry point.

Parameters:
argc Number of arguments given to program
argv Arguments given to program
Returns:
Return code

Definition at line 301 of file lshal.c.

References device_added(), device_condition(), device_new_capability(), device_removed(), dump_devices(), hal_device_property_watch_all(), hal_initialize(), hal_shutdown(), LibHalFunctions, mainloop_integration(), property_modified(), and usage().

void mainloop_integration DBusConnection *  dbus_connection  )  [static]
 

Invoked by libhal for integration with our mainloop.

We take the easy route and use link with glib for painless integrate.

Parameters:
dbus_connection D-BUS connection to integrate

Definition at line 269 of file lshal.c.

Referenced by main().

void print_property const char *  udi,
const char *  key
[static]
 

Acquires and prints the value of of a property to stderr.

Parameters:
udi Universal Device Id
key Key of property

Definition at line 183 of file lshal.c.

References hal_device_get_property_bool(), hal_device_get_property_double(), hal_device_get_property_int(), hal_device_get_property_string(), hal_device_get_property_type(), and hal_free_string().

Referenced by property_modified().

void property_modified const char *  udi,
const char *  key,
dbus_bool_t  is_removed,
dbus_bool_t  is_added
[static]
 

Invoked when a property of a device in the Global Device List is changed, and we have we have subscribed to changes for that device.

Parameters:
udi Univerisal Device Id
key Key of property

Definition at line 229 of file lshal.c.

References print_property().

Referenced by main().

void usage int  argc,
char *  argv[]
[static]
 

Print out program usage.

Parameters:
argc Number of arguments given to program
argv Arguments given to program

Definition at line 281 of file lshal.c.


Generated on Thu Mar 11 21:32:28 2004 for HAL by doxygen 1.3.6-20040222