Add log message for discovered secure resource in easy setup
authorJihun Ha <jihun.ha@samsung.com>
Fri, 3 Feb 2017 03:33:54 +0000 (12:33 +0900)
committerUze Choi <uzchoi@samsung.com>
Fri, 3 Feb 2017 06:10:35 +0000 (06:10 +0000)
Once a target secure resource is discovered, some of useful information of
the found resource are provided by log messages.

Change-Id: If41390c884e5520f51fed1601d626c1eda523c01
Signed-off-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17029
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp

index 038cdbd..80ab773 100755 (executable)
@@ -530,6 +530,35 @@ namespace OIC
                     return ES_ERROR;
                 }
             }
+
+            OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "Secured resource is found.");
+            OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "HOST: %s", m_securedResource->getDevAddr().c_str());
+            OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "SID: %s", m_securedResource->getDeviceID().c_str());
+            OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Owned status: %d", m_securedResource->getOwnedStatus());
+
+            OicSecOxm_t selectedOTMethod;
+            if( OC_STACK_OK != m_securedResource->getOTMethod(&selectedOTMethod) )
+            {
+                selectedOTMethod = OIC_OXM_COUNT; // Out-of-range
+            }
+            OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Selected OT Method: %d", (int)(selectedOTMethod));
+#ifdef MULTIPLE_OWNER
+            OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "MOT Supported: %d", (int)(m_securedResource->isMOTSupported()));
+            OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "MOT Enabled: %d", (int)(m_securedResource->isMOTEnabled()));
+#endif
+            if(m_securedResource->getOwnedStatus())
+            {
+                char uuidString[UUID_STRING_SIZE];
+                if(OCConvertUuidToString(m_securedResource->getDevPtr()->doxm->owner.id, uuidString))
+                {
+                    OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Owner ID: %s", uuidString);
+                }
+                else
+                {
+                    OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "OCConvertUuidToString is failed");
+                }
+            }
+
             return ES_OK;
         }