1 //******************************************************************
3 // Copyright 2016 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
38 ES_PROVISIONING_ERROR = -1,
40 ES_PROVISIONED_ALREADY,
41 ES_PROVISIONING_SUCCESS
56 ES_SEC_ACL_PROVISIONED,
57 ES_SEC_CREDS_PROVISIONED
61 * Security Provisioning Status
63 class SecProvisioningResult
66 std::shared_ptr< SecProvisioningResult > shared_ptr;
67 SecProvisioningResult(std::string deviceUUID, ESResult result) :
68 m_devUUID(deviceUUID), m_result(result)
73 std::string getDeviceUUID()
83 std::string m_devUUID;
88 * Callback function definition for providing Enrollee security status .
90 typedef std::function< void(std::shared_ptr<SecProvisioningResult>) > EnrolleeSecStatusCb;
93 * Callback definition to be invoked when the security stack expects a pin from application.
95 typedef std::function< void(std::string&) > SecurityPinCb;
98 * Callback definition to be invoked when the stack expects a db path.
100 typedef std::function< void(std::string&) > SecProvisioningDbPathCb;
102 class ProvisioningStatus
105 std::shared_ptr< ProvisioningStatus > shared_ptr;
106 ProvisioningStatus(ESResult result, ESState esState) :
107 m_result(result), m_esState(esState)
112 ESResult& getESResult()
117 ESState& getESState()
126 class EasySetupStatus
129 std::shared_ptr< EasySetupStatus > shared_ptr;
130 EasySetupStatus(const EasySetupState& easySetupState,
131 const EnrolleeNWProvInfo& enrolleeNWProvInfo) :
132 m_easySetupState(easySetupState), m_enrolleeNWProvInfo(enrolleeNWProvInfo)
137 EnrolleeNWProvInfo& getEasySetupNWProvInfo()
139 return m_enrolleeNWProvInfo;
142 EasySetupState& getEasySetupState()
144 return m_easySetupState;
147 EasySetupState m_easySetupState;
148 EnrolleeNWProvInfo m_enrolleeNWProvInfo;
152 #endif //WITH_ARDUINO