Tizen 2.1 base
[apps/native/ug-bluetooth-efl.git] / include / bt-util.h
1 /*
2  * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Flora License, Version 1.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *   http://floralicense.org/license/
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __BT_UTIL_H__
18 #define __BT_UTIL_H__
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 #include <glib.h>
25 #include <bundle.h>
26 #include <Elementary.h>
27
28 #include "bt-type-define.h"
29
30 /* Major Device Mask */
31 #define MISCELLANEOUS_MAJOR_DEVICE_MASK (0x000000)
32 #define COMPUTER_MAJOR_DEVICE_MASK (0x000100)
33 #define PHONE_MAJOR_DEVICE_MASK (0x000200)
34 #define LAN_MAJOR_DEVICE_MASK (0x000300)
35 #define AV_MAJOR_DEVICE_MASK (0x000400)
36 #define PERIPHERAL_MAJOR_DEVICE_MASK (0x000500)
37 #define IMAGING_MAJOR_DEVICE_MASK (0x000600)
38 #define WEARABLE_MAJOR_DEVICE_MASK (0x000700)
39 #define TOY_MAJOR_DEVICE_MASK (0x000800)
40 #define UNCLASSIFIED_MAJOR_DEVICE_MASK (0x001F00)
41 #define OBJECT_TRANSFER_MAJOR_SERVICE_MASK (0x100000)
42
43 gboolean _bt_util_get_service_mask_from_uuid_list(char **uuids,
44                                               int no_of_service,
45                                       bt_service_class_t *service_mask_list);
46
47 int _bt_util_parse_file_list(const char *bundle_txt, char ***filelist,
48                              int number_of_files);
49
50 void _bt_util_set_value(const char *req, unsigned int *search_type,
51                         unsigned int *op_mode);
52
53 gboolean _bt_util_store_get_value(const char *key,
54                               bt_store_type_t store_type,
55                               unsigned int size, void *value);
56
57 void _bt_util_launch_no_event(void *data, void *obj, void *event);
58
59 void _bt_util_set_list_disabled(Evas_Object *genlist, Eina_Bool disable);
60
61 void _bt_util_set_phone_name(void);
62
63 int _bt_util_get_phone_name(char *phone_name, int size);
64
65 int _bt_util_get_timeout_string(int timeout, char *buf, int size);
66
67 int _bt_util_get_timeout_value(int index);
68
69 int _bt_util_get_timeout_index(int timeout);
70
71 gboolean _bt_util_is_battery_low(void);
72
73 gboolean _bt_util_is_flight_mode(void);
74
75 void _bt_util_addr_type_to_addr_string(char *address,
76                                                unsigned char *addr);
77
78 void _bt_util_addr_type_to_addr_result_string(char *address,
79                                                unsigned char *addr);
80
81 void _bt_util_addr_type_to_addr_net_string(char *address,
82                                                unsigned char *addr);
83
84 void _bt_util_addr_string_to_addr_type(unsigned char *addr,
85                                                   const char *address);
86
87 void _bt_util_convert_time_to_string(unsigned int remain_time,
88                                         char *buf, int size);
89
90 void _bt_util_launch_bt_service(int status, int run_type);
91
92 void _bt_util_free_device_uuids(bt_dev_t *item);
93
94 void _bt_util_free_device_item(bt_dev_t *item);
95
96 #ifdef __cplusplus
97 }
98 #endif
99 #endif                          /* __BT_UTIL_H__ */