e_dbus: add support to Technologies interface
authorbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 7 Mar 2010 20:10:05 +0000 (20:10 +0000)
committerbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 7 Mar 2010 20:10:05 +0000 (20:10 +0000)
By: Lucas De Marchi <lucas.demarchi@profusion.mobi>

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/e_dbus@46959 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/connman/E_Connman.h
src/lib/connman/e_connman.c
src/lib/connman/e_connman_manager.c
src/lib/connman/e_connman_private.h

index 6b74484..597f56a 100644 (file)
@@ -92,6 +92,7 @@ extern "C" {
 
   EAPI bool e_connman_manager_profiles_get(unsigned int *count, E_Connman_Element ***p_elements) EINA_WARN_UNUSED_RESULT;
   EAPI bool e_connman_manager_services_get(unsigned int *count, E_Connman_Element ***p_elements) EINA_WARN_UNUSED_RESULT;
+  EAPI bool e_connman_manager_technologies_get(unsigned int *count, E_Connman_Element ***p_elements) EINA_WARN_UNUSED_RESULT;
 
   EAPI bool e_connman_manager_request_scan(const char *type, E_DBus_Method_Return_Cb cb, const void *data) EINA_WARN_UNUSED_RESULT;
 
index 8a7514e..d4fc128 100644 (file)
@@ -53,6 +53,7 @@ const char *e_connman_prop_priority = NULL;
 const char *e_connman_prop_profiles = NULL;
 const char *e_connman_prop_profile_active = NULL;
 const char *e_connman_prop_services = NULL;
+const char *e_connman_prop_technologies = NULL;
 const char *e_connman_prop_remember = NULL;
 const char *e_connman_prop_scan_interval = NULL;
 const char *e_connman_prop_scanning = NULL;
@@ -339,6 +340,8 @@ e_connman_system_init(E_DBus_Connection *edbus_conn)
      e_connman_prop_profile_active = eina_stringshare_add("ActiveProfile");
    if (e_connman_prop_services == NULL)
      e_connman_prop_services = eina_stringshare_add("Services");
+   if (e_connman_prop_technologies == NULL)
+     e_connman_prop_technologies = eina_stringshare_add("Technologies");
    if (e_connman_prop_remember == NULL)
      e_connman_prop_remember = eina_stringshare_add("Remember");
    if (e_connman_prop_scan_interval == NULL)
@@ -476,6 +479,7 @@ e_connman_system_shutdown(void)
    _stringshare_del(&e_connman_prop_profiles);
    _stringshare_del(&e_connman_prop_profile_active);
    _stringshare_del(&e_connman_prop_services);
+   _stringshare_del(&e_connman_prop_technologies);
    _stringshare_del(&e_connman_prop_remember);
    _stringshare_del(&e_connman_prop_scan_interval);
    _stringshare_del(&e_connman_prop_scanning);
index bca4276..679d8eb 100644 (file)
@@ -246,6 +246,32 @@ e_connman_manager_services_get(unsigned int *count, E_Connman_Element ***p_eleme
 }
 
 /**
+ * Get array of technology elements.
+ *
+ * @param count return the number of elements in array.
+ * @param p_elements array with all elements, these are not referenced
+ *        and in no particular order, just set if return is 1.  The
+ *        array itself is allocated using malloc() and should be freed
+ *        after usage is done.
+ *
+ * @return 1 on success, 0 otherwise.
+ */
+bool
+e_connman_manager_technologies_get(unsigned int *count, E_Connman_Element ***p_elements)
+{
+   E_Connman_Element *element;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(count, 0);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(p_elements, 0);
+
+   element = e_connman_manager_get();
+   if (!element)
+     return 0;
+   return e_connman_element_objects_array_get_stringshared
+     (element, e_connman_prop_technologies, count, p_elements);
+}
+
+/**
  * Request to trigger a scan for given technology.
  *
  * Call method RequestScan(type) on server in order to
index ef92ca8..e313439 100644 (file)
@@ -61,6 +61,7 @@ extern const char *e_connman_prop_priority;
 extern const char *e_connman_prop_profiles;
 extern const char *e_connman_prop_profile_active;
 extern const char *e_connman_prop_services;
+extern const char *e_connman_prop_technologies;
 extern const char *e_connman_prop_remember;
 extern const char *e_connman_prop_scan_interval;
 extern const char *e_connman_prop_scanning;