Add the sender name in signal subscribe function
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / include / bt-service-common.h
index ba4ce1a..27953b6 100644 (file)
@@ -25,8 +25,6 @@
 #include <gio/gio.h>
 
 #include "bluetooth-api.h"
-#include "bt-internal-types.h"
-#include "bt-service-agent.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -51,12 +49,21 @@ extern "C" {
 #define LOG_COLOR_PURPLE   "\033[35m"
 
 
+#ifndef TIZEN_TV
 #define BT_DBG(fmt, args...) \
-       ((TIZEN_PROFILE_TV) ? (LOGI(fmt, ##args)) : (SLOGD(fmt, ##args)))
+       SLOGD(fmt, ##args)
 #define BT_INFO(fmt, args...) \
-       ((TIZEN_PROFILE_TV) ? (LOGI(fmt, ##args)) : (SLOGI(fmt, ##args)))
+       SLOGI(fmt, ##args)
 #define BT_ERR(fmt, args...) \
-       ((TIZEN_PROFILE_TV) ? (LOGE(fmt, ##args)) : (SLOGE(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
 
 #define BT_INFO_C(fmt, arg...) \
        SLOGI_IF(TRUE,  LOG_COLOR_GREEN" "fmt" "LOG_COLOR_RESET, ##arg)
@@ -101,7 +108,11 @@ extern "C" {
 #define BT_AGENT_NEW_LINE "\r\n"
 
 #define BT_MAX_DBUS_TIMEOUT 45000
-#define BT_ENABLE_TIMEOUT ((TIZEN_PROFILE_TV) ? 5000 : 20000) /* 5(TV),20(others) seconds */
+#ifndef TIZEN_TV
+#define BT_ENABLE_TIMEOUT 20000 /* 20 seconds */
+#else
+#define BT_ENABLE_TIMEOUT 5000 /* 5 seconds */
+#endif
 #define BT_DISCOVERY_FINISHED_DELAY 200
 
 #define BT_SESSION_BUS_GET_TIMEOUT 200 /* 200 ms */
@@ -127,7 +138,6 @@ 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"
@@ -139,7 +149,6 @@ 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"
@@ -168,7 +177,6 @@ extern "C" {
 #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"
 
@@ -176,7 +184,7 @@ extern "C" {
 #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"
@@ -200,6 +208,15 @@ extern "C" {
 #define BT_DUMP_SERVICE_FINISH_SIGNAL "Finish"
 
 
+#define BT_DEVICED_POWEROFF_INTERFACE "org.tizen.system.deviced.PowerOff"
+#define BT_DEVICED_POWEROFF_OBJECT_PATH "/Org/Tizen/System/DeviceD/PowerOff"
+
+#define BT_DEVICED_POWEROFF_SIGNAL "ChangeState"
+#define BT_DEVICED_POWEROFF_SIGNAL_POWEROFF_POPUP (1)
+#define BT_DEVICED_POWEROFF_SIGNAL_POWEROFF (2)
+#define BT_DEVICED_POWEROFF_SIGNAL_REBOOT (3)
+
+
 #define BT_INTERFACES_ADDED "InterfacesAdded"
 #define BT_INTERFACES_REMOVED "InterfacesRemoved"
 #define BT_NAME_OWNER_CHANGED "NameOwnerChanged"
@@ -236,7 +253,6 @@ 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"
@@ -258,8 +274,6 @@ 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"
-
 /* Profile states matched to btd_service_state_t of bluez service.h */
 typedef enum {
        BT_PROFILE_STATE_UNAVAILABLE,
@@ -274,7 +288,6 @@ 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,
@@ -300,6 +313,19 @@ 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;
@@ -333,26 +359,6 @@ 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);
-};
-
-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);
@@ -363,8 +369,6 @@ 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);
@@ -377,6 +381,8 @@ const char *_bt_convert_error_to_string(int error);
 
 const char *_bt_convert_disc_reason_to_string(int reason);
 
+const char *_bt_convert_profile_state_to_string(bt_profile_state_t state);
+
 const char *_bt_convert_service_function_to_string(int function);
 
 void _bt_logging_connection(gboolean connect, int addr_type);