Easysetup - Change OC_LOG to OIC_LOG & warning fixes
authorlankamadan <lanka.madan@samsung.com>
Fri, 19 Feb 2016 11:16:40 +0000 (20:16 +0900)
committerMadan Lanka <lanka.madan@samsung.com>
Sun, 21 Feb 2016 00:23:57 +0000 (00:23 +0000)
- OC_LOG is being depricated, so moved to OIC_LOG
- Fixed some warnings in mediator and enrollee for linux platform

Change-Id: Ie856dc343569e553e0d680a8ccbcdc30cc2d7210
Signed-off-by: lankamadan <lanka.madan@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/5071
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
13 files changed:
service/easy-setup/enrollee/linux/wifi/networkhandler.cpp
service/easy-setup/enrollee/src/easysetup.cpp [changed mode: 0755->0644]
service/easy-setup/enrollee/src/onboarding.cpp [changed mode: 0644->0755]
service/easy-setup/enrollee/src/resourcehandler.cpp
service/easy-setup/enrollee/tizen/wifi/networkhandler.cpp
service/easy-setup/mediator/richsdk/src/EasySetup.cpp
service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp
service/easy-setup/mediator/richsdk/src/RemoteEnrollee.cpp
service/easy-setup/mediator/richsdk/src/RemoteEnrolleeResource.cpp [changed mode: 0644->0755]
service/easy-setup/sampleapp/enrollee/arduino/enrolleewifi.cpp
service/easy-setup/sampleapp/enrollee/tizen/EnrolleeGUISample/src/enrolleewifi.cpp
service/easy-setup/sampleapp/enrollee/tizen/Enrolleesample/src/enrolleewifi.cpp
service/easy-setup/sampleapp/mediator/linux/richsdk_sample/mediator_cpp.cpp [changed mode: 0644->0755]

index 1e9884b..90b4f3c 100644 (file)
@@ -39,13 +39,13 @@ static void ESActivateWifi()
 
 static void start()
 {
-    OC_LOG(INFO, LOG_TAG, "START");
+    OIC_LOG(INFO, LOG_TAG, "START");
     ESActivateWifi();
 }
 
 void ConnectToWiFiNetwork(const char *ssid, const char *pass, NetworkEventCallback cb)
 {
-    OC_LOG_V(INFO, LOG_TAG, "ConnectToWiFiNetwork %s %s",ssid,pass);
+    OIC_LOG_V(INFO, LOG_TAG, "ConnectToWiFiNetwork %s %s",ssid,pass);
     gPass = pass;
     gSsid = ssid;
     gNetworkEventCb = cb;
old mode 100755 (executable)
new mode 100644 (file)
index 4d55ff8..f6ebc4b
@@ -76,14 +76,14 @@ static bool ValidateParam(OCConnectivityType networkType, const char *ssid, cons
 
 void OnboardingCallback(ESResult esResult)
 {
-        OC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "OnboardingCallback with  result = %d", esResult);
+        OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "OnboardingCallback with  result = %d", esResult);
         if(esResult == ES_OK)
         {
             gEnrolleeStatusCb(esResult, ES_ON_BOARDED_STATE);
         }
         else
         {
-            OC_LOG_V(DEBUG, ES_ENROLLEE_TAG,
+            OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG,
                         "Onboarding is failed callback result is = %d", esResult);
             gEnrolleeStatusCb(esResult, ES_INIT_STATE);
         }
@@ -91,20 +91,20 @@ void OnboardingCallback(ESResult esResult)
 
 void ProvisioningCallback(ESResult esResult)
 {
-    OC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "ProvisioningCallback with  result = %d", esResult);
+    OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "ProvisioningCallback with  result = %d", esResult);
 
     if (esResult == ES_RECVTRIGGEROFPROVRES)
     {
         GetTargetNetworkInfoFromProvResource(gTargetSsid, gTargetPass);
         gEnrolleeStatusCb(ES_OK, ES_PROVISIONED_STATE);
-        OC_LOG(DEBUG, ES_ENROLLEE_TAG, "Connecting with target network");
+        OIC_LOG(DEBUG, ES_ENROLLEE_TAG, "Connecting with target network");
 
         // Connecting/onboarding to target network
         ConnectToWiFiNetwork(gTargetSsid, gTargetPass, OnboardingCallbackTargetNet);
     }
     else
     {
-       OC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "Provisioning is failed callback result is = %d", esResult);
+       OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "Provisioning is failed callback result is = %d", esResult);
        // Resetting Enrollee to ONBOARDED_STATE as Enrollee is alreday onboarded in previous step
        gEnrolleeStatusCb(ES_OK, ES_ON_BOARDED_STATE);
     }
