Modified get_mac_address (/sys/.. > /opt/etc/.mac.info) 35/54035/1 accepted/tizen/ivi/20160218.022809 accepted/tizen/mobile/20151213.231901 accepted/tizen/tv/20151213.231918 accepted/tizen/wearable/20151213.231937 submit/tizen/20151211.042207 submit/tizen_common/20151229.144031 submit/tizen_common/20151229.154718 submit/tizen_ivi/20160217.000000 submit/tizen_ivi/20160217.000001
authortaesub.kim <taesub.kim@samsung.com>
Fri, 11 Dec 2015 02:59:31 +0000 (11:59 +0900)
committertaesub.kim <taesub.kim@samsung.com>
Fri, 11 Dec 2015 02:59:36 +0000 (11:59 +0900)
Change-Id: I89d0cf92564152acdf38eece0acc2d0b53a88845
Signed-off-by: Taesub Kim <taesub.kim@samsung.com>
packaging/capi-network-connection.spec
src/connection.c

index a8172c7..d749b74 100755 (executable)
@@ -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
index cacbf51..1ea68af 100755 (executable)
@@ -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;