Add C++ API for UnsetInputPinCB.
authorSandeep Sharma <sandeep.s9@samsung.com>
Thu, 8 Dec 2016 07:42:38 +0000 (13:12 +0530)
committerRandeep Singh <randeep.s@samsung.com>
Fri, 9 Dec 2016 07:19:03 +0000 (07:19 +0000)
Change-Id: I0a3285d906d250a932a6cb98daff0b34ba6bff79
Signed-off-by: Sandeep Sharma <sandeep.s9@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/15257
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jongmin Choi <jminl.choi@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
(cherry picked from commit 194d25ca4d7dccbe2201d0db563a785b4f838d9c)
Reviewed-on: https://gerrit.iotivity.org/gerrit/15313

resource/include/OCProvisioningManager.hpp
resource/provisioning/src/OCProvisioningManager.cpp

index 7435e24..86ae813 100644 (file)
@@ -218,6 +218,13 @@ namespace OC
             static OCStackResult setInputPinCallback(InputPinCallback inputPin);
 
             /**
+             * API for de-registering Pin Callback.
+             *
+             * @return ::OC_STACK_OK in case of success and other value otherwise.
+             */
+            static OCStackResult unsetInputPinCallback();
+
+            /**
              * API to get status of all the devices in current subnet. The status include endpoint
              * information and doxm information which can be extracted during owned and unowned
              * discovery. Along with this information, API will provide information about
index 6ab5f6b..b5b18a2 100644 (file)
@@ -258,6 +258,26 @@ namespace OC
         return result;
     }
 
+    OCStackResult OCSecure::unsetInputPinCallback()
+    {
+        OCStackResult result;
+        auto cLock = OCPlatform_impl::Instance().csdkLock().lock();
+
+        if (cLock)
+        {
+            std::lock_guard<std::recursive_mutex> lock(*cLock);
+            UnsetInputPinCB();
+            result = OC_STACK_OK;
+        }
+        else
+        {
+            oclog() <<"Mutex not found";
+            result = OC_STACK_ERROR;
+        }
+
+        return result;
+    }
+
     OCStackResult OCSecure::getDevInfoFromNetwork(unsigned short timeout,
             DeviceList_t &ownedDevList,
             DeviceList_t &unownedDevList)