1 /* *****************************************************************
\r
3 * Copyright 2016 Samsung Electronics All Rights Reserved.
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
19 * *****************************************************************/
\r
21 #ifndef _DIRECT_PAIRING_H_
\r
22 #define _DIRECT_PAIRING_H_
\r
24 #include <stdbool.h>
\r
25 #include "ocstack.h"
\r
26 #include "pmtypes.h"
\r
27 #include "securevirtualresourcetypes.h"
\r
35 * Discover direct-pairing devices in the same IP subnet. .
\r
37 * @param[in] waittime Timeout in seconds.
\r
39 * @return OC_STACK_OK on success otherwise error.
\r
41 OCStackResult DPDeviceDiscovery(unsigned short waittime);
\r
44 * Start direct-pairing processes.
\r
46 * @param[in] ctx user context passed back with resultCallback.
\r
47 * @param[in] peer target device to establish direct-pairing.
\r
48 * @param[in] pmSel selected pairing method.
\r
49 * @param[in] pinNumber secret value for dtls connection.
\r
50 * @param[in] resultCallback result event callback.
\r
52 * @return OC_STACK_OK on success otherwise error.
\r
54 OCStackResult DPDirectPairing(void *ctx, OCDirectPairingDev_t* peer, OicSecPrm_t pmSel,
\r
55 char *pinNumber, OCDirectPairingResultCB resultCallback);
\r
58 * This function returns discovered devices list in direct-pairing discovery
\r
59 * Caller must NOT free returned constant pointer
\r
61 * @return OCDirectPairingDev_t pointer on success otherwise NULL.
\r
63 const OCDirectPairingDev_t* DPGetDiscoveredDevices();
\r
66 * This function returns paired devices list until now
\r
67 * Caller must NOT free returned constant pointer
\r
69 * @return OCDirectPairingDev_t pointer on success otherwise NULL.
\r
71 const OCDirectPairingDev_t* DPGetPairedDevices();
\r
74 * This function delete both discovered devices and paired devices list
\r
77 void DPDeleteLists();
\r
82 #endif //_DIRECT_PAIRING_H_
\r