@@ -112,7 +112,7 @@ void ProvisioningCallback(ESResult esResult)
 
 void OnboardingCallbackTargetNet(ESResult esResult)
 {
-    OC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "OnboardingCallback on target network with result = %d",
+    OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "OnboardingCallback on target network with result = %d",
                                                                                         esResult);
     if(esResult == ES_OK)
     {
@@ -120,7 +120,7 @@ void OnboardingCallbackTargetNet(ESResult esResult)
     }
     else
     {
-        OC_LOG_V(DEBUG, ES_ENROLLEE_TAG,
+        OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG,
                     "Onboarding is failed on target network and callback result is = %d", esResult);
         // Resetting Enrollee state to the ES_PROVISIONED_STATE
         // as device is already being provisioned with target network creds.
@@ -132,10 +132,10 @@ ESResult InitEasySetup(OCConnectivityType networkType, const char *ssid, const c
         bool isSecured,
         EventCallback cb)
 {
-    OC_LOG(INFO, ES_ENROLLEE_TAG, "InitEasySetup IN");
+    OIC_LOG(INFO, ES_ENROLLEE_TAG, "InitEasySetup IN");
     if(!ValidateParam(networkType,ssid,passwd,cb))
     {
-        OC_LOG(ERROR, ES_ENROLLEE_TAG,
+        OIC_LOG(ERROR, ES_ENROLLEE_TAG,
                             "InitEasySetup::Stopping Easy setup due to invalid parameters");
         return ES_ERROR;
     }
@@ -149,17 +149,17 @@ ESResult InitEasySetup(OCConnectivityType networkType, const char *ssid, const c
     // knows when actually on-boarding started.
     cb(ES_ERROR,ES_ON_BOARDING_STATE);
 
-    OC_LOG(INFO, ES_ENROLLEE_TAG, "received callback");
-    OC_LOG(INFO, ES_ENROLLEE_TAG, "onboarding now..");
+    OIC_LOG(INFO, ES_ENROLLEE_TAG, "received callback");
+    OIC_LOG(INFO, ES_ENROLLEE_TAG, "onboarding now..");
 
     if(!ESOnboard(ssid, passwd, OnboardingCallback))
     {
-        OC_LOG(ERROR, ES_ENROLLEE_TAG, "InitEasySetup::On-boarding failed");
+        OIC_LOG(ERROR, ES_ENROLLEE_TAG, "InitEasySetup::On-boarding failed");
         cb(ES_ERROR, ES_INIT_STATE);
         return ES_ERROR;
     }
 
-    OC_LOG(INFO, ES_ENROLLEE_TAG, "InitEasySetup OUT");
+    OIC_LOG(INFO, ES_ENROLLEE_TAG, "InitEasySetup OUT");
     return ES_OK;
 }
 
@@ -170,7 +170,7 @@ ESResult TerminateEasySetup()
     //Delete Prov resource
     if (DeleteProvisioningResource() != OC_STACK_OK)
     {
-        OC_LOG(ERROR, ES_ENROLLEE_TAG, "Deleting prov resource error!!");
+        OIC_LOG(ERROR, ES_ENROLLEE_TAG, "Deleting prov resource error!!");
         return ES_ERROR;
     }
 
@@ -178,45 +178,45 @@ ESResult TerminateEasySetup()
 #ifdef ESWIFI
     if (DeleteNetworkResource() != OC_STACK_OK)
     {
-        OC_LOG(ERROR, ES_ENROLLEE_TAG, "Deleting prov resource error!!");
+        OIC_LOG(ERROR, ES_ENROLLEE_TAG, "Deleting prov resource error!!");
         return ES_ERROR;
     }
 #endif
 
-    OC_LOG(ERROR, ES_ENROLLEE_TAG, "TerminateEasySetup success");
+    OIC_LOG(ERROR, ES_ENROLLEE_TAG, "TerminateEasySetup success");
     return ES_OK;
 }
 
 ESResult InitProvisioning()
 {
-    OC_LOG(INFO, ES_ENROLLEE_TAG, "InitProvisioning <<IN>>");
+    OIC_LOG(INFO, ES_ENROLLEE_TAG, "InitProvisioning <<IN>>");
 
     if (CreateProvisioningResource(gIsSecured) != OC_STACK_OK)
     {
-        OC_LOG(ERROR, ES_ENROLLEE_TAG, "CreateProvisioningResource error");
+        OIC_LOG(ERROR, ES_ENROLLEE_TAG, "CreateProvisioningResource error");
         return ES_ERROR;
     }
 
 #ifdef ESWIFI
     if (CreateNetworkResource() != OC_STACK_OK)
     {
-        OC_LOG(ERROR, ES_ENROLLEE_TAG, "CreateNetworkResource error");
+        OIC_LOG(ERROR, ES_ENROLLEE_TAG, "CreateNetworkResource error");
         return ES_ERROR;
     }
 #endif
 
     RegisterResourceEventCallBack(ProvisioningCallback);
 
-    OC_LOG(INFO, ES_ENROLLEE_TAG, "InitProvisioning OUT");
+    OIC_LOG(INFO, ES_ENROLLEE_TAG, "InitProvisioning OUT");
     return ES_RESOURCECREATED;
 }
 
-static bool ValidateParam(OCConnectivityType networkType, const char *ssid, const char *passwd,
+static bool ValidateParam(OCConnectivityType /*networkType*/, const char *ssid, const char *passwd,
               EventCallback cb)
 {
     if (!ssid || !passwd || !cb)
     {
-        OC_LOG(ERROR, ES_ENROLLEE_TAG, "ValidateParam - Invalid parameters");
+        OIC_LOG(ERROR, ES_ENROLLEE_TAG, "ValidateParam - Invalid parameters");
         return false;
     }
     return true;
old mode 100644 (file)
new mode 100755 (executable)
index 82131f5..f5d1c34
@@ -62,7 +62,7 @@ bool ESBleOnboarding()
  */
 bool ESOnboard(const char * ssid, const char* passwd, NetworkEventCallback cb)
 {
-    OC_LOG(DEBUG, ES_ENROLLEE_TAG, "ESOnboard IN");
+    OIC_LOG(DEBUG, ES_ENROLLEE_TAG, "ESOnboard IN");
 
     if (ESSoftapOnboarding())
     {
@@ -80,14 +80,14 @@ bool ESOnboard(const char * ssid, const char* passwd, NetworkEventCallback cb)
     }
     else if (ESBleOnboarding())
     {
-        OC_LOG(ERROR, ES_ENROLLEE_TAG, "ESOnboard::Ble onboarding is not supported");
+        OIC_LOG(ERROR, ES_ENROLLEE_TAG, "ESOnboard::Ble onboarding is not supported");
         // TODO:
         return false;
     }
     else
     {
         // TODO:
-        OC_LOG(ERROR, ES_ENROLLEE_TAG, "ESOnboard::Invalid onboarding option");
+        OIC_LOG(ERROR, ES_ENROLLEE_TAG, "ESOnboard::Invalid onboarding option");
         return false;
     }
 }
index 828e5cb..6eca772 100644 (file)
@@ -111,7 +111,7 @@ OCStackResult CreateProvisioningResource(bool isSecured)
                 OC_DISCOVERABLE | OC_OBSERVABLE);
     }
 
-    OC_LOG_V(INFO, ES_RH_TAG, "Created Prov resource with result: %s", getResult(res));
+    OIC_LOG_V(INFO, ES_RH_TAG, "Created Prov resource with result: %s", getResult(res));
     return res;
 }
 
@@ -120,7 +120,7 @@ OCStackResult DeleteProvisioningResource()
     OCStackResult res = OCDeleteResource(gProvResource.handle);
     if (res != OC_STACK_OK)
     {
-        OC_LOG_V(INFO, ES_RH_TAG, "Deleting Prov resource error with result: %s", getResult(res));
+        OIC_LOG_V(INFO, ES_RH_TAG, "Deleting Prov resource error with result: %s", getResult(res));
     }
 
     return res;
@@ -151,13 +151,13 @@ OCStackResult CreateNetworkResource()
     }
     sprintf(gNetResource.cnn, "%s", netInfo.ssid);
 
-    OC_LOG_V(INFO, ES_RH_TAG, "SSID: %s", gNetResource.cnn);
-    OC_LOG_V(INFO, ES_RH_TAG, "IP Address: %s", gNetResource.ipaddr);
+    OIC_LOG_V(INFO, ES_RH_TAG, "SSID: %s", gNetResource.cnn);
+    OIC_LOG_V(INFO, ES_RH_TAG, "IP Address: %s", gNetResource.ipaddr);
 
     OCStackResult res = OCCreateResource(&gNetResource.handle, "oic.r.net", OC_RSRVD_INTERFACE_DEFAULT,
             OC_RSRVD_ES_URI_NET, OCEntityHandlerCb,NULL, OC_DISCOVERABLE | OC_OBSERVABLE);
 
-    OC_LOG_V(INFO, ES_RH_TAG, "Created Net resource with result: %s", getResult(res));
+    OIC_LOG_V(INFO, ES_RH_TAG, "Created Net resource with result: %s", getResult(res));
 
     return res;
 }
