#include <gio/gio.h>
#include "bluetooth-api.h"
-#include "bt-internal-types.h"
-#include "bt-service-agent.h"
#ifdef __cplusplus
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)
#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 */
#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"
#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"
#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_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"
#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"
#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"
#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,
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,
} 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;
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);
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);
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);