powersave_hal.h File Reference

#include "powerlib.h"
#include <hal/libhal.h>

Go to the source code of this file.

Defines

#define DBUS_API_SUBJECT_TO_CHANGE   1
#define HAL_ERROR   -7
 error for hal connect error

Functions

int ps_hal_init (void)
 inits the access to hal
void ps_hal_free (void)
 frees the access to hal
int ps_hal_get_property_int (char *device, char *property)
int ps_hal_get_property_bool (char *device, char *property)
char * ps_hal_get_property_string (char *device, char *property)
int ps_hal_query_capability (char *device, char *capability)
 query a capability of a device
LibHalContext * ps_hal_context (void)
 get the hal context used
DBusError * ps_hal_dbus_error (void)
 get the dbus error used


Define Documentation

#define DBUS_API_SUBJECT_TO_CHANGE   1
 

#define HAL_ERROR   -7
 

error for hal connect error


Function Documentation

LibHalContext* ps_hal_context void   ) 
 

get the hal context used

Returns:
the hal context

DBusError* ps_hal_dbus_error void   ) 
 

get the dbus error used

Returns:
the dbus error

void ps_hal_free void   ) 
 

frees the access to hal

the free includes any dbus connection, dbus errors or hal contexts call this inside your application as soon as the hal service disappears

int ps_hal_get_property_bool char *  device,
char *  property
 

brief get bool property through hal

fetches one bool value through hal. Throws a dbus error with error message if needed.

Parameters:
device the device from which should be fetched
property the property which should be fetched
Returns:
-1 on error

int ps_hal_get_property_int char *  device,
char *  property
 

brief get integer property through hal

fetches one interger value through hal. Throws a dbus error with error message if needed.

Parameters:
device the device from which should be fetched
property the property which should be fetched
Returns:
-1 on error

char* ps_hal_get_property_string char *  device,
char *  property
 

brief get string property through hal

fetches one string value through hal. Throws a dbus error with error message if needed.

Parameters:
device the device from which should be fetched
property the property which should be fetched
Returns:
requested value or NULL on error (string must be freed)

int ps_hal_init void   ) 
 

inits the access to hal

if hal context is already initialized, does nothing.

Return values:
true if already initialized connection could be set up
false false if connection could not be established

int ps_hal_query_capability char *  device,
char *  capability
 

query a capability of a device

Parameters:
device the device usi
capability the capability to query for
Returns:
< 0 on error


Generated on Mon Mar 27 09:27:19 2006 for Powersave Daemon by  doxygen 1.4.6