@@ -167,7 +167,7 @@ OCStackResult DeleteNetworkResource()
     OCStackResult res = OCDeleteResource(gNetResource.handle);
     if (res != OC_STACK_OK)
     {
-        OC_LOG_V(INFO, ES_RH_TAG, "Deleting Network resource error with result: %s",
+        OIC_LOG_V(INFO, ES_RH_TAG, "Deleting Network resource error with result: %s",
                                                                             getResult(res));
     }
 
@@ -181,19 +181,19 @@ OCEntityHandlerResult ProcessGetRequest(OCEntityHandlerRequest *ehRequest,
     OCEntityHandlerResult ehResult = OC_EH_ERROR;
     if (!ehRequest)
     {
-        OC_LOG(ERROR, ES_RH_TAG, "Request is Null");
+        OIC_LOG(ERROR, ES_RH_TAG, "Request is Null");
         return ehResult;
     }
     if (ehRequest->payload && ehRequest->payload->type != PAYLOAD_TYPE_REPRESENTATION)
     {
-        OC_LOG(ERROR, ES_RH_TAG, "Incoming payload not a representation");
+        OIC_LOG(ERROR, ES_RH_TAG, "Incoming payload not a representation");
         return ehResult;
     }
 
     OCRepPayload *getResp = constructResponse(ehRequest);
     if (!getResp)
     {
-        OC_LOG(ERROR, ES_RH_TAG, "constructResponse failed");
+        OIC_LOG(ERROR, ES_RH_TAG, "constructResponse failed");
         return OC_EH_ERROR;
     }
 
@@ -206,18 +206,18 @@ OCEntityHandlerResult ProcessGetRequest(OCEntityHandlerRequest *ehRequest,
 OCEntityHandlerResult ProcessPutRequest(OCEntityHandlerRequest *ehRequest,
                                                OCRepPayload** payload)
 {
-    OC_LOG(INFO, ES_RH_TAG, "ProcessPutRequest enter");
+    OIC_LOG(INFO, ES_RH_TAG, "ProcessPutRequest enter");
     OCEntityHandlerResult ehResult = OC_EH_ERROR;
     if (ehRequest->payload && ehRequest->payload->type != PAYLOAD_TYPE_REPRESENTATION)
     {
-        OC_LOG(ERROR, ES_RH_TAG, "Incoming payload not a representation");
+        OIC_LOG(ERROR, ES_RH_TAG, "Incoming payload not a representation");
         return ehResult;
     }
 
     OCRepPayload* input = (OCRepPayload*) (ehRequest->payload);
     if (!input)
     {
-        OC_LOG(ERROR, ES_RH_TAG, "Failed to parse");
+        OIC_LOG(ERROR, ES_RH_TAG, "Failed to parse");
         return ehResult;
     }
 
@@ -228,7 +228,7 @@ OCEntityHandlerResult ProcessPutRequest(OCEntityHandlerRequest *ehRequest,
     // information.
     if (gProvResource.ps == ES_PS_PROVISIONING_COMPLETED)
     {
-        OC_LOG(DEBUG, ES_RH_TAG, "Provisioning already completed. "
+        OIC_LOG(DEBUG, ES_RH_TAG, "Provisioning already completed. "
                 "This a request to override the existing the network provisioning information");
     }
 
@@ -242,25 +242,25 @@ OCEntityHandlerResult ProcessPutRequest(OCEntityHandlerRequest *ehRequest,
     if (OCRepPayloadGetPropString(input, OC_RSRVD_ES_TNN, &tnn))
     {
         sprintf(gProvResource.tnn, "%s", tnn);
-        OC_LOG(INFO, ES_RH_TAG, "got ssid");
+        OIC_LOG(INFO, ES_RH_TAG, "got ssid");
     }
 
-       OC_LOG_V(INFO, ES_RH_TAG, "gProvResource.tnn %s", gProvResource.tnn);
+       OIC_LOG_V(INFO, ES_RH_TAG, "gProvResource.tnn %s", gProvResource.tnn);
     char* cd;
     if (OCRepPayloadGetPropString(input, OC_RSRVD_ES_CD, &cd))
     {
         sprintf(gProvResource.cd, "%s", cd);
-        OC_LOG(INFO, ES_RH_TAG, "got password");
+        OIC_LOG(INFO, ES_RH_TAG, "got password");
     }
-       OC_LOG_V(INFO, ES_RH_TAG, "gProvResource.cd %s", gProvResource.cd);
+       OIC_LOG_V(INFO, ES_RH_TAG, "gProvResource.cd %s", gProvResource.cd);
     gProvResource.ps = 2;
-    OC_LOG_V(INFO, ES_RH_TAG, "gProvResource.ps %d", gProvResource.ps);
+    OIC_LOG_V(INFO, ES_RH_TAG, "gProvResource.ps %d", gProvResource.ps);
     g_flag = 1;
 
     OCRepPayload *getResp = constructResponse(ehRequest);
     if (!getResp)
     {
-        OC_LOG(ERROR, ES_RH_TAG, "constructResponse failed");
+        OIC_LOG(ERROR, ES_RH_TAG, "constructResponse failed");
         return OC_EH_ERROR;
     }
 
@@ -271,24 +271,24 @@ OCEntityHandlerResult ProcessPutRequest(OCEntityHandlerRequest *ehRequest,
 }
 
 OCEntityHandlerResult ProcessPostRequest(OCEntityHandlerRequest *ehRequest,
-                                                OCRepPayload** payload)
+                                                OCRepPayload** /*payload*/)
 {
     OCEntityHandlerResult ehResult = OC_EH_ERROR;
     if (!ehRequest)
     {
-        OC_LOG(ERROR, ES_RH_TAG, "Request is Null");
+        OIC_LOG(ERROR, ES_RH_TAG, "Request is Null");
         return ehResult;
     }
     if (ehRequest->payload && ehRequest->payload->type != PAYLOAD_TYPE_REPRESENTATION)
     {
-        OC_LOG(ERROR, ES_RH_TAG, "Incoming payload not a representation");
+        OIC_LOG(ERROR, ES_RH_TAG, "Incoming payload not a representation");
         return ehResult;
     }
 
     OCRepPayload* input = (OCRepPayload*) (ehRequest->payload);
     if (!input)
     {
-        OC_LOG(ERROR, ES_RH_TAG, "Failed to parse");
+        OIC_LOG(ERROR, ES_RH_TAG, "Failed to parse");
         return ehResult;
     }
     char* tr;
@@ -307,13 +307,13 @@ OCRepPayload* constructResponse(OCEntityHandlerRequest *ehRequest)
     OCRepPayload* payload = OCRepPayloadCreate();
     if (!payload)
     {
-        OC_LOG(ERROR, ES_RH_TAG, "Failed to allocate Payload");
+        OIC_LOG(ERROR, ES_RH_TAG, "Failed to allocate Payload");
         return NULL;
     }
 
     if (ehRequest->resource == gProvResource.handle)
     {
-        OC_LOG(INFO, ES_RH_TAG, "constructResponse prov res");
+        OIC_LOG(INFO, ES_RH_TAG, "constructResponse prov res");
         OCRepPayloadSetUri(payload, OC_RSRVD_ES_URI_PROV);
         OCRepPayloadSetPropInt(payload, OC_RSRVD_ES_PS, gProvResource.ps);
         OCRepPayloadSetPropInt(payload, OC_RSRVD_ES_TNT, gProvResource.tnt);
@@ -338,18 +338,18 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag,
 {
     (void) callback;
     OCEntityHandlerResult ehRet = OC_EH_OK;
-    OCEntityHandlerResponse response = { 0 };
+    OCEntityHandlerResponse response = { 0, 0, OC_EH_ERROR, 0, 0, { },{ 0 }, false };
     OCRepPayload* payload = NULL;
     if (entityHandlerRequest && (flag & OC_REQUEST_FLAG))
     {
         if (OC_REST_GET == entityHandlerRequest->method)
         {
-            OC_LOG(INFO, ES_RH_TAG, "Received GET request");
+            OIC_LOG(INFO, ES_RH_TAG, "Received GET request");
             ehRet = ProcessGetRequest(entityHandlerRequest, &payload);
         }
         else if (OC_REST_PUT == entityHandlerRequest->method)
         {
-            OC_LOG(INFO, ES_RH_TAG, "Received PUT request");
+            OIC_LOG(INFO, ES_RH_TAG, "Received PUT request");
 
             if (gProvResource.handle != NULL && entityHandlerRequest->resource == gProvResource.handle)
             {
@@ -357,14 +357,14 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag,
             }
             else
             {
-                OC_LOG(ERROR, ES_RH_TAG, "Cannot process put");
+                OIC_LOG(ERROR, ES_RH_TAG, "Cannot process put");
                 ehRet = OC_EH_ERROR;
             }
         }
         else if (OC_REST_POST == entityHandlerRequest->method)
         {
             // TODO: As of now, POST request will be not received.
-            OC_LOG(INFO, ES_RH_TAG, "Received OC_REST_POST from client");
+            OIC_LOG(INFO, ES_RH_TAG, "Received OC_REST_POST from client");
             //ehRet = ProcessPostRequest (entityHandlerRequest, payload, sizeof(payload) - 1);
         }
 
@@ -386,7 +386,7 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag,
             // Send the response
             if (OCDoResponse(&response) != OC_STACK_OK)
             {
-                OC_LOG(ERROR, ES_RH_TAG, "Error sending response");
+                OIC_LOG(ERROR, ES_RH_TAG, "Error sending response");
                 ehRet = OC_EH_ERROR;
             }
         }
index 0c816bf..ab4d54f 100644 (file)
@@ -52,16 +52,16 @@ print_state(wifi_connection_state_e state)
 
 void __wifi_connected_cb(wifi_error_e error_code, void *user_data)
 {
-    OC_LOG(INFO,LOG_TAG,"#### __connected ");
+    OIC_LOG(INFO,LOG_TAG,"#### __connected ");
     wifi_ap_get_ip_address(connectedWifi, WIFI_ADDRESS_FAMILY_IPV4, &gIpAddress);
-    OC_LOG_V(INFO,LOG_TAG,"#### __connected, Ipaddress=%s", gIpAddress);
+    OIC_LOG_V(INFO,LOG_TAG,"#### __connected, Ipaddress=%s", gIpAddress);
     gNetworkEventCb(ES_OK);
 
 }
 
 bool __wifi_found_ap_cb(wifi_ap_h ap, void *user_data)
 {
-    OC_LOG(INFO,LOG_TAG,"#### __wifi_found_ap_cb received ");
+    OIC_LOG(INFO,LOG_TAG,"#### __wifi_found_ap_cb received ");
 
     int error_code = 0;
     char *ap_name = NULL;
@@ -70,47 +70,47 @@ bool __wifi_found_ap_cb(wifi_ap_h ap, void *user_data)
     error_code = wifi_ap_get_essid(ap, &ap_name);
     if (error_code != WIFI_ERROR_NONE)
     {
-        OC_LOG(ERROR,LOG_TAG,"#### Fail to get AP name.");
+        OIC_LOG(ERROR,LOG_TAG,"#### Fail to get AP name.");
 
         return false;
     }
     error_code = wifi_ap_get_connection_state(ap, &state);
     if (error_code != WIFI_ERROR_NONE)
     {
-        OC_LOG(ERROR,LOG_TAG,"#### Fail to get state.");
+        OIC_LOG(ERROR,LOG_TAG,"#### Fail to get state.");
 
         return false;
     }
-    OC_LOG_V(INFO,LOG_TAG,"#### AP name : %s, state : %s", ap_name, print_state(state));
+    OIC_LOG_V(INFO,LOG_TAG,"#### AP name : %s, state : %s", ap_name, print_state(state));
 
     if (strcmp(ap_name, gSsid) == 0)
     {
-        OC_LOG(INFO,LOG_TAG,"#### network found");
+        OIC_LOG(INFO,LOG_TAG,"#### network found");
         wifi_ap_set_passphrase(ap, gPass);
         connectedWifi = ap;
         error_code = wifi_connect(ap, __wifi_connected_cb, NULL);
-        OC_LOG_V(INFO,LOG_TAG,"Code=%d", error_code);
+        OIC_LOG_V(INFO,LOG_TAG,"Code=%d", error_code);
     }
-    OC_LOG(INFO,LOG_TAG,"#### __wifi_found_ap_cb received ");
+    OIC_LOG(INFO,LOG_TAG,"#### __wifi_found_ap_cb received ");
     return true;
 }
 void __scan_request_cb(wifi_error_e error_code, void *user_data)
 {
-    OC_LOG(INFO, LOG_TAG, "__scan_request_cb");
+    OIC_LOG(INFO, LOG_TAG, "__scan_request_cb");
     int error_code1;
     error_code1 = wifi_foreach_found_aps(__wifi_found_ap_cb, NULL);
     if (error_code1 != WIFI_ERROR_NONE)
-        OC_LOG(INFO,LOG_TAG,"#### Fail to scan");
+        OIC_LOG(INFO,LOG_TAG,"#### Fail to scan");
 
-    OC_LOG(INFO, LOG_TAG,"#### __scan_request_cb exit ");
+    OIC_LOG(INFO, LOG_TAG,"#### __scan_request_cb exit ");
 }
 
 static void __wifi_activated_cb(wifi_error_e result, void *user_data)
 {
-    OC_LOG(INFO, LOG_TAG, "__wifi_activated_cb");
+    OIC_LOG(INFO, LOG_TAG, "__wifi_activated_cb");
     if (result == WIFI_ERROR_NONE)
     {
-        OC_LOG(INFO,LOG_TAG,"#### Success to activate Wi-Fi device!");
+        OIC_LOG(INFO,LOG_TAG,"#### Success to activate Wi-Fi device!");
     }
     wifi_scan(__scan_request_cb, NULL);
 
@@ -119,34 +119,34 @@ static void ESActivateWifi()
 {
     int error_code;
     error_code = wifi_initialize();
-    OC_LOG_V(INFO,LOG_TAG,"#### WIFI INITIALIZED WITH STATUS :%d", error_code);
+    OIC_LOG_V(INFO,LOG_TAG,"#### WIFI INITIALIZED WITH STATUS :%d", error_code);
 
     error_code = wifi_activate(__wifi_activated_cb, NULL);
-    OC_LOG_V(INFO,LOG_TAG,"#### WIFI ACTIVATED WITH STATUS :%d", error_code);
+    OIC_LOG_V(INFO,LOG_TAG,"#### WIFI ACTIVATED WITH STATUS :%d", error_code);
 
     bool wifi_activated = false;
     wifi_is_activated(&wifi_activated);
     if (wifi_activated)
     {
-        OC_LOG(INFO,LOG_TAG,"#### Success to get Wi-Fi device state.");
+        OIC_LOG(INFO,LOG_TAG,"#### Success to get Wi-Fi device state.");
         int scan_result = wifi_scan(__scan_request_cb, NULL);
-        OC_LOG_V(INFO,LOG_TAG,"#### Wifi scan result:%d", scan_result);
+        OIC_LOG_V(INFO,LOG_TAG,"#### Wifi scan result:%d", scan_result);
     }
     else
     {
-        OC_LOG(ERROR,LOG_TAG, "#### Fail to get Wi-Fi device state.");
+        OIC_LOG(ERROR,LOG_TAG, "#### Fail to get Wi-Fi device state.");
     }
 }
 
 static void start()
 {
-    OC_LOG(INFO, LOG_TAG, "START");
+    OIC_LOG(INFO, LOG_TAG, "START");
     ESActivateWifi();
 }
 
 void ConnectToWiFiNetwork(const char *ssid, const char *pass, NetworkEventCallback cb)
 {
-    OC_LOG_V(INFO, LOG_TAG, "ConnectToWiFiNetwork %s %s",ssid,pass);
+    OIC_LOG_V(INFO, LOG_TAG, "ConnectToWiFiNetwork %s %s",ssid,pass);
     gPass = pass;
     gSsid = ssid;
     gNetworkEventCb = cb;
index fe4e5bf..3a6929e 100644 (file)
@@ -49,14 +49,14 @@ namespace OIC
         RemoteEnrollee::shared_ptr EasySetup::findDeviceInProvisioningList (
                             const ProvConfig& provConfig, const WiFiOnboadingConnection& onboardingconn)
         {
-            OC_LOG(DEBUG,EASYSETUP_TAG,"Entered findDeviceInProvisioningList ()");
+            OIC_LOG(DEBUG,EASYSETUP_TAG,"Entered findDeviceInProvisioningList ()");
 
             std::vector< std::shared_ptr< RemoteEnrollee > >::iterator it;
 
             std::shared_ptr< RemoteEnrollee > remoteEnrollee = nullptr;
             for(auto it : m_activeEnrolleeList)
             {
-                OC_LOG_V(DEBUG,EASYSETUP_TAG,"entered the iterator");
+                OIC_LOG_V(DEBUG,EASYSETUP_TAG,"entered the iterator");
 
                 ProvConfig activeEnrolleConfig =  it->getProvConfig();
                 WiFiOnboadingConnection activeEnrolleConn = it->getOnboardConn();
@@ -70,7 +70,7 @@ namespace OIC
                 }
             }
 
-            OC_LOG_V(DEBUG,EASYSETUP_TAG,"Return nullptr for  findDeviceInProvisioningList call");
+            OIC_LOG_V(DEBUG,EASYSETUP_TAG,"Return nullptr for  findDeviceInProvisioningList call");
             return remoteEnrollee;
         }
 
@@ -95,7 +95,7 @@ namespace OIC
                 }
             }
 
-            OC_LOG_V(DEBUG,EASYSETUP_TAG,"Adding new device RemoteEnrollee list");
+            OIC_LOG_V(DEBUG,EASYSETUP_TAG,"Adding new device RemoteEnrollee list");
             m_activeEnrolleeList.push_back(remoteEnrollee);
             return true;
         }
index b0ff4fe..a630ecd 100644 (file)
@@ -80,9 +80,9 @@ namespace OIC
         {
             for (unsigned int i = 0; i < list.size(); i++)
             {
-                OC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Device %d ID %s ", i + 1,
+                OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Device %d ID %s ", i + 1,
                         list[i]->getDeviceID().c_str());
-                OC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "From IP :%s", list[i]->getDevAddr().c_str());
+                OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "From IP :%s", list[i]->getDevAddr().c_str());
 
                 if (list[i]->getDevAddr() == host)
                 {
@@ -115,7 +115,7 @@ namespace OIC
         {
             if (hasError)
             {
-                OC_LOG(ERROR, ENROLEE_SECURITY_TAG,"Error!!! in OwnershipTransfer");
+                OIC_LOG(ERROR, ENROLEE_SECURITY_TAG,"Error!!! in OwnershipTransfer");
 
                 std::shared_ptr< SecProvisioningResult > securityProvisioningStatus = nullptr;
                 std::string uuid;
@@ -128,14 +128,14 @@ namespace OIC
             }
             else
             {
-                OC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "ownershipTransferCb : Received provisioning results: ");
+                OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "ownershipTransferCb : Received provisioning results: ");
                 for (unsigned int i = 0; i < result->size(); i++)
                 {
-                    OC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Result is = %d for device",result->at(i).res);
+                    OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Result is = %d for device",result->at(i).res);
                     std::string uuid;
                     convertUUIDToString(result->at(0).deviceId, uuid);
 
-                    OC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "UUID : %s",uuid.c_str());
+                    OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "UUID : %s",uuid.c_str());
                     std::shared_ptr< SecProvisioningResult > securityProvisioningStatus = nullptr;
                     securityProvisioningStatus = std::make_shared< SecProvisioningResult >(uuid,
                             ES_OK);
@@ -165,7 +165,7 @@ namespace OIC
                     pOwnedDevList);
             if (result != OC_STACK_OK)
             {
-                OC_LOG(ERROR, ENROLEE_SECURITY_TAG, "Owned Discovery failed.");
+                OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "Owned Discovery failed.");
                 ownershipStatus = DEVICE_NOT_OWNED;
                 //Throw exception
                 throw ESPlatformException(result);
@@ -173,7 +173,7 @@ namespace OIC
             }
             else if (pOwnedDevList.size())
             {
-                OC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Found owned devices. Count =%d",
+                OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Found owned devices. Count =%d",
                         pOwnedDevList.size());
                 std::shared_ptr< OC::OCSecureResource > ownedDevice =
                         findEnrollee(
@@ -188,14 +188,14 @@ namespace OIC
             }
             else
             {
-                OC_LOG(ERROR, ENROLEE_SECURITY_TAG, "No owned devices found.");
+                OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "No owned devices found.");
                 ownershipStatus = DEVICE_NOT_OWNED;
             }
 
             result = OCSecure::discoverUnownedDevices(ES_SEC_DISCOVERY_TIMEOUT, pUnownedDevList);
             if (result != OC_STACK_OK)
             {
-                OC_LOG(ERROR, ENROLEE_SECURITY_TAG, "UnOwned Discovery failed.");
+                OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "UnOwned Discovery failed.");
                 ownershipStatus = DEVICE_NOT_OWNED;
                 //Throw exception
                 throw ESPlatformException(result);
@@ -203,7 +203,7 @@ namespace OIC
             }
             else if (pUnownedDevList.size())
             {
-                OC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Found Unowned devices. Count =%d",
+                OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Found Unowned devices. Count =%d",
                         pUnownedDevList.size());
 
                 m_unownedDevice =
@@ -220,7 +220,7 @@ namespace OIC
                             CreateJustWorksOwnerTransferPayload;
                     OCSecure::setOwnerTransferCallbackData(OIC_JUST_WORKS, &justWorksCBData, NULL);
 
-                    OC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Transfering ownership for : %s ",
+                    OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Transfering ownership for : %s ",
                             m_unownedDevice->getDeviceID().c_str());
 
                     OC::ResultCallBack ownershipTransferCb = std::bind(
@@ -229,7 +229,7 @@ namespace OIC
 
                     if (m_unownedDevice->doOwnershipTransfer(ownershipTransferCb) != OC_STACK_OK)
                     {
-                        OC_LOG(ERROR, ENROLEE_SECURITY_TAG, "OwnershipTransferCallback is failed");
+                        OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "OwnershipTransferCallback is failed");
                         ownershipStatus = DEVICE_NOT_OWNED;
                         //Throw exception
                         throw ESPlatformException(result);
@@ -239,7 +239,7 @@ namespace OIC
             }
             else
             {
-                OC_LOG(ERROR, ENROLEE_SECURITY_TAG, "No unSecure devices found.");
+                OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "No unSecure devices found.");
                 ownershipStatus = DEVICE_NOT_OWNED;
 
                 return ownershipStatus;
index 2a359dd..dc6a97a 100644 (file)
@@ -38,7 +38,7 @@ namespace OIC
             m_currentESState = CurrentESState::ES_UNKNOWN;
             m_isSecured = connection.isSecured; //enrolleeNWProvInfo.needSecuredEasysetup;
 
-            OC_LOG ( DEBUG, ES_REMOTE_ENROLLEE_TAG, "Inside RemoteEnrollee constr");
+            OIC_LOG ( DEBUG, ES_REMOTE_ENROLLEE_TAG, "Inside RemoteEnrollee constr");
         }
 
 #ifdef __WITH_DTLS__
