From: taesub.kim Date: Fri, 11 Dec 2015 02:59:31 +0000 (+0900) Subject: Modified get_mac_address (/sys/.. > /opt/etc/.mac.info) X-Git-Tag: accepted/tizen/ivi/20160218.022809^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fapi%2Fconnection.git;a=commitdiff_plain;h=0504252065c25a7669904cd749b01ec9d04a09ed Modified get_mac_address (/sys/.. > /opt/etc/.mac.info) Change-Id: I89d0cf92564152acdf38eece0acc2d0b53a88845 Signed-off-by: Taesub Kim --- diff --git a/packaging/capi-network-connection.spec b/packaging/capi-network-connection.spec index a8172c7..d749b74 100755 --- a/packaging/capi-network-connection.spec +++ b/packaging/capi-network-connection.spec @@ -1,6 +1,6 @@ Name: capi-network-connection Summary: Network Connection library in TIZEN C API -Version: 1.0.76 +Version: 1.0.77 Release: 1 Group: System/Network License: Apache-2.0 diff --git a/src/connection.c b/src/connection.c index cacbf51..1ea68af 100755 --- a/src/connection.c +++ b/src/connection.c @@ -544,6 +544,7 @@ EXPORT_API int connection_get_mac_address(connection_h connection, connection_ty switch (type) { case CONNECTION_TYPE_WIFI: +#if defined TIZEN_TV fp = fopen(WIFI_MAC_INFO_FILE, "r"); if (fp == NULL) { CONNECTION_LOG(CONNECTION_ERROR, "Failed to open file %s", WIFI_MAC_INFO_FILE); @@ -566,6 +567,14 @@ EXPORT_API int connection_get_mac_address(connection_h connection, connection_ty } g_strlcpy(*mac_addr, buf, CONNECTION_MAC_INFO_LENGTH + 1); fclose(fp); +#else + *mac_addr = vconf_get_str(VCONFKEY_WIFI_BSSID_ADDRESS); + + if (*mac_addr == NULL) { + CONNECTION_LOG(CONNECTION_ERROR, "Failed to get vconf from %s", VCONFKEY_WIFI_BSSID_ADDRESS); + return CONNECTION_ERROR_OPERATION_FAILED; + } +#endif break; case CONNECTION_TYPE_ETHERNET: fp = fopen(ETHERNET_MAC_INFO_FILE, "r"); @@ -610,6 +619,7 @@ EXPORT_API int connection_get_mac_address(connection_h connection, connection_ty return CONNECTION_ERROR_NONE; } + EXPORT_API int connection_get_cellular_state(connection_h connection, connection_cellular_state_e* state) { int rv = 0;