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.
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.
*
* @param[in] uuidOfDevice information about the target device's uuid.
+ * @param[out] result true in case device UUID already exist otherwise false.
*
- * @return false when non-duplication and true when duplication or uuidOfDevicea is NULL .
+ * @return OC_STACK_OK in case of success and other value otherwise.
*/
-bool PDMIsDuplicateDevice(const OicUuid_t* uuidOfDevice);
+OCStackResult PDMIsDuplicateDevice(const OicUuid_t* uuidOfDevice, bool* result);
/**
* This method is used by provisioning manager to add owned device's Device ID.
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.
*/
void PDMDestoryStaleLinkList(OCPairList_t* ptr);
+/**
+ * This method is used by provisioning manager to check does the link exists between
+ * two devices or not.
+ *
+ * @param[in] uuidOfDevice1 UUID of device1.
+ * @param[in] uuidOfDevice2 UUID of device2.
+ * @param[out] result true when link exists otherwise false.
+ *
+ * @return OC_STACK_OK in case of success and other value otherwise.
+ */
+OCStackResult PDMIsLinkExists(const OicUuid_t* uuidOfDevice1, const OicUuid_t* uuidOfDevice2,
+ bool *result);
+
+/**
+ * This method put device and owner to otm table when start OTM
+ *
+ * @param[in] uuid - the device uuid
+ * @param[in] owner - the owner uuid
+ *
+ * @return OC_STACK_OK in case of success and other value otherwise.
+ */
+OCStackResult OTMStart(const OicUuid_t *uuid, const OicUuid_t *owner);
+
+/**
+ * This method set device state
+ *
+ * @param[in] uuid - the device uuid
+ * @param[in] state - the state
+ *
+ * @return OC_STACK_OK in case of success and other value otherwise.
+ */
+OCStackResult OTMSetState(const OicUuid_t *uuid, int state);
+
+/**
+ * This method stop OTM device
+ *
+ * @param[in] uuid - the device uuid
+ *
+ * @return OC_STACK_OK in case of success and other value otherwise.
+ */
+OCStackResult OTMStop(const OicUuid_t *uuid);
+
+/**
+ * This method get device state
+ *
+ * @param[in] uuid - the device uuid
+ * @param[out] state - the state
+ *
+ * @return OC_STACK_OK in case of success and other value otherwise.
+ */
+OCStackResult OTMGetState(const OicUuid_t *uuid, int *state);
+
#ifdef __cplusplus
}
#endif