X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Feasy-setup%2Finc%2Fescommon.h;fp=service%2Feasy-setup%2Fsdk%2Fcommon%2Fescommon.h;h=6ee898ebdaeb0bf906f6df7bd99e633614f0288b;hb=089eef59664171024cd7a3d2f4d804c6689eedb0;hp=24963b56383792db2f0dbcbc712f7f9f222fd015;hpb=bff0ed253aa6bae7aa172a334c093ba59dd59e0f;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/easy-setup/sdk/common/escommon.h b/service/easy-setup/inc/escommon.h old mode 100755 new mode 100644 similarity index 64% rename from service/easy-setup/sdk/common/escommon.h rename to service/easy-setup/inc/escommon.h index 24963b5..6ee898e --- a/service/easy-setup/sdk/common/escommon.h +++ b/service/easy-setup/inc/escommon.h @@ -21,6 +21,7 @@ #ifndef ES_COMMON_H_ #define ES_COMMON_H_ +#include #include #ifndef WITH_ARDUINO #include @@ -29,6 +30,8 @@ #include "ocstack.h" #include "octypes.h" +using namespace std; + // Defines #define OIC_STRING_MAX_VALUE 100 #define IPV4_ADDR_SIZE 16 @@ -228,128 +231,4 @@ typedef struct */ typedef void (*OCProvisioningStatusCB)(EasySetupInfo *easySetupInfo); -#ifndef WITH_ARDUINO - -namespace OIC -{ - namespace Service - { - typedef enum - { - ES_PROVISIONING_ERROR = -1, - ES_NEED_PROVISIONING, - ES_PROVISIONED_ALREADY, - ES_PROVISIONING_SUCCESS - } ESState; - - typedef enum - { - ES_UNKNOWN = 0, - ES_ONBOARDED, - ES_OWNED, - ES_PROVISIONED - } CurrentESState; - - typedef enum - { - ES_SEC_UNKNOWN = 0, - ES_SEC_OWNED, - ES_SEC_ACL_PROVISIONED, - ES_SEC_CREDS_PROVISIONED - } EnrolleeSecState; - - /** - * Security Provisioning Status - */ - class SecProvisioningResult - { - public: - std::shared_ptr< SecProvisioningResult > shared_ptr; - SecProvisioningResult(std::string deviceUUID, ESResult result) : - m_devUUID(deviceUUID), m_result(result) - { - - } - - std::string getDeviceUUID() - { - return m_devUUID; - } - - ESResult getResult() - { - return m_result; - } - private: - std::string m_devUUID; - ESResult m_result; - }; - - /** - * Callback function definition for providing Enrollee security status . - */ - typedef std::function< void(std::shared_ptr) > EnrolleeSecStatusCb; - - /** - * Callback definition to be invoked when the security stack expects a pin from application. - */ - typedef std::function< void(std::string&) > SecurityPinCb; - - /** - * Callback definition to be invoked when the stack expects a db path. - */ - typedef std::function< void(std::string&) > SecProvisioningDbPathCb; - - class ProvisioningStatus - { - public: - std::shared_ptr< ProvisioningStatus > shared_ptr; - ProvisioningStatus(ESResult result, ESState esState) : - m_result(result), m_esState(esState) - { - - } - - ESResult& getESResult() - { - return m_result; - } - - ESState& getESState() - { - return m_esState; - } - private: - ESResult m_result; - ESState m_esState; - }; - - class EasySetupStatus - { - public: - std::shared_ptr< EasySetupStatus > shared_ptr; - EasySetupStatus(const EasySetupState& easySetupState, - const EnrolleeNWProvInfo& enrolleeNWProvInfo) : - m_easySetupState(easySetupState), m_enrolleeNWProvInfo(enrolleeNWProvInfo) - { - - } - - EnrolleeNWProvInfo& getEasySetupNWProvInfo() - { - return m_enrolleeNWProvInfo; - } - - EasySetupState& getEasySetupState() - { - return m_easySetupState; - } - private: - EasySetupState m_easySetupState; - EnrolleeNWProvInfo m_enrolleeNWProvInfo; - }; - } -} -#endif //WITH_ARDUINO - #endif //ES_COMMON_H_