replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / security / provisioning / include / internal / provisioningdatabasemanager.h
index 6a31a91..7e41f53 100644 (file)
 extern "C" {
 #endif
 
+typedef enum PdmDeviceState {
+    PDM_DEVICE_ACTIVE = 0,
+    PDM_DEVICE_STALE = 1,
+    PDM_DEVICE_INIT = 2,
+    PDM_DEVICE_UNKNOWN = 99
+}PdmDeviceState_t;
 
 /**
  * This method is used by provisioning manager to open provisioning database.
@@ -39,6 +45,26 @@ extern "C" {
 OCStackResult PDMInit(const char* dbPath);
 
 /**
+ * This method is used by provisioning manager to check device status.
+ *
+ * @param[in] uuid information about the target device's uuid.
+ * @param[out] result device status.
+ *
+ * @return OC_STACK_OK in case of success and other value otherwise.
+ */
+OCStackResult PDMGetDeviceState(const OicUuid_t* uuid, PdmDeviceState_t* result);
+
+/**
+ * This method is used by provisioning manager to update device status.
+ *
+ * @param[in] uuid id of device.
+ * @param[in] state device state. (ref. PdmDeviceState_t)
+ *
+ * @return OC_STACK_OK in case of success and other value otherwise.
+ */
+OCStackResult PDMSetDeviceState(const OicUuid_t* uuid, PdmDeviceState_t state);
+
+/**
  * This method is used by provisioning manager to check duplication of device's Device ID with
  * provisioning database.
  *
@@ -88,6 +114,15 @@ OCStackResult PDMUnlinkDevices(const OicUuid_t *uuidOfDevice1, const OicUuid_t *
 OCStackResult PDMDeleteDevice(const OicUuid_t *uuidOfDevice);
 
 /**
+ * This method is used by OTM & PDM to remove device information with device state.
+ *
+ * @param[in] state device state to be removed.
+ *
+ * @return OC_STACK_OK in case of success and other value otherwise.
+ */
+OCStackResult PDMDeleteDeviceWithState(const PdmDeviceState_t state);
+
+/**
  * This method is used by provisioning manager to get owned devices' Device IDs.
  *
  * @param[out] uuidList information about the list of owned devices' uuids.
@@ -164,7 +199,8 @@ void PDMDestoryStaleLinkList(OCPairList_t* ptr);
  * @return OC_STACK_OK in case of success and other value otherwise.
  */
 OCStackResult PDMIsLinkExists(const OicUuid_t* uuidOfDevice1, const OicUuid_t* uuidOfDevice2,
-                                bool *result );
+                                bool *result);
+
 
 #ifdef __cplusplus
 }