Imported Upstream version 1.1.0
[platform/upstream/iotivity.git] / resource / csdk / connectivity / util / inc / cabtpairinginterface.h
1 /* ****************************************************************
2  *
3  * Copyright 2016 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 CA_BT_PAIRING_INTERFACE_H_
22 #define CA_BT_PAIRING_INTERFACE_H_
23
24 #include "cacommon.h"
25 #include "cautilinterface.h"
26
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31
32 #ifdef __ANDROID__
33 #ifdef EDR_ADAPTER
34 /**
35  * initialize BT Pairing manager
36  * @param[in]   env                   JNI interface pointer.
37  * @param[in]   jvm                   invocation inferface for JAVA virtual machine.
38  * @param[in]   context               application context.
39  *
40  * @return  CA_STATUS_OK or ERROR CODES (CAResult_t error codes in cacommon.h).
41  */
42 CAResult_t CABTPairingInitialize(JNIEnv *env, JavaVM *jvm, jobject context);
43
44 /**
45  * start discovery for BT device which has iotivity UUID.
46  * @param[in]  env              JNI interface pointer.
47  *
48  * @return  CA_STATUS_OK or ERROR CODES (CAResult_t error codes in cacommon.h).
49  */
50 CAResult_t CABTPairingStartScan(JNIEnv *env);
51
52 /**
53  * stop discovery
54  * @param[in]  env              JNI interface pointer.
55  *
56  * @return  CA_STATUS_OK or ERROR CODES (CAResult_t error codes in cacommon.h).
57  */
58 CAResult_t CABTPairingStopScan(JNIEnv *env);
59
60 /**
61  * bonding between devices.
62  * @param[in]  env              JNI interface pointer.
63  * @param[in]  device           bluetooth device object.
64  *
65  * @return  CA_STATUS_OK or ERROR CODES (CAResult_t error codes in cacommon.h).
66  */
67 CAResult_t CABTPairingCreateBond(JNIEnv *env, jobject device);
68
69 /**
70  * set callback listener of found device.
71  * @param[in]  listener         callback listener
72  */
73 void CABTPairingSetFoundDeviceListener(jobject listener);
74 #endif
75 #endif
76
77 #ifdef __cplusplus
78 } /* extern "C" */
79 #endif
80
81 #endif /* CA_LE_MANAGER_H_ */
82