OCProvisionResultCB resultCallback);\r
\r
/**\r
+ * This function resets SVR DB to its factory setting.\r
+ *\r
+ *@return OC_STACK_OK in case of successful reset and other value otherwise.\r
+ */\r
+OCStackResult OCResetSVRDB(void);\r
+\r
+/**\r
* API to get status of all the devices in current subnet. The status include endpoint information\r
* and doxm information which can be extracted duing owned and unowned discovery. Along with this\r
* information. The API will provide information about devices' status\r
#define _50_REMOVE_SELEC_DEV_ 50
#define _51_REMOVE_DEV_WITH_UUID_ 51
#define _52_RESET_SELEC_DEV_ 52
+#define _53_RESET_SVR_DB_ 53
#define _60_GET_CRED_ 60
#define _61_GET_ACL_ 61
#ifdef MULTIPLE_OWNER
return 0;
}
+static int resetSVRDB(void)
+{
+ printf(" Resetting SVR DB..\n");
+ OCStackResult rst = OCResetSVRDB();
+ if (OC_STACK_OK != rst)
+ {
+ OIC_LOG_V(ERROR, TAG, "OCResetSVRDB API error: %d", rst);
+ return -1;
+ }
+ return 0;
+}
+
static OicSecAcl_t* createAcl(const int dev_num)
{
if(0>=dev_num || g_own_cnt<dev_num)
printf("** [E] REMOVE THE SELECTED DEVICE\n");
printf("** 50. Remove the Selected Device\n");
printf("** 51. Remove Device with UUID (UUID input is required)\n");
- printf("** 52. Reset the Selected Device\n\n");
+ printf("** 52. Reset the Selected Device\n");
+ printf("** 53. Reset SVR DB\n\n");
printf("** [F] GET SECURITY RESOURCE FOR DEBUGGING ONLY\n");
printf("** 60. Get the Credential resources of the Selected Device\n");
OIC_LOG(ERROR, TAG, "_52_RESET_SELEC_DEV_: error");
}
break;
+ case _53_RESET_SVR_DB_:
+ if(resetSVRDB())
+ {
+ OIC_LOG(ERROR, TAG, "_53_RESET_SVR_DB_: error");
+ }
+ break;
case _60_GET_CRED_:
if(getCred())
{
#include "utlist.h"
#include "aclresource.h" //Note: SRM internal header
#include "pconfresource.h"
+#include "psinterface.h"
#define TAG "OIC_OCPMAPI"
}
/**
+ * This function resets SVR DB to its factory setting.
+ *
+ * @return OC_STACK_OK in case of successful reset and other value otherwise.
+ */
+OCStackResult OCResetSVRDB(void)
+{
+ return ResetSecureResourceInPS();
+}
+
+/**
* Internal Function to update result in link result array.
*/
static void UpdateLinkResults(Linkdata_t *link, int device, OCStackResult stackresult)