@@ -58,7 +58,7 @@ namespace OIC
 
         void RemoteEnrollee::registerEasySetupStatusHandler(EasySetupStatusCB callback)
         {
-            OC_LOG ( DEBUG, ES_REMOTE_ENROLLEE_TAG, "Entered registerStatusHandler");
+            OIC_LOG ( DEBUG, ES_REMOTE_ENROLLEE_TAG, "Entered registerStatusHandler");
             if(!callback)
             {
                 throw ESInvalidParameterException("Callback is empty");
@@ -79,18 +79,18 @@ namespace OIC
         void RemoteEnrollee::easySetupSecurityStatusCallback(
                         std::shared_ptr< SecProvisioningResult > secProvisioningResult)
         {
-            OC_LOG_V(DEBUG, ES_REMOTE_ENROLLEE_TAG, "easySetupStatusCallback status is, UUID = %s, "
+            OIC_LOG_V(DEBUG, ES_REMOTE_ENROLLEE_TAG, "easySetupStatusCallback status is, UUID = %s, "
                     "Status = %d", secProvisioningResult->getDeviceUUID().c_str(),
                     secProvisioningResult->getResult());
 
             if(secProvisioningResult->getResult() == ES_OK)
             {
-                OC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "Ownership and ACL are successful. "
+                OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "Ownership and ACL are successful. "
                         "Continue with Network information provisioning");
 
                 m_currentESState = CurrentESState::ES_OWNED;
 
-                OC_LOG(DEBUG,ES_REMOTE_ENROLLEE_TAG,"Before ProvisionEnrollee");
+                OIC_LOG(DEBUG,ES_REMOTE_ENROLLEE_TAG,"Before ProvisionEnrollee");
 
                 RemoteEnrolleeResource::ProvStatusCb provStatusCb = std::bind(
                         &RemoteEnrollee::provisioningStatusHandler, this, std::placeholders::_1);
@@ -100,7 +100,7 @@ namespace OIC
             }
             else
             {
-                OC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "Ownership and ACL are successful");
+                OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "Ownership and ACL are successful");
                 std::shared_ptr< EasySetupStatus > easySetupStatus = nullptr;
                 easySetupStatus = std::make_shared< EasySetupStatus >(DEVICE_NOT_PROVISIONED,
                                             m_ProvConfig);
@@ -121,9 +121,9 @@ namespace OIC
         void RemoteEnrollee::provisioningStatusHandler(
                 std::shared_ptr< ProvisioningStatus > provStatus)
         {
-            OC_LOG(DEBUG,ES_REMOTE_ENROLLEE_TAG,"Entering ProvisioningStatusHandler");
+            OIC_LOG(DEBUG,ES_REMOTE_ENROLLEE_TAG,"Entering ProvisioningStatusHandler");
 
-            OC_LOG_V(DEBUG,ES_REMOTE_ENROLLEE_TAG,"ProvStatus = %d", provStatus->getESResult());
+            OIC_LOG_V(DEBUG,ES_REMOTE_ENROLLEE_TAG,"ProvStatus = %d", provStatus->getESResult());
 
             std::shared_ptr< EasySetupStatus > easySetupStatus = nullptr;
 
@@ -196,7 +196,7 @@ namespace OIC
 
         void RemoteEnrollee::startProvisioning()
         {
-            OC_LOG(DEBUG,ES_REMOTE_ENROLLEE_TAG,"Entering startProvisioning");
+            OIC_LOG(DEBUG,ES_REMOTE_ENROLLEE_TAG,"Entering startProvisioning");
             if (m_remoteResource == nullptr)
             {
                 throw ESBadRequestException ("Device not created");
@@ -208,7 +208,7 @@ namespace OIC
 
             if (result == ES_ERROR)
             {
-                OC_LOG(ERROR,ES_REMOTE_ENROLLEE_TAG,
+                OIC_LOG(ERROR,ES_REMOTE_ENROLLEE_TAG,
                                     "Failed to create device using constructResourceObject");
                 throw ESBadRequestException ("Device not created");
             }
@@ -233,17 +233,17 @@ namespace OIC
                     EasySetupState easySetupState = m_enrolleeSecurity->performOwnershipTransfer();
                     if (easySetupState == DEVICE_NOT_OWNED)
                     {
-                        OC_LOG_V(DEBUG, ES_REMOTE_ENROLLEE_TAG,
+                        OIC_LOG_V(DEBUG, ES_REMOTE_ENROLLEE_TAG,
                                 "performOwnershipTransfer returned : %d",
                                 easySetupState);
                         return;
                     }
                     else if (easySetupState == DEVICE_OWNED)
                     {
-                        OC_LOG_V(DEBUG, ES_REMOTE_ENROLLEE_TAG,
+                        OIC_LOG_V(DEBUG, ES_REMOTE_ENROLLEE_TAG,
                                 "performOwnershipTransfer returned : %d",
                                 easySetupState);
-                        OC_LOG(DEBUG,ES_REMOTE_ENROLLEE_TAG,"Before ProvisionEnrollee");
+                        OIC_LOG(DEBUG,ES_REMOTE_ENROLLEE_TAG,"Before ProvisionEnrollee");
 
                         RemoteEnrolleeResource::ProvStatusCb provStatusCb = std::bind(
                                 &RemoteEnrollee::provisioningStatusHandler,
@@ -255,13 +255,13 @@ namespace OIC
                 }
                 catch (OCException & e)
                 {
-                    OC_LOG_V(ERROR, ES_REMOTE_ENROLLEE_TAG,
+                    OIC_LOG_V(ERROR, ES_REMOTE_ENROLLEE_TAG,
                             "Exception for performOwnershipTransfer : %s", e.reason().c_str());
                     return ;
                 }
             }
 #else
-            OC_LOG(DEBUG,ES_REMOTE_ENROLLEE_TAG,"Before ProvisionEnrollee");
+            OIC_LOG(DEBUG,ES_REMOTE_ENROLLEE_TAG,"Before ProvisionEnrollee");
 
             RemoteEnrolleeResource::ProvStatusCb provStatusCb = std::bind(
                     &RemoteEnrollee::provisioningStatusHandler, this, std::placeholders::_1);
old mode 100644 (file)
new mode 100755 (executable)
index 79c63f5..43673e4
@@ -50,13 +50,13 @@ namespace OIC
         void RemoteEnrolleeResource::checkProvInformationCb(const HeaderOptions& /*headerOptions*/,
                 const OCRepresentation& rep, const int eCode)
         {
-            OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "checkProvInformationCb : %s, eCode = %d",
+            OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "checkProvInformationCb : %s, eCode = %d",
                     rep.getUri().c_str(),
                     eCode);
 
             if (eCode != 0)
             {
-                OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
+                OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
                         "checkProvInformationCb : Provisioning is failed ");
                 std::shared_ptr< ProvisioningStatus > provStatus = std::make_shared<
                         ProvisioningStatus >(ESResult::ES_ERROR, ESState::ES_PROVISIONING_ERROR);
@@ -72,10 +72,10 @@ namespace OIC
             rep.getValue(OC_RSRVD_ES_TNN, tnn);
             rep.getValue(OC_RSRVD_ES_CD, cd);
 
-            OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "checkProvInformationCb : ps - %d", ps);
-            OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
+            OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "checkProvInformationCb : ps - %d", ps);
+            OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
                     "checkProvInformationCb : tnn - %s", tnn.c_str());
-            OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
+            OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
                     "checkProvInformationCb : cd - %s", cd.c_str());
 
             //Provisioning status check
@@ -83,7 +83,7 @@ namespace OIC
             {
                 if (tnn != std::string(m_ProvConfig.provData.WIFI.ssid))
                 {
-                    OC_LOG_V (ERROR, ES_REMOTE_ENROLLEE_RES_TAG,
+                    OIC_LOG_V (ERROR, ES_REMOTE_ENROLLEE_RES_TAG,
                             "checkProvInformationCb : Network SSID is not the same as the "
                             "SSID provisioned");
                     std::shared_ptr< ProvisioningStatus > provStatus = std::make_shared<
@@ -95,7 +95,7 @@ namespace OIC
 
                 if (cd != std::string(m_ProvConfig.provData.WIFI.pwd))
                 {
-                    OC_LOG_V (ERROR, ES_REMOTE_ENROLLEE_RES_TAG,
+                    OIC_LOG_V (ERROR, ES_REMOTE_ENROLLEE_RES_TAG,
                             "checkProvInformationCb : Network PWD is not the same as the "
                             "PWD provisioned");
                     std::shared_ptr< ProvisioningStatus > provStatus = std::make_shared<
@@ -105,7 +105,7 @@ namespace OIC
                     return;
                 }
 
-                OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
+                OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
                         "checkProvInformationCb : Provisioning is success ");
                 std::shared_ptr< ProvisioningStatus > provStatus = std::make_shared<
                         ProvisioningStatus >(ESResult::ES_OK, ESState::ES_PROVISIONING_SUCCESS);
@@ -114,7 +114,7 @@ namespace OIC
             }
             else
             {
-                OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
+                OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
                         "checkProvInformationCb : Provisioning is failed ");
                 std::shared_ptr< ProvisioningStatus > provStatus = std::make_shared<
                         ProvisioningStatus >(ESResult::ES_ERROR, ESState::ES_PROVISIONING_ERROR);
@@ -126,13 +126,13 @@ namespace OIC
         void RemoteEnrolleeResource::getProvStatusResponse(const HeaderOptions& /*headerOptions*/,
                 const OCRepresentation& rep, const int eCode)
         {
-            OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getProvStatusResponse : %s, eCode = %d",
+            OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getProvStatusResponse : %s, eCode = %d",
                     rep.getUri().c_str(),
                     eCode);
 
             if (eCode != 0)
             {
-                OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
+                OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
                         "getProvStatusResponse : Provisioning is failed ");
                 std::shared_ptr< ProvisioningStatus > provStatus = std::make_shared<
                         ProvisioningStatus >(ESResult::ES_ERROR, ESState::ES_PROVISIONING_ERROR);
@@ -148,11 +148,11 @@ namespace OIC
             rep.getValue(OC_RSRVD_ES_TNN, tnn);
             rep.getValue(OC_RSRVD_ES_CD, cd);
 
-            OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getProvStatusResponse : ps - %d",
+            OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getProvStatusResponse : ps - %d",
                     ps);
-            OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getProvStatusResponse : tnn - %s",
+            OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getProvStatusResponse : tnn - %s",
                     tnn.c_str());
-            OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getProvStatusResponse : cd - %s",
+            OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getProvStatusResponse : cd - %s",
                     cd.c_str());
 
             if (ps == ES_PS_NEED_PROVISIONING) //Indicates the need for provisioning
@@ -164,9 +164,9 @@ namespace OIC
                 provisioningRepresentation.setValue(OC_RSRVD_ES_CD,
                 std::string(m_ProvConfig.provData.WIFI.pwd));
 
-                OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getProvStatusResponse : ssid - %s",
+                OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getProvStatusResponse : ssid - %s",
                         m_ProvConfig.provData.WIFI.ssid);
-                OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getProvStatusResponse : pwd - %s",
+                OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getProvStatusResponse : pwd - %s",
                         m_ProvConfig.provData.WIFI.pwd);
 
                 m_ocResource->put(provisioningRepresentation, QueryParamsMap(),
@@ -179,7 +179,7 @@ namespace OIC
             }
             else if (ps == ES_PS_PROVISIONING_COMPLETED) //Indicates that provisioning is completed
             {
-                OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
+                OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
                         "getProvStatusResponse : Provisioning is successful");
                 std::shared_ptr< ProvisioningStatus > provStatus = std::make_shared<
                         ProvisioningStatus >(ESResult::ES_OK, ESState::ES_PROVISIONED_ALREADY);
@@ -240,7 +240,7 @@ namespace OIC
 
         void RemoteEnrolleeResource::onDeviceDiscovered(std::shared_ptr<OC::OCResource> resource)
         {
-            OC_LOG (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "onDeviceDiscovered");
+            OIC_LOG (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "onDeviceDiscovered");
 
             std::string resourceURI;
             std::string hostAddress;
@@ -250,12 +250,12 @@ namespace OIC
                 {
                     // Get the resource URI
                     resourceURI = resource->uri();
-                    OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
+                    OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
                             "URI of the resource: %s", resourceURI.c_str());
 
                     // Get the resource host address
                     hostAddress = resource->host();
-                    OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
+                    OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
                             "Host address of the resource: %s", hostAddress.c_str());
 
                     std::size_t foundIP =
@@ -267,25 +267,25 @@ namespace OIC
                         m_ocResource = resource;
                         m_discoveryResponse = true;
 
-                        OC_LOG (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
+                        OIC_LOG (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
                                 "Found the device with the resource");
 
                         return;
                     }
                     else
                     {
-                        OC_LOG (ERROR, ES_REMOTE_ENROLLEE_RES_TAG, "NOT the intended resource.");
+                        OIC_LOG (ERROR, ES_REMOTE_ENROLLEE_RES_TAG, "NOT the intended resource.");
                     }
                 }
                 else
                 {
-                    OC_LOG (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "Resource is invalid");
+                    OIC_LOG (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "Resource is invalid");
                 }
 
             }
             catch(std::exception& e)
             {
-                OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
+                OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
                         "Exception in foundResource: %s", e.what());
             }
         }
