1 /* ****************************************************************
3 * Copyright 2017 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_DEVICE_H_
22 #define CA_MANAGER_DEVICE_H_
24 #include "uarraylist.h"
33 * Auto Connection Target Device Identity
37 char address[18]; /**< remote address */
38 bool isAutoConnect; /**< auto connection flag */
42 * get address from auto connection list.
43 * @param[in] idx index of auto connection data list.
46 char* CAManagerGetLEAddressFromACData(size_t idx);
49 * create auto connection list.
51 void CAManagerCreateACDataList();
55 * @return ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
57 CAResult_t CAManagerInitMutexVaraibles();
62 void CAManagerTerminateMutexVariables();
65 * check whether target address is already contained in list or not.
66 * @param[in] address ble address.
67 * @return true or false
69 bool CAManagerIsMatchedACData(const char* address);
72 * add auto connection data into list.
73 * @param[in] address ble address.
75 void CAManagerAddACData(const char* address);
78 * remove auto connection data for selected ble address.
79 * @param[in] env JNI interface pointer.
80 * @param[in] address ble address.
81 * @return ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
83 CAResult_t CAManagerRemoveData(const char* address);
86 * remove auto connection data for all devices.
87 * @return ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h).
89 CAResult_t CAManagerRemoveAllData();
92 * get current auto connection flag.
93 * @param[in] address ble address.
94 * @return true or false
96 bool CAManagerGetAutoConnectionFlag(const char* address);
99 * set auto connection flag.
100 * @param[in] address ble address.
101 * @param[in] flag auto connection flag.
103 void CAManagerSetAutoConnectionFlag(const char* address, bool flag);
106 * get length of auto connection list.
109 size_t CAManagerGetACDataLength();
112 * set BT adapter recovery flag.
113 * @param[in] flag recovery flag.
115 void CAManagerSetBTRecovery(bool flag);
118 * get BT adapter recovery flag.
119 * @return recovery flag.
121 bool CAManagerIsRecoveryFlagSet();
127 #endif /* CA_MANAGER_DEVICE_H_ */