Merge "Merge branch 'master' into cloud-interface" into cloud-interface
[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 /**
52  * Start advertise to receive request for scanning or connecting.
53  */
54 void CAStartServerLEAdvertising();
55
56 /**
57  * Stop advertise to destroy advertiser.
58  */
59 void CAStopServerLEAdvertising();
60
61 #ifdef __ANDROID__
62 #ifdef LE_ADAPTER
63 /**
64  * initialize client connection manager
65  * @param[in]   env                   JNI interface pointer.
66  * @param[in]   jvm                   invocation inferface for JAVA virtual machine.
67  * @param[in]   context               application context.
68  *
69  * @return  ::CA_STATUS_OK or ::CA_STATUS_FAILED or ::CA_MEMORY_ALLOC_FAILED
70  */
71 CAResult_t CAManagerLEClientInitialize(JNIEnv *env, JavaVM *jvm, jobject context);
72
73 /**
74  * terminate client connection manager
75  * @param[in]   env                   JNI interface pointer.
76  *
77  * @return  ::CA_STATUS_OK or ::CA_STATUS_FAILED or ::CA_MEMORY_ALLOC_FAILED
78  */
79 CAResult_t CAManagerLEClientTerminate(JNIEnv *env);
80 #endif
81 #endif
82
83 #ifdef __cplusplus
84 } /* extern "C" */
85 #endif
86
87 #endif /* CA_MANAGER_LE_INF_H_ */
88