@@ -309,16 +309,16 @@ namespace OIC
                 std::vector< std::string > resTypes =
                 {   ES_PROV_RES_TYPE};
 
-                OC_LOG(DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "Before OCPlatform::constructResourceObject");
+                OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "Before OCPlatform::constructResourceObject");
 
-                OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "m_host = %s",
+                OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "m_host = %s",
                         m_wifiOnboardingconn.ipAddress);
-                OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "ES_PROV_RES_URI = %s", ES_PROV_RES_URI);
-                OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "m_connectivityType = %d",
+                OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "ES_PROV_RES_URI = %s", ES_PROV_RES_URI);
+                OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "m_connectivityType = %d",
                         m_ProvConfig.connType);
-                OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "resTypes = %s",
+                OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "resTypes = %s",
                         resTypes.at(0).c_str());
-                OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "interface = %s", interface.at(0).c_str());
+                OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "interface = %s", interface.at(0).c_str());
 
                 std::string host;
                 if(m_wifiOnboardingconn.isSecured)
@@ -343,7 +343,7 @@ namespace OIC
                     host.append(":55555");
                 }
 
-                OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "HOST = %s", host.c_str());
+                OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "HOST = %s", host.c_str());
 
                 m_ocResource = OC::OCPlatform::constructResourceObject(host,
                         ES_PROV_RES_URI,
@@ -351,17 +351,17 @@ namespace OIC
                         true,
                         resTypes,
                         interface);
