Apply tizen 3.0 based product patchsets
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / include / bt-service-common.h
index 95e2a68..b0c2c8a 100644 (file)
@@ -25,6 +25,8 @@
 #include <gio/gio.h>
 
 #include "bluetooth-api.h"
+#include "bt-internal-types.h"
+#include "bt-service-agent.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -49,21 +51,12 @@ extern "C" {
 #define LOG_COLOR_PURPLE   "\033[35m"
 
 
-#ifndef TIZEN_TV
 #define BT_DBG(fmt, args...) \
-        SLOGD(fmt, ##args)
+       ((TIZEN_PROFILE_TV) ? (LOGI(fmt, ##args)) : (SLOGD(fmt, ##args)))
 #define BT_INFO(fmt, args...) \
-        SLOGI(fmt, ##args)
+       ((TIZEN_PROFILE_TV) ? (LOGI(fmt, ##args)) : (SLOGI(fmt, ##args)))
 #define BT_ERR(fmt, args...) \
-        SLOGE(fmt, ##args)
-#else
-#define BT_DBG(fmt, args...) \
-        LOGI(fmt, ##args)
-#define BT_INFO(fmt, args...) \
-        LOGI(fmt, ##args)
-#define BT_ERR(fmt, args...) \
-        LOGE(fmt, ##args)
-#endif
+       ((TIZEN_PROFILE_TV) ? (LOGE(fmt, ##args)) : (SLOGE(fmt, ##args)))
 
 #define BT_INFO_C(fmt, arg...) \
        SLOGI_IF(TRUE,  LOG_COLOR_GREEN" "fmt" "LOG_COLOR_RESET, ##arg)
@@ -108,11 +101,7 @@ extern "C" {
 #define BT_AGENT_NEW_LINE "\r\n"
 
 #define BT_MAX_DBUS_TIMEOUT 45000
-#ifndef TIZEN_TV
-#define BT_ENABLE_TIMEOUT 20000 /* 20 seconds */
-#else
-#define BT_ENABLE_TIMEOUT 5000 /* 5 seconds */
-#endif
+#define BT_ENABLE_TIMEOUT ((TIZEN_PROFILE_TV) ? 5000 : 20000) /* 5(TV),20(others) seconds */
 #define BT_DISCOVERY_FINISHED_DELAY 200
 
 #define BT_SESSION_BUS_GET_TIMEOUT 200 /* 200 ms */
@@ -138,6 +127,7 @@ extern "C" {
 
 #define BT_BLUEZ_NAME "org.bluez"
 
+#define BT_IPSP_NAME "org.projectx.bt_ipsp"
 #define BT_BLUEZ_PATH "/org/bluez"
 #define BT_BLUEZ_HCI_PATH "/org/bluez/hci0"
 #define BT_AGENT_NAME "org.bluez.frwk_agent"
@@ -149,6 +139,7 @@ extern "C" {
 
 #define BT_MANAGER_INTERFACE "org.freedesktop.DBus.ObjectManager"
 #define BT_ADAPTER_INTERFACE "org.bluez.Adapter1"
+#define BT_IPSP_INTERFACE "org.projectx.bt_ipsp"
 #define BT_AGENT_INTERFACE "org.bluez.Agent1"
 #define BT_AGENT_MANAGER_INTERFACE "org.bluez.AgentManager1"
 #define BT_DEVICE_INTERFACE "org.bluez.Device1"
@@ -175,15 +166,17 @@ extern "C" {
 #define BT_OBEXD_MANAGER_INTERFACE "org.openobex.Manager"
 #define BT_OBEXD_TRANSFER_INTERFACE "org.openobex.Transfer"
 #define BT_A2DP_SOURCE_INTERFACE "org.bluez.AudioSource"
+#define BT_PROXIMITY_MONITOR_INTERFACE "org.bluez.ProximityMonitor1"
+#define BT_PROXIMITY_REPORTER_INTERFACE "org.bluez.ProximityReporter1"
+#define BT_TDS_PROVIDER_INTERFACE "org.bluez.TdsServiceProvider1"
 
 #define BT_PROPERTIES_INTERFACE "org.freedesktop.DBus.Properties"
 
-
 #define BT_OBEX_SERVICE_NAME "org.bluez.obex"
 #define BT_OBEX_CLIENT_PATH "/org/bluez/obex"
 #define BT_OBEX_CLIENT_INTERFACE "org.bluez.obex.Client1"
 
-
+#define BT_OBEX_MESSAGE_INTERFACE "org.bluez.obex.MessageAccess1"
 
 #define BT_OBEX_TRANSFER_INTERFACE "org.bluez.obex.Transfer1"
 #define BT_OBEX_AGENT_INTERFACE "org.bluez.obex.Agent1"
@@ -212,6 +205,9 @@ extern "C" {
 #define BT_NAME_OWNER_CHANGED "NameOwnerChanged"
 #define BT_PROPERTIES_CHANGED "PropertiesChanged"
 
+#define BT_HID_SERVICE_NAME "org.bluez.hid_agent"
+#define BT_HID_AGENT_OBJECT_PATH "/org/bluez/hid_agent"
+#define BT_HID_SERVICE_INTERFACE "org.tizen.HidApp"
 
 
 #define BT_SESSION_BASEPATH_SERVER "/org/bluez/obex/server"
@@ -243,6 +239,7 @@ extern "C" {
 #define PBAP_UUID               "0000112f-0000-1000-8000-00805f9b34fb"
 
 #define OBEX_OPP_UUID                  "00001105-0000-1000-8000-00805f9b34fb"
+#define OBEX_MAP_UUID                  "00001134-0000-1000-8000-00805f9b34fb"
 #define OBEX_PSE_UUID                  "0000112f-0000-1000-8000-00805f9b34fb"
 
 #define GATT_UUID                              "00001801-0000-1000-8000-00805f9b34fb"
@@ -264,6 +261,10 @@ extern "C" {
 #define BT_LE_ADV_NONCONN_IND  0x03
 #define BT_LE_ADV_SCAN_RSP             0x04
 
+#define HEADED_PLUGIN_FILEPATH "/usr/lib/bt-plugin-headed.so"
+#define HEADED_PLUGIN_FILEPATH64 "/usr/lib64/bt-plugin-headed.so"
+#define FILEPATH_ARCH_64 "/usr/lib64"
+
 /* Profile states matched to btd_service_state_t of bluez service.h */
 typedef enum {
        BT_PROFILE_STATE_UNAVAILABLE,
@@ -278,6 +279,7 @@ typedef enum {
        BT_SCAN_RSP_INFO = 0x01,
 } bt_le_device_info_type_t;
 
+/* Profile type matched to bluetooth_service_type_t of bluetooth-api.h */
 typedef enum {
        BT_PROFILE_CONN_RFCOMM = 0x01,
        BT_PROFILE_CONN_A2DP = 0x02,
@@ -303,19 +305,6 @@ typedef struct {
 } bt_remote_le_dev_info_t;
 
 typedef struct {
-       char *address;
-       int addr_type;
-       int rssi;
-       int adv_type;
-       int company_id;
-       int ibeacon_type;
-       int major_id;
-       int minor_id;
-       int measured_power;
-       char *uuid;
-} bt_remote_ibeacon_dev_info_t;
-
-typedef struct {
        int rssi;
        int class;
        char *address;
@@ -349,6 +338,28 @@ typedef struct {
        char *address;
 } bt_function_data_t;
 
+struct bluetooth_headed_plugin_t {
+       int (*bt_launch_dpmpopup) (char *mode);
+       int (*bt_launch_system_popup)(bt_agent_event_type_t event_type,
+                                                       const char *device_name,
+                                                       const unsigned char *auth_info,
+                                                       char *passkey,
+                                                       const char *filename,
+                                                       const char *agent_path);
+       void (*bt_destroy_popup_all)(void);
+       gboolean (*bt_launch_unable_to_pairing_syspopup)(int result);
+       gboolean (*bt_is_tethering_enabled)(void);
+       int (*bt_get_mime_type)(char *file_name, char **mime_type);
+};
+
+typedef struct {
+       gboolean plugin_headed_enabled;
+       void *handle_headed;
+       struct bluetooth_headed_plugin_t *headed_plugin;
+} bt_plugin_info_t;
+
+extern bt_plugin_info_t *headed_plugin_info;
+
 GDBusConnection *_bt_gdbus_get_system_gconn(void);
 
 GDBusConnection *_bt_gdbus_get_session_gconn(void);
@@ -359,15 +370,21 @@ GDBusProxy *_bt_get_manager_proxy(void);
 
 GDBusProxy *_bt_get_adapter_proxy(void);
 
+GDBusProxy *_bt_get_ipsp_proxy(void);
+
 GDBusProxy *_bt_get_adapter_properties_proxy(void);
 
 char *_bt_get_device_object_path(char *address);
 
 char *_bt_get_profile_uuid128(bt_profile_type_t profile_type);
 
-char *_bt_convert_error_to_string(int error);
+const char *_bt_convert_uuid_to_string(const char *uuid);
 
-char * _bt_convert_disc_reason_to_string(int reason);
+const char *_bt_convert_error_to_string(int error);
+
+const char *_bt_convert_disc_reason_to_string(int reason);
+
+const char *_bt_convert_service_function_to_string(int function);
 
 void _bt_logging_connection(gboolean connect, int addr_type);
 
@@ -375,6 +392,8 @@ char *_bt_get_adapter_path(void);
 
 void _bt_deinit_proxys(void);
 
+GDBusProxy *_bt_gdbus_get_hid_agent_proxy(void);
+
 void _bt_convert_device_path_to_address(const char *device_path,
                                                char *device_address);