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] peer target device to establish direct-pairing.
\r
47 * @param[in] pmSel selected pairing method.
\r
48 * @param[in] pinNumber secret value for dtls connection.
\r
49 * @param[in] resultCallback result event callback.
\r
51 * @return OC_STACK_OK on success otherwise error.
\r
53 OCStackResult DPDirectPairing(OCDirectPairingDev_t* peer, OicSecPrm_t pmSel, char *pinNumber,
\r
54 OCDirectPairingResultCB resultCallback);
\r
57 * This function returns discovered devices list in direct-pairing discovery
\r
58 * Caller must NOT free returned constant pointer
\r
60 * @return OCDirectPairingDev_t pointer on success otherwise NULL.
\r
62 const OCDirectPairingDev_t* DPGetDiscoveredDevices();
\r
65 * This function returns paired devices list until now
\r
66 * Caller must NOT free returned constant pointer
\r
68 * @return OCDirectPairingDev_t pointer on success otherwise NULL.
\r
70 const OCDirectPairingDev_t* DPGetPairedDevices();
\r
73 * This function delete both discovered devices and paired devices list
\r
76 void DPDeleteLists();
\r
81 #endif //_DIRECT_PAIRING_H_
\r