X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fsecurity%2Fprovisioning%2Finclude%2Finternal%2Fprovisioningdatabasemanager.h;h=7e41f53c1a69fd235bb46ee5846a31ff048c007c;hb=c315c87e07c4080ecd0ef488e7a1047bc3c509b2;hp=45588b357be53d58df8b1b2db78832577393dc60;hpb=ea3b90336cac85ca8c75e6a78a60ab16dc2ffe58;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/security/provisioning/include/internal/provisioningdatabasemanager.h b/resource/csdk/security/provisioning/include/internal/provisioningdatabasemanager.h index 45588b3..7e41f53 100644 --- a/resource/csdk/security/provisioning/include/internal/provisioningdatabasemanager.h +++ b/resource/csdk/security/provisioning/include/internal/provisioningdatabasemanager.h @@ -28,6 +28,12 @@ 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,14 +45,35 @@ 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. * * @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. @@ -87,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. @@ -152,6 +188,20 @@ void PDMDestoryOicUuidLinkList(OCUuidList_t* ptr); */ 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); + + #ifdef __cplusplus } #endif