EFL 1.7 svn doobies
[profile/ivi/e_dbus.git] / src / lib / ofono / e_ofono_manager.c
1 #include "e_ofono_private.h"
2
3 /**
4  * Get the element manager.
5  *
6  * @return element pointer if found, NULL otherwise.
7  */
8 E_Ofono_Element *
9 e_ofono_manager_get(void)
10 {
11    return e_ofono_element_get(manager_path, e_ofono_iface_manager);
12 }
13
14 /**
15  * Get array of modem object paths.
16  *
17  * If this property isn't found then 0 is returned.
18  * If zero is returned, then this call failed and parameter-returned
19  * values shall be considered invalid.
20  *
21  * @param array where to store the property value, must be a pointer
22  *        to Eina_Array (Eina_Array **), it will not be allocated or
23  *        copied and references will be valid until element changes,
24  *        so copy it if you want to use it later.
25  *
26  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
27  */
28 Eina_Bool
29 e_ofono_manager_modems_get(Eina_Array **array)
30 {
31    E_Ofono_Element *element;
32    E_Ofono_Array *a = NULL;
33    Eina_Bool r;
34
35    EINA_SAFETY_ON_NULL_RETURN_VAL(array, EINA_FALSE);
36
37    element = e_ofono_element_get(manager_path, e_ofono_iface_manager);
38    r = e_ofono_element_property_get_stringshared
39          (element, e_ofono_prop_modems, NULL, &a);
40    if (a)
41       *array = a->array;
42
43    return r;
44 }
45