From: Chengyi Zhao Date: Thu, 4 Dec 2014 02:20:01 +0000 (+0800) Subject: Get service handle through profile name X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=718e64fa00baf7979dc8de4af091f78d0aef56df;p=platform%2Fcore%2Fapi%2Fconnection.git Get service handle through profile name 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 --- diff --git a/include/net_connection_private.h b/include/net_connection_private.h index 5f00e9d..f2debf5 100644 --- a/include/net_connection_private.h +++ b/include/net_connection_private.h @@ -19,6 +19,7 @@ #include #include +#include #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); diff --git a/src/libnetwork.c b/src/libnetwork.c index 9262202..8dfd024 100755 --- a/src/libnetwork.c +++ b/src/libnetwork.c @@ -21,7 +21,6 @@ #include #include #include -#include #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; +}