[Model] LUX
[BinType] AP
[Customer] LUX
[Issue#] TTES-534
[Request] N/A
[Occurrence Version] 1.2.1-61
[Problem] resetting svr db only in c api
[Cause & Measure] added version in c++ api; this will
synchronize resetting svrdb with the rest of OCPlatform
methods using csdkLock mutex
[Checking Method] build & test on device
[Team] IoT Connectivity
[Developer] m.mank
[Solution company] Samsung
[Change Type] new feature
https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/673
(cherry-picked from
7a46617818b08af0b75a61893465b007134f4098)
Change-Id: If8ae77355ab268478ec7dfed08ce6a8e0468f331
Signed-off-by: Michal Mank <m.mank@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
*/
static OCStackResult configSelfOwnership();
+ /**
+ * This function resets SVR DB.
+ *
+ *@return OC_STACK_OK in case of successful configue and other value otherwise.
+ */
+ static OCStackResult resetSVRDB();
+
};
/**
return result;
}
+ OCStackResult OCSecure::resetSVRDB()
+ {
+ OCStackResult result;
+ auto cLock = OCPlatform_impl::Instance().csdkLock().lock();
+
+ if (cLock)
+ {
+ std::lock_guard<std::recursive_mutex> lock(*cLock);
+ result = OCResetSVRDB();
+ }
+ else
+ {
+ oclog() << "Mutex not found";
+ result = OC_STACK_ERROR;
+ }
+ return result;
+ }
+
#if defined(__WITH_DTLS__) || defined(__WITH_TLS__)
OCStackResult OCSecure::saveTrustCertChain(uint8_t *trustCertChain, size_t chainSize,
OicEncodingType_t encodingType, uint16_t *credId)