Remove wrong dependency in the systemd service file
[platform/core/connectivity/bluetooth-frwk.git] / include / plugin.h
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * 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
18 #ifndef __BLUETOOTH_PLUGIN_H
19 #define __BLUETOOTH_PLUGIN_H
20
21 #include <stdbool.h>
22 #include <dlog.h>
23
24
25 #undef LOG_TAG
26 #define LOG_TAG "BLUETOOTH_FRWK_PLUGIN"
27
28 #define LOG_COLOR_RESET    "\033[0m"
29 #define LOG_COLOR_RED      "\033[31m"
30 #define LOG_COLOR_YELLOW   "\033[33m"
31 #define LOG_COLOR_GREEN         "\033[32m"
32 #define LOG_COLOR_BLUE          "\033[36m"
33 #define LOG_COLOR_PURPLE   "\033[35m"
34
35 #define BT_DBG(fmt, args...) \
36         ((SLOGD(fmt, ##args)))
37 #define BT_INFO(fmt, args...) \
38         ((SLOGI(fmt, ##args)))
39 #define BT_ERR(fmt, args...) \
40         ((SLOGE(fmt, ##args)))
41
42 #define BT_INFO_C(fmt, arg...) \
43         SLOGI_IF(TRUE,  LOG_COLOR_GREEN" "fmt" "LOG_COLOR_RESET, ##arg)
44 #define BT_ERR_C(fmt, arg...) \
45         SLOGI_IF(TRUE,  LOG_COLOR_RED" "fmt" "LOG_COLOR_RESET, ##arg)
46
47 #define ret_if(expr) \
48         do { \
49                 if (expr) { \
50                         BT_ERR("(%s) return", #expr); \
51                         return; \
52                 } \
53         } while (0)
54
55 #define retv_if(expr, val) \
56         do { \
57                 if (expr) { \
58                         BT_ERR("(%s) return", #expr); \
59                         return (val); \
60                 } \
61         } while (0)
62
63 typedef enum {
64         BT_AGENT_EVENT_PIN_REQUEST,
65         BT_AGENT_EVENT_PASSKEY_CONFIRM_REQUEST,
66         BT_AGENT_EVENT_PASSKEY_AUTO_ACCEPTED,
67         BT_AGENT_EVENT_PASSKEY_REQUEST,
68         BT_AGENT_EVENT_PASSKEY_DISPLAY_REQUEST,
69         BT_AGENT_EVENT_AUTHORIZE_REQUEST,
70         BT_AGENT_EVENT_CONFIRM_MODE_REQUEST,
71         BT_AGENT_EVENT_APP_CONFIRM_REQUEST,
72         BT_AGENT_EVENT_FILE_RECEIVED,
73         BT_AGENT_EVENT_KEYBOARD_PASSKEY_REQUEST,
74         BT_AGENT_EVENT_SECURITY,
75         BT_AGENT_EVENT_TERMINATE,
76         BT_AGENT_EVENT_EXCHANGE_REQUEST,
77         BT_AGENT_EVENT_PBAP_REQUEST,
78         BT_AGENT_EVENT_MAP_REQUEST,
79         BT_AGENT_EVENT_SYSTEM_RESET_REQUEST,
80         BT_AGENT_EVENT_LEGACY_PAIR_FAILED_FROM_REMOTE,
81 } bt_agent_event_type_t;
82
83 struct bluetooth_headed_plugin_t {
84         int (*bt_launch_dpmpopup)(char *mode);
85         int (*bt_launch_system_popup)(bt_agent_event_type_t event_type,
86                                                         const char *device_name,
87                                                         const unsigned char *auth_info,
88                                                         char *passkey,
89                                                         const char *filename,
90                                                         const char *agent_path);
91
92         void (*bt_destroy_popup_all)(void);
93         bool (*bt_launch_unable_to_pairing_syspopup)(int result);
94         bool (*bt_is_tethering_enabled)(void);
95         int (*bt_get_mime_type)(char *file_name, char **mime_type);
96 };
97
98 #ifdef TIZEN_FEATURE_BT_DPM
99 #define BT_DPM_SYSPOPUP "dpm-syspopup"
100 #endif
101
102
103
104 #endif /* __BLUETOOTH_PLUGIN_H */