1 /* *****************************************************************
3 * Copyright 2015 Samsung Electronics All Rights Reserved.
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 * *****************************************************************/
21 #ifndef OC_PROVISIONING_TYPES_H
22 #define OC_PROVISIONING_TYPES_H
25 #include "securevirtualresourcetypes.h"
32 * Node to construct list of UUID pair list.
34 typedef struct OCPairList OCPairList_t;
43 * Node to construct UUID linked list.
45 typedef struct OCUuidList OCUuidList_t;
53 * Device's power on/off state.
56 DEV_STATUS_ON = (1 << 0),
57 DEV_STATUS_OFF = (1 << 1)
61 * Device Information of discoverd unowned/owned device(s) for provisioning.
63 typedef struct OCProvisionDev
65 OCDevAddr endpoint; /**< target address **/
66 OicSecPstat_t *pstat; /**< Pointer to target's pstat resource. **/
67 OicSecDoxm_t *doxm; /**< Pointer to target's doxm resource. **/
68 OCConnectivityType connType; /**< Connectivity type of endpoint */
69 uint16_t securePort; /**< secure port **/
71 uint16_t tcpPort; /**< tcp port **/
73 char secVer[MAX_VERSION_LEN]; /**< security version **/
74 DeviceStatus devStatus; /**< status of device **/
76 struct OCProvisionDev *next; /**< Next pointer. **/
80 * Device Information of discoverd direct pairing device(s).
82 typedef struct OCDirectPairingDev
85 OCConnectivityType connType;
92 struct OCDirectPairingDev *next;
93 } OCDirectPairingDev_t;
96 * Result information for each target device.
98 typedef struct OCPMResult{
101 }OCProvisionResult_t;
104 * Callback function definition of provisioning API
106 * @param[OUT] ctx - If user set his/her context, it will be returned here.
107 * @param[OUT] nOfRes - total number of results, it depends on using which provisioning API.
108 * @param[OUT] arr - Array of OCPMResult_t, each OCPMResult_t contains result for target Device.
109 * @param[OUT} hasError - If there is no error, it's returned with 'false' but if there is a single
110 * or more error is/are occured during operation, it will be 'true'.
112 typedef void (*OCProvisionResultCB)(void* ctx, int nOfRes, OCProvisionResult_t *arr, bool hasError);
116 * Callback function definition of direct-pairing
118 * @param[OUT] ctx - User context which will be returned wth callback
119 * @param[OUT] peer - pairing device info.
120 * @param[OUT} result - It's returned with 'OC_STACK_XXX'. It will return 'OC_STACK_OK'
121 * if D2D pairing is success without error
123 typedef void (*OCDirectPairingResultCB)(void *ctx, OCDirectPairingDev_t *peer, OCStackResult result);
130 #endif //OC_PROVISIONING_TYPES_H