1 /* ****************************************************************
3 * Copyright 2016 Samsung Electronics All Rights Reserved.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 ******************************************************************/
21 #ifndef CA_MANAGER_LE_INF_H_
22 #define CA_MANAGER_LE_INF_H_
25 #include "cautilinterface.h"
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.
38 void CASetLENetworkMonitorCallbacks(CAAdapterStateChangedCB adapterStateCB,
39 CAConnectionStateChangedCB connStateCB);
42 * Set device information for auto connection.
44 CAResult_t CASetLEClientAutoConnectionDeviceInfo();
47 * Unset device information to stop auto connection.
49 CAResult_t CAUnsetLEClientAutoConnectionDeviceInfo();
51 //custom advertisement data
52 #if defined(__TIZEN__) && defined(LE_ADAPTER) && defined(BLE_CUSTOM_ADVERTISE)
53 CAResult_t CAManagerLEServerSetAdvertisementData(const char* data, int length);
54 CAResult_t CAManagerLEServerSetScanResponseData(const char* data, int length);
57 #if defined(__APPLE__) && defined(LE_ADAPTER)
59 * initialize client connection manager
61 * @return ::CA_STATUS_OK or ::CA_STATUS_FAILED or ::CA_MEMORY_ALLOC_FAILED
63 CAResult_t CAManagerLEClientInitialize();
66 * terminate client connection manager
68 * @return ::CA_STATUS_OK or ::CA_STATUS_FAILED or ::CA_MEMORY_ALLOC_FAILED
70 CAResult_t CAManagerLEClientTerminate();
75 void CAManagerLEStopScan();
80 void CAManagerLEStartScan();
83 * Disconnect from peripheral
85 void CAManagerLEDisconnect();
89 #if defined(__ANDROID__) && defined(LE_ADAPTER)
91 * initialize client connection manager
92 * @param[in] env JNI interface pointer.
93 * @param[in] jvm invocation inferface for JAVA virtual machine.
94 * @param[in] context application context.
96 * @return ::CA_STATUS_OK or ::CA_STATUS_FAILED or ::CA_MEMORY_ALLOC_FAILED
98 CAResult_t CAManagerLEClientInitialize(JNIEnv *env, JavaVM *jvm, jobject context);
101 * terminate client connection manager
102 * @param[in] env JNI interface pointer.
104 * @return ::CA_STATUS_OK or ::CA_STATUS_FAILED or ::CA_MEMORY_ALLOC_FAILED
106 CAResult_t CAManagerLEClientTerminate(JNIEnv *env);
109 * set BLE scan interval time and working count.
110 * @param[in] intervalTime interval time(Seconds).
111 * @param[in] workingCount working count for selected interval time.
113 void CAManagerLESetScanInterval(jint intervalTime, jint workingCount);
118 void CAManagerLEStopScan();
122 * start BLE advertising.
123 * @return ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
125 CAResult_t CAManagerLEStartAdvertising();
128 * stop BLE advertising.
129 * @return ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
131 CAResult_t CAManagerLEStopAdvertising();
135 * set CAUtilConfig_t configure.
136 * @param[in] config ::CAUtilConfig_t value
138 void CAManagerSetConfigure(CAUtilConfig_t config);
144 #endif /* CA_MANAGER_LE_INF_H_ */