replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / connectivity / util / src / camanager / bt_le_manager / ios / camanagerleutil.h
1 /* ****************************************************************
2  *
3  * Copyright 2017 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_UTILS_H_
22 #define CA_MANAGER_LE_UTILS_H_
23
24 #import <Foundation/Foundation.h>
25 #import <CoreBluetooth/CoreBluetooth.h>
26
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31
32 typedef enum {
33     CM_CONTAINS = 1,
34     CM_ADD,
35     CM_REMOVE
36 } CASetMethod_t;
37
38 /**
39  * check whether the device is already put or not.
40  * @param[in]   address               LE address.
41  * @return  true or false
42  */
43 bool CAManagerIsConnectedDeviceAddress(const char* address);
44
45 /**
46  * add connected device into SharedPreference.
47  * @param[in]   address               ble address.
48  * @return  CBPeripheral object or nil
49  */
50 CBPeripheral* CAManagerGetValueConnectedDeviceAddress(const char* address);
51
52 /**
53  * add connected device into SharedPreference.
54  * @param[in]   peripheral            peripheral object.
55  * @param[in]   address               ble address.
56  * @return  true or false
57  */
58 bool CAManagerSetValueConnectedDeviceAddress(CBPeripheral *peripheral, const char* address);
59
60 /**
61  * add connected device into SharedPreference.
62  * @param[in]   address               ble address.
63  * @return  true or false
64  */
65 bool CAManagerAddConnectedDeviceAddress(const char* address);
66
67 /**
68  * get connected device from SharedPreference.
69  * @return  true or false
70  */
71 bool CAManagerGetConnectedDeviceAddress();
72
73 /**
74  * remove connected device to SharedPreference.
75  * @param[in]   address               LE address.
76  * @return  true or false
77  */
78 bool CAManagerRemoveConnectedDeviceAddress(const char* address);
79
80 /**
81  * Vaildate a String bluetooth address.
82  * @param[in]   address               LE address.
83  * @return  true or false
84  */
85 bool CAManagerCheckBTAddress(const char *address);
86
87 /**
88  * create new set<String> object.
89  * @return  true or false
90  */
91 bool CAManagerCreateSetString();
92
93 /**
94  * terminate new set<String> object.
95  * @return  CA_STATUS_OK or CA_STATUS_FAILED
96  */
97 CAResult_t CAManagerTerminateSetString();
98
99 #ifdef __cplusplus
100 } /* extern "C" */
101 #endif
102
103 #endif /* CA_MANAGER_LE_UTILS_H_ */