merge with master
[framework/osp/net.git] / src / FNet_PsSystemNetConnection.cpp
index a95da7a..672f4f2 100644 (file)
@@ -49,18 +49,21 @@ PsOpenCallback(connection_error_e res, void* pUserData)
        NetConnectionState connectionState = pConnection->GetConnectionState();
        bool isConnected = false;
        char* pProfileName = null;
+       char* pProfileDisplayName = null;
        int ret = CONNECTION_ERROR_NONE;
        connection_profile_h profileHandle = pConnection->GetProfileHandle();
        connection_profile_state_e state = CONNECTION_PROFILE_STATE_DISCONNECTED;
 
        ret = connection_profile_refresh(profileHandle);
        SysLog(NID_NET, "The return value from connection_profile_refresh() is %d", ret);
-       ret = connection_profile_get_name(profileHandle, &pProfileName);
+       ret = connection_profile_get_id(profileHandle, &pProfileName);
+       SysLog(NID_NET, "The return value from connection_profile_get_id() is %d", ret);
+       ret = connection_profile_get_name(profileHandle, &pProfileDisplayName);
        SysLog(NID_NET, "The return value from connection_profile_get_name() is %d", ret);
        ret = connection_profile_get_state(profileHandle, &state);
        SysLog(NID_NET, "The return value from connection_profile_get_state() is %d", ret);
 
-       SysLog(NID_NET, "PsOpenCallback() has been called with res:%d, state:%d, name%s", res, state, pProfileName);
+       SysLog(NID_NET, "PsOpenCallback() has been called with res:%d, state:%d, name:[%s][%s]", res, state, pProfileDisplayName, pProfileName);
 
        if ((res == CONNECTION_ERROR_NONE) && (state == CONNECTION_PROFILE_STATE_CONNECTED))
        {
@@ -74,6 +77,7 @@ PsOpenCallback(connection_error_e res, void* pUserData)
        }
 
        free(pProfileName);
+       free(pProfileDisplayName);
 
        if (connectionState != NET_CONNECTION_STATE_STARTING)
        {
@@ -98,18 +102,21 @@ PsCloseCallback(connection_error_e res, void* pUserData)
        NetConnectionState connectionState = pConnection->GetConnectionState();
        bool isConnected = false;
        char* pProfileName = null;
+       char* pProfileDisplayName = null;
        int ret = CONNECTION_ERROR_NONE;
        connection_profile_h profileHandle = pConnection->GetProfileHandle();
        connection_profile_state_e state = CONNECTION_PROFILE_STATE_DISCONNECTED;
 
        ret = connection_profile_refresh(profileHandle);
        SysLog(NID_NET, "The return value from connection_profile_refresh() is %d", ret);
-       ret = connection_profile_get_name(profileHandle, &pProfileName);
+       ret = connection_profile_get_id(profileHandle, &pProfileName);
+       SysLog(NID_NET, "The return value from connection_profile_get_id() is %d", ret);
+       ret = connection_profile_get_name(profileHandle, &pProfileDisplayName);
        SysLog(NID_NET, "The return value from connection_profile_get_name() is %d", ret);
        ret = connection_profile_get_state(profileHandle, &state);
        SysLog(NID_NET, "The return value from connection_profile_get_state() is %d", ret);
 
-       SysLog(NID_NET, "PsCloseCallback() has been called with res:%d, state:%d, name:%s", res, state, pProfileName);
+       SysLog(NID_NET, "PsCloseCallback() has been called with res:%d, state:%d, name:[%s][%s]", res, state, pProfileDisplayName, pProfileName);
 
        if ((res == CONNECTION_ERROR_NONE) && (state == CONNECTION_PROFILE_STATE_CONNECTED))
        {
@@ -123,6 +130,7 @@ PsCloseCallback(connection_error_e res, void* pUserData)
        }
 
        free(pProfileName);
+       free(pProfileDisplayName);
 
        if (connectionState != NET_CONNECTION_STATE_STOPPING)
        {
@@ -140,15 +148,18 @@ PsStateChangedCallback(connection_profile_state_e state, void* pUserData)
        NetConnectionState connectionState = pConnection->GetConnectionState();
        bool isConnected = false;
        char* pProfileName = null;
+       char* pProfileDisplayName = null;
        int ret = CONNECTION_ERROR_NONE;
        connection_profile_h profileHandle = pConnection->GetProfileHandle();
 
        ret = connection_profile_refresh(profileHandle);
        SysLog(NID_NET, "The return value from connection_profile_refresh() is %d", ret);
-       ret = connection_profile_get_name(profileHandle, &pProfileName);
+       ret = connection_profile_get_id(profileHandle, &pProfileName);
+       SysLog(NID_NET, "The return value from connection_profile_get_id() is %d", ret);
+       ret = connection_profile_get_name(profileHandle, &pProfileDisplayName);
        SysLog(NID_NET, "The return value from connection_profile_get_name() is %d", ret);
 
-       SysLog(NID_NET, "PsStateChangedCallback() has been called with state:%d, name:%s", state, pProfileName);
+       SysLog(NID_NET, "PsStateChangedCallback() has been called with state:%d, name:[%s][%s]", state, pProfileDisplayName, pProfileName);
 
        if (state == CONNECTION_PROFILE_STATE_CONNECTED)
        {
@@ -162,6 +173,7 @@ PsStateChangedCallback(connection_profile_state_e state, void* pUserData)
        }
 
        free(pProfileName);
+       free(pProfileDisplayName);
 
        if ((connectionState == NET_CONNECTION_STATE_STARTING) || (connectionState == NET_CONNECTION_STATE_STOPPING))
        {