Imported Upstream version 1.1.1
[platform/upstream/iotivity.git] / resource / csdk / connectivity / util / inc / camanagerleinterface.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_MANAGER_LE_INF_H_
22 #define CA_MANAGER_LE_INF_H_
23
24 #include "cacommon.h"
25 #include "cautilinterface.h"
26
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31
32 /**
33  * Register network monitor callbacks.
34  * Adapter state changes and network state changes are delivered these callbacks.
35  * @param[in]   adapterStateCB  Adapter state changed callback.
36  * @param[in]   connStateCB     Connection state changed callback.
37  */
38 void CASetLENetworkMonitorCallbacks(CAAdapterStateChangedCB adapterStateCB,
39                                     CAConnectionStateChangedCB connStateCB);
40
41 /**
42  * Set device information for auto connection.
43  */
44 CAResult_t CASetLEClientAutoConnectionDeviceInfo();
45
46 /**
47  * Unset device information to stop auto connection.
48  */
49 CAResult_t CAUnsetLEClientAutoConnectionDeviceInfo();
50
51 #if defined(__ANDROID__) && defined(LE_ADAPTER)
52 /**
53  * initialize client connection manager
54  * @param[in]   env                   JNI interface pointer.
55  * @param[in]   jvm                   invocation inferface for JAVA virtual machine.
56  * @param[in]   context               application context.
57  *
58  * @return  ::CA_STATUS_OK or ::CA_STATUS_FAILED or ::CA_MEMORY_ALLOC_FAILED
59  */
60 CAResult_t CAManagerLEClientInitialize(JNIEnv *env, JavaVM *jvm, jobject context);
61
62 /**
63  * terminate client connection manager
64  * @param[in]   env                   JNI interface pointer.
65  *
66  * @return  ::CA_STATUS_OK or ::CA_STATUS_FAILED or ::CA_MEMORY_ALLOC_FAILED
67  */
68 CAResult_t CAManagerLEClientTerminate(JNIEnv *env);
69 #endif
70
71 #ifdef __cplusplus
72 } /* extern "C" */
73 #endif
74
75 #endif /* CA_MANAGER_LE_INF_H_ */
76