1 //******************************************************************
3 // Copyright 2015 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 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
28 #include "easysetupmgr.h"
30 //Use ipv4addr for both InitDiscovery and InitDeviceDiscovery
31 char ipv4addr[IPV4_ADDR_SIZE] = { 0 };
33 static OCProvisioningStatusCB cbData = NULL;
35 OCStackResult InitEasySetupManager() {
38 OCStackResult result = OC_STACK_ERROR;
40 if (InitProvisioningHandler() == OC_STACK_OK) {
42 OIC_LOG(DEBUG, TAG, "InitProvisioningHandler returned Success");
44 result = OC_STACK_ERROR;
45 OIC_LOG_V(ERROR, TAG, "InitProvisioningHandler returned error = %s",
52 OCStackResult TerminateEasySetupManager() {
53 return TerminateProvisioningHandler();
56 OCStackResult RegisterProvisioningStausCallback(
57 OCProvisioningStatusCB provisioningStatusCallback) {
58 OCStackResult result = OC_STACK_OK;
60 if(provisioningStatusCallback != NULL)
62 cbData = provisioningStatusCallback;
66 result = OC_STACK_ERROR;
67 OIC_LOG(ERROR, TAG, "provisioningStatusCallback is NULL");
73 void UnRegisterProvisioningStausCallback() {
79 OCStackResult ProvisionEnrollee(const EnrolleeNWProvInfo_t *netInfo)
81 return StartProvisioningProcess(netInfo, cbData);
84 OCStackResult StopEnrolleeProvisioning(OCConnectivityType connectivityType) {
85 OCStackResult result = OC_STACK_OK;
87 //TODO: Have to handle the transport specific easy setup termination
88 StopProvisioningProcess();