hal.h

Go to the documentation of this file.
00001 #ifndef __HAL_H__
00002 #define __HAL_H__
00003 
00004 /**
00005  * File Name  : hal.h
00006  *
00007  * Description: The HAL Hardware Abstraction functions
00008  */
00009 
00010 /*
00011  * This file is part of sysd.
00012  *
00013  * sysd is free software: you can redistribute it and/or modify
00014  * it under the terms of the GNU General Public License as published by
00015  * the Free Software Foundation, either version 2 of the License, or
00016  * (at your option) any later version.
00017  *
00018  * sysd is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00021  * GNU General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU General Public License
00024  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00025  */
00026 
00027 /**
00028  * Copyright (C) 2008 iRex Technologies B.V.
00029  * All rights reserved.
00030  *
00031  * Parts used from halevt, Copyright (C) 2007  Patrice Dumas <pertusus at free dot fr>
00032  */
00033 
00034 
00035 //----------------------------------------------------------------------------
00036 // Include Files
00037 //----------------------------------------------------------------------------
00038 
00039 #include <hal/libhal.h>
00040 #include <devicelist.h>
00041 
00042 
00043 G_BEGIN_DECLS
00044 
00045 
00046 //----------------------------------------------------------------------------
00047 // Definitions
00048 //---------------------------------------------------------------------------- 
00049 
00050 #define MOUNTPOINT_CARD   "/media/mmcblk0p1"
00051 #define MOUNT_OPTIONS     "iocharset=iso8859-1,utf8,noatime"
00052 
00053 
00054 //----------------------------------------------------------------------------
00055 // Forward Declarations
00056 //----------------------------------------------------------------------------
00057 
00058 
00059 //----------------------------------------------------------------------------
00060 // Type Declarations
00061 //----------------------------------------------------------------------------
00062 
00063 
00064 //----------------------------------------------------------------------------
00065 // Global Constants
00066 //----------------------------------------------------------------------------
00067 
00068 
00069 //============================================================================
00070 // Public Functions
00071 //============================================================================
00072 
00073 /**---------------------------------------------------------------------------
00074  *
00075  * Name :  hal_set_services
00076  *
00077  * @brief  Setup HAL context and set callbacks for hal events
00078  *
00079  * @param  --
00080  *
00081  * @return TRUE if successfully set up, FALSE otherwise
00082  *
00083  *--------------------------------------------------------------------------*/
00084 gboolean hal_set_services(void);
00085 
00086 /**---------------------------------------------------------------------------
00087  *
00088  * Name :  hal_add_devices
00089  *
00090  * @brief  Scan HAL for available devices, run init and add to devicelist
00091  *
00092  * @param  --
00093  *
00094  * @return --
00095  *
00096  *--------------------------------------------------------------------------*/
00097 void hal_add_devices(void);
00098 
00099 /**---------------------------------------------------------------------------
00100  *
00101  * Name :  hal_check_dbus_error
00102  *
00103  * @brief  Print and reset a dbus error
00104  *
00105  * @param  error Pointer to DBusError, memory is freed when set
00106  *
00107  * @return --
00108  *
00109  *--------------------------------------------------------------------------*/
00110 void hal_check_dbus_error(DBusError *error);
00111 
00112 /**---------------------------------------------------------------------------
00113  *
00114  * Name :  hal_device_print
00115  *
00116  * @brief  Print a device to stdout, useful for debugging
00117  *
00118  * @param  udi Unique Device Id
00119  *
00120  * @return --
00121  *
00122  *--------------------------------------------------------------------------*/
00123 void hal_device_print(const char *udi);
00124 
00125 /**---------------------------------------------------------------------------
00126  *
00127  * Name :  hal_get_iterator_value
00128  *
00129  * @brief  Return the value of iterator from Hal properties
00130  *
00131  * @param  type LibHalPropertyType type of property
00132  * @param  iter LibHalPropertySetIterator iterator
00133  *
00134  * @return value array
00135  *
00136  *--------------------------------------------------------------------------*/
00137 char **hal_get_iterator_value(const LibHalPropertyType type, LibHalPropertySetIterator *iter);
00138 
00139 /**---------------------------------------------------------------------------
00140  *
00141  * Name :  hal_property_value
00142  *
00143  * @brief  Return the value of Hal property 
00144  *
00145  * @param  key 
00146  * @param  udi Unique Device Id
00147  * @param  device hal_device 
00148  *
00149  * @return value array
00150  *
00151  *--------------------------------------------------------------------------*/
00152 char **hal_property_value(const char *key, const char *udi, const hal_device *device);
00153 
00154 gchar *hal_get_mountpoint_device(void);
00155 void hal_remount_all_volumes(gpointer callback_function, gpointer user_data);
00156 void hal_unmount_all_volumes(gpointer callback_function, gpointer user_data);
00157 void hal_report_mounted_volumes(const char *ipc_service);
00158 
00159 
00160 G_END_DECLS
00161 
00162 #endif /* __HAL_H__ */
Generated by  doxygen 1.6.2-20100208