Bug fix after refactoring
authorDmytro Logachev <d.logachev@samsung.com>
Tue, 20 Jun 2017 16:54:28 +0000 (19:54 +0300)
committerDmytro Logachev <d.logachev@samsung.com>
Tue, 20 Jun 2017 16:54:28 +0000 (19:54 +0300)
control_app/iot-manager-service/src/network/network_manager.cpp

index a8aeccf..c0d17c1 100644 (file)
 #define NM_GET_SESSION_STATE_FUNC_NAME      "NM_GetSignInStatus"
 #define NM_SUBS_DEV_ST_CHNG_FUNC_NAME       "NM_subscribeDeviceStateChanged"
 #define NM_UNSUBS_DEV_ST_CHNG_FUNC_NAME     "NM_unsubscribeDeviceStateChanged"
-#define NM_GET_OWNED_DEV_FUNC_NAME          "NM_getOwnedDevices"
-#define NM_FREE_DEV_LIST_FUNC_NAME          "NM_freeDeviceList"
-#define NM_GET_LIST_SIZE_FUNC_NAME          "NM_getListSize"
-#define NM_GET_UNOWNED_DEV_FUNC_NAME        "NM_getUnownedDevices"
-#define NM_RESET_DEV_LIST_FUNC_NAME         "NM_resetDeviceList"
-#define NM_DEV_LIST_ENUM_FUNC_NAME          "NM_deviceListEnum"
-#define NM_DEV_LIST_FOREACH_FUNC_NAME       "NM_deviceListForEach"
-#define NM_GET_DEV_INFO_FUNC_NAME           "NM_getDeviceInfo"
 #define NM_FREE_DEV_INFO_FUNC_NAME          "NM_freeDeviceInfo"
-#define NM_OWN_DEV_FUNC_NAME                "NM_ownDevice"
-#define NM_UNOWN_DEV_FUNC_NAME              "NM_unOwnDevice"
 #define NM_SUBS_NOTIFICATIONS_FUNC_NAME     "NM_subscribeNotifications"
 #define NM_UNSUBS_NOTIF_FUNC_NAME           "NM_unsubscribeNotifications"
 #define NM_GET_DEV_REPORT_FUNC_NAME         "NM_getDeviceReport"
@@ -45,6 +35,7 @@
 #define NM_SET_DEV_POLICY_FUNC_NAME         "NM_setDevicePolicy"
 #define NM_GET_DEV_AGENTS_FUNC_NAME         "NM_getDeviceAgents"
 #define NM_GET_OWNED_DEV_UUIDS_FUNC_NAME    "NM_getOwnedDevicesUUIDs"
+#define NM_GET_UNOWNED_DEV_UUIDS_FUNC_NAME     "NM_getUnownedDevicesUUIDs"
 #define NM_FREE_DEV_UUID_ARR_FUNC_NAME      "NM_freeDeviceArray"
 #define NM_GET_DEV_INFO_BY_ID_FUNC_NAME     "NM_getDeviceInfoEx"
 #define NM_OWN_DEV_BY_ID_FUNC_NAME          "NM_ownDeviceEx"
@@ -131,7 +122,7 @@ ErrorCode NetworkManager::ModuleSymbols::LoadModule()
     m_nmGetOwnedDeviceUUIDsFunc    = reinterpret_cast<GetOwnedDevicesUUIDsFunc>(
                                                      dlsym(this->m_module, NM_GET_OWNED_DEV_UUIDS_FUNC_NAME));
     m_nmGetUnownedDeviceUUIDsFunc  = reinterpret_cast<GetUnownedDevicesUUIDsFunc>(
-                                                     dlsym(this->m_module, NM_GET_UNOWNED_DEV_FUNC_NAME));
+                                                     dlsym(this->m_module, NM_GET_UNOWNED_DEV_UUIDS_FUNC_NAME));
     m_nmGetDeviceInfoByIdFunc      = reinterpret_cast<GetDeviceInfoByIdFunc>(
                                                      dlsym(this->m_module, NM_GET_DEV_INFO_BY_ID_FUNC_NAME));
     m_nmOwnDeviceByIdFunc          = reinterpret_cast<OwnDeviceByIdFunc>(
@@ -421,7 +412,7 @@ DeviceList NetworkManager::ToDeviceList(char** uuids)
         return targetList;
     }
 
-    for (std::size_t i = 0; uuids[i]; ++uuids)
+    for (std::size_t i = 0; uuids[i]; ++i)
     {
         DevicePtr target = std::make_shared<Device>();
         ErrorCode res;