1 #include "e_connman_private.h"
4 e_connman_profile_get(const char *path)
6 E_Connman_Element *profile;
8 EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
10 profile = e_connman_element_get(path);
14 if (!e_connman_element_is_profile(profile))
16 WRN("path '%s' is not a profile!", path);
24 * Get property "Name" value.
26 * If this property isn't found then @c EINA_FALSE is returned.
27 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
28 * values shall be considered invalid.
30 * The profile name, if set with e_connman_profile_name_set()
32 * @param profile path to get property.
33 * @param name where to store the property value, must be a pointer
34 * to string (const char **), it will not be allocated or
35 * copied and references will be valid until element changes,
36 * so copy it if you want to use it later.
38 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
39 * @see e_connman_profile_name_set()
42 e_connman_profile_name_get(const E_Connman_Element *profile, const char **name)
44 EINA_SAFETY_ON_NULL_RETURN_VAL(profile, EINA_FALSE);
45 EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE);
46 return e_connman_element_property_get_stringshared
47 (profile, e_connman_prop_name, NULL, name);
51 * Call method SetProperty("Name", name) at the given element on server.
53 * This is a server call, not local, so it may fail and in that case
54 * no property is updated locally. If the value was set the event
55 * E_CONNMAN_EVENT_ELEMENT_UPDATED will be added to main loop.
57 * @param name value to set.
58 * @param cb function to call when server replies or some error happens.
59 * @param data data to give to cb when it is called.
61 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
62 * @see e_connman_profile_name_get()
65 e_connman_profile_name_set(E_Connman_Element *profile, const char *name, E_DBus_Method_Return_Cb cb, const void *data)
67 EINA_SAFETY_ON_NULL_RETURN_VAL(profile, EINA_FALSE);
68 return e_connman_element_property_set_full
69 (profile, e_connman_prop_name, DBUS_TYPE_STRING, name, cb, data);
73 * Get property "OfflineMode" value.
75 * If this property isn't found then @c EINA_FALSE is returned.
76 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
77 * values shall be considered invalid.
79 * The offline mode indicates the global setting for switching all radios on or
80 * off. Changing offline mode to true results in powering down all devices that
81 * use radio technology.
83 * @param offline where to store the property value, must be a pointer
84 * to Eina_Bool (Eina_Bool *).
86 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
87 * @see e_connman_profile_offline_mode_set()
90 e_connman_profile_offline_mode_get(const E_Connman_Element *profile, Eina_Bool *offline)
92 EINA_SAFETY_ON_NULL_RETURN_VAL(profile, EINA_FALSE);
93 EINA_SAFETY_ON_NULL_RETURN_VAL(offline, EINA_FALSE);
94 return e_connman_element_property_get_stringshared
95 (profile, e_connman_prop_offline_mode, NULL, offline);
99 * Call method SetProperty("OfflineMode", offline) at the given element on server.
101 * This is a server call, not local, so it may fail and in that case
102 * no property is updated locally. If the value was set the event
103 * E_CONNMAN_EVENT_ELEMENT_UPDATED will be added to main loop.
105 * The offline mode indicates the global setting for switching all radios on or
106 * off. Changing offline mode to true results in powering down all devices that
107 * use radio technology.
109 * @param offline value to set.
110 * @param cb function to call when server replies or some error happens.
111 * @param data data to give to cb when it is called.
113 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
114 * @see e_connman_profile_offline_mode_get()
117 e_connman_profile_offline_mode_set(E_Connman_Element *profile, Eina_Bool offline, E_DBus_Method_Return_Cb cb, const void *data)
119 EINA_SAFETY_ON_NULL_RETURN_VAL(profile, EINA_FALSE);
120 return e_connman_element_property_set_full
121 (profile, e_connman_prop_offline_mode, DBUS_TYPE_BOOLEAN,
126 * Get array of service elements.
128 * @param count return the number of elements in array.
129 * @param p_elements array with all elements, these are not referenced
130 * and in no particular order, just set if return is @c EINA_TRUE.
132 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
135 e_connman_profile_services_get(const E_Connman_Element *profile, unsigned int *count, E_Connman_Element ***p_elements)
137 EINA_SAFETY_ON_NULL_RETURN_VAL(profile, EINA_FALSE);
138 EINA_SAFETY_ON_NULL_RETURN_VAL(count, EINA_FALSE);
139 EINA_SAFETY_ON_NULL_RETURN_VAL(p_elements, EINA_FALSE);
140 return e_connman_element_objects_array_get_stringshared
141 (profile, e_connman_prop_services, count, p_elements);