-                OC_LOG_V(DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
+                OIC_LOG_V(DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
                         "created OCResource : %s", m_ocResource->uri().c_str());
 
                 return ES_OK;
             }
             catch (OCException & e)
             {
-                OC_LOG_V(ERROR, ES_REMOTE_ENROLLEE_RES_TAG,
+                OIC_LOG_V(ERROR, ES_REMOTE_ENROLLEE_RES_TAG,
                         "Exception for constructResourceObject : %s", e.reason().c_str());
+                return ES_ERROR;
             }
-
 #else
             std::string host("");
             std::string query("");
@@ -388,12 +388,12 @@ namespace OIC
             query.append("?rt=");
             query.append(ES_PROV_RES_TYPE);
 
-            OC_LOG(DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "Before OCPlatform::constructResourceObject");
+            OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "Before OCPlatform::constructResourceObject");
 
-            OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "host = %s",
+            OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "host = %s",
                     host.c_str());
-            OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "query = %s", query.c_str());
-            OC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "m_connectivityType = %d",
+            OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "query = %s", query.c_str());
+            OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "m_connectivityType = %d",
                     m_ProvConfig.connType);
 
             m_discoveryResponse = false;
@@ -405,7 +405,7 @@ namespace OIC
 
             if (result != OCStackResult::OC_STACK_OK)
             {
-                OC_LOG(ERROR,ES_REMOTE_ENROLLEE_RES_TAG,
+                OIC_LOG(ERROR,ES_REMOTE_ENROLLEE_RES_TAG,
                         "Failed to create device using constructResourceObject");
                 return ES_ERROR;
             }
@@ -413,9 +413,9 @@ namespace OIC
 
             ESResult foundResponse = ESDiscoveryTimeout (DISCOVERY_TIMEOUT);
 
-            if (!m_discoveryResponse)
+            if (foundResponse ==ES_ERROR || !m_discoveryResponse)
             {
-                OC_LOG(ERROR,ES_REMOTE_ENROLLEE_RES_TAG,
+                OIC_LOG(ERROR,ES_REMOTE_ENROLLEE_RES_TAG,
                         "Failed to create device using constructResourceObject");
                 return ES_ERROR;
             }
index f00c889..843a55b 100644 (file)
@@ -136,13 +136,13 @@ void EventCallbackInApp(ESResult esResult, EnrolleeState enrolleeState)
     {
         if(g_OnBoardingSucceeded)
         {
-            OC_LOG_V(ERROR, TAG, "Failure in Provisioning. \
+            OIC_LOG_V(ERROR, TAG, "Failure in Provisioning. \
                                         Current Enrollee State: %d",enrolleeState);
             g_OnBoardingSucceeded = false;
         }
         else if(g_ProvisioningSucceeded)
         {
-            OC_LOG_V(ERROR, TAG, "Failure in connect to target network. \
+            OIC_LOG_V(ERROR, TAG, "Failure in connect to target network. \
                                         Current Enrollee State: %d",enrolleeState);
             g_ProvisioningSucceeded = false;
         }
@@ -163,66 +163,66 @@ void PrintArduinoMemoryStats()
     extern char *__brkval;
     //address of tmp gives us the current stack boundry
     int tmp;
-    OC_LOG_V(INFO, TAG, "Stack: %u         Heap: %u", (unsigned int)&tmp, (unsigned int)__brkval);
-    OC_LOG_V(INFO, TAG, "Unallocated Memory between heap and stack: %u",
+    OIC_LOG_V(INFO, TAG, "Stack: %u         Heap: %u", (unsigned int)&tmp, (unsigned int)__brkval);
+    OIC_LOG_V(INFO, TAG, "Unallocated Memory between heap and stack: %u",
             ((unsigned int)&tmp - (unsigned int)__brkval));
 #endif
 }
 
 void StartEasySetup()
 {
-    OC_LOG(DEBUG, TAG, "OCServer is starting...");
+    OIC_LOG(DEBUG, TAG, "OCServer is starting...");
 
     //InitEasySetup with sercurity mode disabled for arduino
     if(InitEasySetup(CT_ADAPTER_IP, ssid, passwd, false, EventCallbackInApp) == ES_ERROR)
     {
-        OC_LOG(ERROR, TAG, "OnBoarding Failed");
+        OIC_LOG(ERROR, TAG, "OnBoarding Failed");
         return;
     }
 
     g_isInitialized = true;
 
-    OC_LOG_V(ERROR, TAG, "OnBoarding succeded. Successfully connected to ssid : %s",ssid);
+    OIC_LOG_V(ERROR, TAG, "OnBoarding succeded. Successfully connected to ssid : %s",ssid);
 }
 
 void StartProvisioning()
 {
-    OC_LOG(DEBUG, TAG, "StartProvisioning is invoked...");
+    OIC_LOG(DEBUG, TAG, "StartProvisioning is invoked...");
 
     // Initialize the OC Stack in Server mode
     if (OCInit(NULL, 0, OC_SERVER) != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack init error!!");
+        OIC_LOG(ERROR, TAG, "OCStack init error!!");
         return;
     }
 
     if (InitProvisioning() == ES_ERROR)
     {
-        OC_LOG(ERROR, TAG, "Init Provisioning Failed!!");
+        OIC_LOG(ERROR, TAG, "Init Provisioning Failed!!");
         return;
     }
 }
 
 void StopEasySetup()
 {
-    OC_LOG(DEBUG, TAG, "Stopping EasySetup is invoked...");
+    OIC_LOG(DEBUG, TAG, "Stopping EasySetup is invoked...");
 
     g_isInitialized = false;
 
     if (TerminateEasySetup() == ES_ERROR)
     {
-        OC_LOG(ERROR, TAG, "TerminateEasySetup Failed!!");
+        OIC_LOG(ERROR, TAG, "TerminateEasySetup Failed!!");
         return;
     }
 
     //stop OC Stack
     if (OCStop() != OC_STACK_OK)
     {
-        OC_LOG(ERROR, TAG, "OCStack stop failed!!");
+        OIC_LOG(ERROR, TAG, "OCStack stop failed!!");
         return;
     }
 
-    OC_LOG(DEBUG, TAG, "Stopping EasySetup done");
+    OIC_LOG(DEBUG, TAG, "Stopping EasySetup done");
 }
 
 
@@ -231,7 +231,7 @@ void setup()
 {
     // Add your initialization code here
     // Note : This will initialize Serial port on Arduino at 115200 bauds
-    OC_LOG_INIT();
+    OIC_LOG_INIT();
 
     Serial.println("#########################");
     Serial.println("EasySetup Enrollee SAMPLE");
@@ -293,7 +293,7 @@ void loop()
         // Give CPU cycles to OCStack to perform send/recv and other OCStack stuff
         if (OCProcess() != OC_STACK_OK)
         {
-            OC_LOG(ERROR, TAG, "OCStack process error");
+            OIC_LOG(ERROR, TAG, "OCStack process error");
             return;
         }
     }
index 75ef306..5aa59a9 100644 (file)
@@ -44,26 +44,26 @@ void EventCallbackInApp(ESResult esResult, EnrolleeState enrolleeState)
 
 {
     string logmessage = "callback!!! in app";
-    OC_LOG(INFO,LOG_TAG,"callback!!! in app");
+    OIC_LOG(INFO,LOG_TAG,"callback!!! in app");
 
     if (esResult == ES_OK)
     {
         if (!g_OnBoardingSucceeded)
         {
-            OC_LOG(INFO,LOG_TAG,"Device is successfully OnBoarded");
+            OIC_LOG(INFO,LOG_TAG,"Device is successfully OnBoarded");
             logmessage += "Device is successfully OnBoarded";
             g_OnBoardingSucceeded = true;
         }
         else if (g_OnBoardingSucceeded & enrolleeState == ES_ON_BOARDED_STATE)
         {
-            OC_LOG(INFO,LOG_TAG,"Device is successfully OnBoared with SoftAP");
+            OIC_LOG(INFO,LOG_TAG,"Device is successfully OnBoared with SoftAP");
             logmessage += "Device is successfully OnBoared with SoftAP";
             g_ProvisioningSucceeded = true;
         }
 
         else if (enrolleeState == ES_PROVISIONED_STATE)
         {
-            OC_LOG(INFO,LOG_TAG,"Device is provisioned");
+            OIC_LOG(INFO,LOG_TAG,"Device is provisioned");
             logmessage += "Device is provisioned";
             g_ProvisioningSucceeded = true;
         }
@@ -73,7 +73,7 @@ void EventCallbackInApp(ESResult esResult, EnrolleeState enrolleeState)
     {
         if (g_OnBoardingSucceeded)
         {
-            OC_LOG_V(ERROR,LOG_TAG,
+            OIC_LOG_V(ERROR,LOG_TAG,
                     "Failure in Provisioning. \
                                         Current Enrollee State: %d",
                     enrolleeState);
@@ -83,7 +83,7 @@ void EventCallbackInApp(ESResult esResult, EnrolleeState enrolleeState)
         }
         else if (g_ProvisioningSucceeded)
         {
-            OC_LOG_V(ERROR,LOG_TAG,
+            OIC_LOG_V(ERROR,LOG_TAG,
                     "Failure in connect to target network. \
                                         Current Enrollee State: %d",
                     enrolleeState);
@@ -138,14 +138,14 @@ static void init_easysetup(void *data, Evas_Object *obj, void *event_info)
     copy_files();
     if (InitEasySetup(CT_ADAPTER_IP, ssid, passwd, EventCallbackInApp) == ES_ERROR)
     {
-        OC_LOG(ERROR,LOG_TAG,"OnBoarding Failed");
+        OIC_LOG(ERROR,LOG_TAG,"OnBoarding Failed");
         logmessage = logmessage + "OnBoarding Failed. Connect to " + ssid + " pasword= " + passwd;
         ecore_main_loop_thread_safe_call_sync((void * (*)(void *))updateGroupLog, &logmessage);
         return;
 
     }
     g_isInitialized = true;
-    OC_LOG_V(ERROR,LOG_TAG, "OnBoarding succeeded. Successfully connected to ssid : %s",
+    OIC_LOG_V(ERROR,LOG_TAG, "OnBoarding succeeded. Successfully connected to ssid : %s",
             ssid);
     logmessage = logmessage + "OnBoarding succeeded. Successfully connected to ssid:" + ssid;
     ecore_main_loop_thread_safe_call_sync((void * (*)(void *))updateGroupLog, &logmessage);
@@ -153,12 +153,12 @@ static void init_easysetup(void *data, Evas_Object *obj, void *event_info)
 
 void StartProvisioning(void *data, Evas_Object *obj, void *event_info)
 {
-    OC_LOG(INFO,LOG_TAG,"StartProvisioning");
+    OIC_LOG(INFO,LOG_TAG,"StartProvisioning");
     string logmessage = "StartProvisioning\n";
 
     if (InitProvisioning() == ES_ERROR)
     {
-        OC_LOG(ERROR,LOG_TAG,"Init Provisioning Failed");
+        OIC_LOG(ERROR,LOG_TAG,"Init Provisioning Failed");
         logmessage += "Init Provisioning Failed\n";
         return;
     }
@@ -167,7 +167,7 @@ void StartProvisioning(void *data, Evas_Object *obj, void *event_info)
 
     if (pthread_create(&thread_handle, NULL, listeningFunc, NULL))
     {
-        OC_LOG(ERROR,LOG_TAG,"Thread creation failed");
+        OIC_LOG(ERROR,LOG_TAG,"Thread creation failed");
 
     }
 
@@ -183,7 +183,7 @@ void *listeningFunc(void*)
 
         if (result != OC_STACK_OK)
         {
-            OC_LOG(ERROR,LOG_TAG,"OCStack stop error");
+            OIC_LOG(ERROR,LOG_TAG,"OCStack stop error");
         }
 
         // To minimize CPU utilization we may wish to do this with sleep
index e8739c6..92418b7 100644 (file)
@@ -49,26 +49,26 @@ void *updateGroupLog(void *data)
 void EventCallbackInApp(ESResult esResult, EnrolleeState enrolleeState)
 {
     string logmessage = "callback!!! in app";
-    OC_LOG(INFO,LOG_TAG,"callback!!! in app");
+    OIC_LOG(INFO,LOG_TAG,"callback!!! in app");
 
     if (esResult == ES_OK)
     {
         if (!g_OnBoardingSucceeded)
         {
-            OC_LOG(INFO,LOG_TAG,"Device is successfully OnBoarded");
+            OIC_LOG(INFO,LOG_TAG,"Device is successfully OnBoarded");
             logmessage += "Device is successfully OnBoarded";
             g_OnBoardingSucceeded = true;
         }
         else if (g_OnBoardingSucceeded & enrolleeState == ES_ON_BOARDED_STATE)
         {
-            OC_LOG(INFO,LOG_TAG,"Device is successfully OnBoared with SoftAP");
+            OIC_LOG(INFO,LOG_TAG,"Device is successfully OnBoared with SoftAP");
             logmessage += "Device is successfully OnBoared with SoftAP";
             g_ProvisioningSucceeded = true;
         }
 
         else if (enrolleeState == ES_PROVISIONED_STATE)
         {
-            OC_LOG(INFO,LOG_TAG,"Device is provisioned");
+            OIC_LOG(INFO,LOG_TAG,"Device is provisioned");
             logmessage += "Device is provisioned";
             g_ProvisioningSucceeded = true;
         }
@@ -78,14 +78,14 @@ void EventCallbackInApp(ESResult esResult, EnrolleeState enrolleeState)
     {
         if (g_OnBoardingSucceeded)
         {
-            OC_LOG_V(ERROR,LOG_TAG,
+            OIC_LOG_V(ERROR,LOG_TAG,
                         "Failure in Provisioning.Current Enrollee State: %d", enrolleeState);
             logmessage += "Failure in Provisioning\n";
             g_OnBoardingSucceeded = false;
         }
         else if (g_ProvisioningSucceeded)
         {
-            OC_LOG_V(ERROR,LOG_TAG,
+            OIC_LOG_V(ERROR,LOG_TAG,
                 "Failure in connect to target network.Current Enrollee State: %d", enrolleeState);
             logmessage += "Failure in connect to target network\n";
             g_ProvisioningSucceeded = false;
@@ -111,14 +111,14 @@ static void init_easysetup(void *data, Evas_Object *obj, void *event_info)
     string logmessage = "Init Easysetup\n";
     if (InitEasySetup(CT_ADAPTER_IP, ssid, passwd, EventCallbackInApp) == ES_ERROR)
     {
-        OC_LOG(ERROR,LOG_TAG,"OnBoarding Failed");
+        OIC_LOG(ERROR,LOG_TAG,"OnBoarding Failed");
         logmessage = logmessage + "OnBoarding Failed. Connect to " + ssid + " pasword= " + passwd;
         ecore_main_loop_thread_safe_call_sync((void * (*)(void *))updateGroupLog, &logmessage);
         return;
 
     }
     g_isInitialized = true;
-    OC_LOG_V(ERROR,LOG_TAGLOG_TAG, "OnBoarding succeeded. Successfully connected to ssid : %s",
+    OIC_LOG_V(ERROR,LOG_TAGLOG_TAG, "OnBoarding succeeded. Successfully connected to ssid : %s",
             ssid);
     logmessage = logmessage + "OnBoarding succeeded. Successfully connected to ssid:" + ssid;
     ecore_main_loop_thread_safe_call_sync((void * (*)(void *))updateGroupLog, &logmessage);
@@ -129,12 +129,12 @@ static void init_easysetup(void *data, Evas_Object *obj, void *event_info)
  */
 void StartProvisioning(void *data, Evas_Object *obj, void *event_info)
 {
-    OC_LOG(INFO,LOG_TAG"StartProvisioning");
+    OIC_LOG(INFO,LOG_TAG"StartProvisioning");
     string logmessage = "StartProvisioning\n";
 
     if (InitProvisioning() == ES_ERROR)
     {
-        OC_LOG(ERROR,LOG_TAG,"Init Provisioning Failed");
+        OIC_LOG(ERROR,LOG_TAG,"Init Provisioning Failed");
         logmessage += "Init Provisioning Failed\n";
         return;
     }
@@ -142,7 +142,7 @@ void StartProvisioning(void *data, Evas_Object *obj, void *event_info)
     pthread_t thread_handle;
     if (pthread_create(&thread_handle, NULL, listeningFunc, NULL))
     {
-        OC_LOG(ERROR,LOG_TAG,"Thread creation failed");
+        OIC_LOG(ERROR,LOG_TAG,"Thread creation failed");
     }
     ecore_main_loop_thread_safe_call_sync((void * (*)(void *))updateGroupLog, &logmessage);
 }
@@ -158,7 +158,7 @@ void *listeningFunc(void*)
         result = OCProcess();
         if (result != OC_STACK_OK)
         {
-            OC_LOG(ERROR,LOG_TAG,"OCStack stop error");
+            OIC_LOG(ERROR,LOG_TAG,"OCStack stop error");
         }
 
         // To minimize CPU utilization we may wish to do this with sleep