Get service handle through profile name 20/31320/2
authorChengyi Zhao <chengyi1.zhao@archermind.com>
Thu, 4 Dec 2014 02:20:01 +0000 (10:20 +0800)
committerChengyi Zhao <chengyi1.zhao@archermind.com>
Mon, 8 Dec 2014 01:40:21 +0000 (09:40 +0800)
The profile name of struct net_profile_info_t and the path
of struct connman_service are the same.

Change-Id: I8214f48a073d77620e235bae11005f0aa00ef141
Signed-off-by: Chengyi Zhao <chengyi1.zhao@archermind.com>
include/net_connection_private.h
src/libnetwork.c

index 5f00e9d9b8b67e49df03a8bb0f0cdf9b1eb23e67..f2debf522a3f9612e3b9dea1038432d0ad742860 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <dlog.h>
 #include <connman-lib-common.h>
+#include <connman-service.h>
 #include "net_cm_intf.h"
 #include "net_connection.h"
 
@@ -93,6 +94,9 @@ connection_profile_state_e _profile_convert_to_cp_state(net_state_type_t state);
 net_service_type_t _connection_profile_convert_to_libnet_cellular_service_type(connection_cellular_service_type_e svc_type);
 net_state_type_t _connection_profile_convert_to_net_state(connection_profile_state_e state);
 
+struct connman_service *_connection_libnet_get_service_h(
+                                               connection_profile_h profile);
+
 void _connection_inter_mutex_lock(void);
 void _connection_inter_mutex_unlock(void);
 
index 9262202a6e615b73fb283f8a63d1b46d89fc8cc0..8dfd02452056c46d062ca8bf9f8fd7e635552414 100755 (executable)
@@ -21,7 +21,6 @@
 #include <winet-wifi.h>
 #include <connman-lib.h>
 #include <connman-technology.h>
-#include <connman-service.h>
 #include "net_connection_private.h"
 
 static GSList *prof_handle_list = NULL;
@@ -806,3 +805,12 @@ int _connection_libnet_get_statistics(net_statistics_type_e statistics_type, uns
                return CONNECTION_ERROR_NONE;
 }
 
+struct connman_service *_connection_libnet_get_service_h(
+                                               connection_profile_h profile)
+{
+       struct connman_service *service =
+               connman_get_service_with_path(
+                               ((net_profile_info_t *) profile)->profile_name);
+
+       return service;
+}