Android OnBoarding code modifications to handle multiple transports
[platform/upstream/iotivity.git] / service / easy-setup / sdk / mediator / inc / provisioninghandler.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 #ifndef __PROVISIONING_HANDLER_H_
22 #define __PROVISIONING_HANDLER_H_
23
24 #include "logger.h"
25 #include "ocstack.h"
26 #include "common.h"
27
28 //-----------------------------------------------------------------------------
29 // Defines
30 //-----------------------------------------------------------------------------
31 #define TAG "provisioninghandler"
32 #define DEFAULT_CONTEXT_VALUE 0x99
33 #ifndef MAX_LENGTH_IPv4_ADDR
34 #define MAX_LENGTH_IPv4_ADDR 16
35 #endif
36
37 //-----------------------------------------------------------------------------
38 // Typedefs
39 //-----------------------------------------------------------------------------
40
41 /**
42  * List of methods that can be inititated from the client
43  */
44 OCStackResult InitProvisioningHandler();
45
46 OCStackResult TerminateProvisioningHandler();
47
48 void listeningFunc(void*);
49
50 OCStackApplicationResult ProvisionEnrolleeResponse(void* ctx, OCDoHandle handle,
51         OCClientResponse * clientResponse);
52
53 OCStackResult ProvisionEnrollee(OCQualityOfService qos, const char* query, const char* resUri);
54
55 OCStackApplicationResult GetProvisioningStatusResponse(void* ctx,
56         OCDoHandle handle, OCClientResponse * clientResponse);
57
58 OCStackResult InvokeOCDoResource(const char* query, OCMethod method,
59         OCQualityOfService qos, OCClientResponseHandler cb, const char* request,
60         OCHeaderOption * options, uint8_t numOptions);
61
62 OCStackResult GetProvisioningStatus(OCQualityOfService qos, const char* query);
63
64 OCStackResult StartProvisioningProcess(const EnrolleeNWProvInfo_t *netInfo,
65         OCProvisioningStatusCB provisioningStatusCallback);
66
67
68 void StopProvisioningProcess();
69
70 OCStackApplicationResult SubscribeProvPresenceCallback(void* ctx, OCDoHandle handle,
71         OCClientResponse* clientResponse);
72
73 OCStackResult SubscribeProvPresence(OCQualityOfService qos, const char* requestURI);
74
75 OCStackApplicationResult FindProvisioningResourceResponse(void* ctx,
76         OCDoHandle handle, OCClientResponse * clientResponse);
77
78 void FindProvisioningResource(void *data);
79
80 //Invoke Provisioning Status Callback
81 ProvisioningInfo* PrepareProvisioingStatusCB(OCClientResponse * clientResponse,
82             ProvStatus provStatus);
83
84 #endif
85