7de994f323af48c3ee48bc9ab7ab5091029cc17b
[platform/upstream/iotivity.git] / service / easy-setup / enrollee / inc / easysetup.h
1 //******************************************************************
2 //
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
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
10 //
11 //      http://www.apache.org/licenses/LICENSE-2.0
12 //
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.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 /**
22  * @file
23  *
24  * This file contains SDK APIs for device operating in Enrollee Mode of EasySetup
25  */
26
27 #ifndef EASYSETUP_ENROLLEE_H__
28 #define EASYSETUP_ENROLLEE_H__
29
30 #include "escommon.h"
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif // __cplusplus
35
36 /*
37  * Callback function for updating the Enrollee OnBoarding and Provisioning status result to the application
38  *
39  * @param esResult ESResult provides the current state of the Enrollee Device
40  */
41 typedef void (*EventCallback)(ESResult esResult, EnrolleeState enrolleeState);
42
43 /**
44  * This function Initializes the EasySetup. This API must be called prior to invoking any other API
45  *
46  * @param networkType       NetworkType on which OnBoarding has to be performed.
47  * @param ssid              SSID of the target SoftAP network to which the Enrollee is connecting.
48  * @param passwd            Password of the target SoftAP network to which the Enrollee is connecting
49  * @param isSecured         True if the Enrollee is operating in secured mode.
50  * @param eventCallback     EventCallback for for updating the Enrollee OnBoarding status result to
51  *                          the application
52  * @return ::ES_OK on success, some other value upon failure.
53  */
54 ESResult InitEasySetup(OCConnectivityType networkType, const char *ssid, const char *passwd,
55         bool isSecured,
56         EventCallback eventCallback);
57
58 /**
59  * This function performs initialization of Provisioning and Network resources needed for EasySetup
60  * process.
61  * @return ::ES_OK on success, some other value upon failure.
62  */
63 ESResult InitProvisioning();
64
65 /**
66  * This function performs termination of Provisioning and Network resources.
67  * Also terminates the IoTivity core stack.
68  *
69  * @return ::ES_OK on success, some other value upon failure.
70  */
71 ESResult TerminateEasySetup();
72
73 #ifdef __cplusplus
74 }
75 #endif // __cplusplus
76
77
78 #endif /* EASYSETUP_ENROLLEE_H__ */
79