SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(EXEC_PREFIX "\${prefix}")
+IF("${ARCH}" STREQUAL "aarch64")
+SET(LIBDIR "\${prefix}/lib64")
+ELSE()
SET(LIBDIR "\${prefix}/lib")
+ENDIF("${ARCH}" STREQUAL "aarch64")
SET(INCLUDEDIR "\${prefix}/include")
SET(VERSION_MAJOR 1)
SET(VERSION ${VERSION_MAJOR}.0.0)
return BLUETOOTH_ADAPTER_LE_DISABLED;
}
+#ifdef ENABLE_TIZEN_2_4
ret = vconf_get_int(VCONFKEY_BT_LE_STATUS, &value);
if (ret != 0) {
BT_ERR("fail to get vconf key!");
BT_DBG("value : %d", value);
return value == VCONFKEY_BT_LE_STATUS_ON ? BLUETOOTH_ADAPTER_LE_ENABLED :
BLUETOOTH_ADAPTER_LE_DISABLED;
+#else
+ return value = BLUETOOTH_ADAPTER_LE_DISABLED;
+#endif
}
BT_EXPORT_API int bluetooth_enable_adapter_le(void)
*
*/
#include <vconf.h>
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
#include <syspopup_caller.h>
+#endif
#include "bluetooth-api.h"
#include "bt-internal-types.h"
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED dbus-glib-1 dlog vconf gio-2.0 gio-unix-2.0 eventsystem)
+pkg_check_modules(pkgs REQUIRED dbus-glib-1 dlog vconf gio-2.0 gio-unix-2.0)
FOREACH(flag ${pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
#include <vconf.h>
#include <vconf-keys.h>
#include <bundle.h>
+#if 0
#include <eventsystem.h>
+#endif
#include "bt-core-main.h"
#include "bt-core-adapter.h"
static gboolean is_recovery_mode = FALSE;
static int bt_status_before[BT_MODE_MAX] = { VCONFKEY_BT_STATUS_OFF, };
-static int bt_le_status_before[BT_MODE_MAX] = { VCONFKEY_BT_LE_STATUS_OFF, };
+static int bt_le_status_before[BT_MODE_MAX] = { 0, };
static void __bt_core_set_status(bt_status_t status)
{
static void __bt_core_update_status(void)
{
int bt_status = VCONFKEY_BT_STATUS_OFF;
- int bt_le_status = VCONFKEY_BT_LE_STATUS_OFF;
+ int bt_le_status = 0;
if (vconf_get_int(VCONFKEY_BT_STATUS, &bt_status) < 0)
BT_ERR("no bluetooth device info, so BT was disabled at previous session");
+#ifdef ENABLE_TIZEN_2_4
if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_le_status) < 0)
BT_ERR("no bluetooth le info, so BT LE was disabled at previous session");
+#endif
BT_INFO("bt_status = %d, bt_le_status = %d", bt_status, bt_le_status);
else
__bt_core_set_status(BT_ACTIVATED);
- if (bt_le_status == VCONFKEY_BT_LE_STATUS_OFF)
+ if (bt_le_status == 0)
__bt_core_set_le_status(BT_LE_DEACTIVATED);
else
__bt_core_set_le_status(BT_LE_ACTIVATED);
if (adapter_status_le == BT_LE_ACTIVATED) {
int bt_le_status_before_mode = 0;
+#ifdef ENABLE_TIZEN_2_4
if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_le_status_before_mode) == 0)
_bt_core_set_bt_le_status(BT_FLIGHT_MODE, bt_le_status_before_mode);
+#endif
_bt_core_service_request_adapter(BT_DISABLE_ADAPTER_LE);
_bt_disable_adapter_le();
return FALSE;
}
-
+#if 0
static int __bt_eventsystem_set_value(const char *event, const char *key, const char *value)
{
int ret;
return ret;
}
-
+#endif
void _bt_core_adapter_added_cb(void)
{
bt_status_t status;
__bt_core_set_le_status(BT_LE_DEACTIVATED);
if (vconf_set_int(VCONFKEY_BT_STATUS, VCONFKEY_BT_STATUS_OFF) != 0)
BT_ERR("Set vconf failed");
+#ifdef ENABLE_TIZEN_2_4
if (vconf_set_int(VCONFKEY_BT_LE_STATUS, VCONFKEY_BT_LE_STATUS_OFF) != 0)
BT_ERR("Set vconf failed");
+#endif
+#if 0
if (__bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_STATE,
EVT_VAL_BT_OFF) != ES_R_OK)
BT_ERR("Fail to set value");
if (__bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_LE_STATE,
EVT_VAL_BT_LE_OFF) != ES_R_OK)
BT_ERR("Fail to set value");
-
+#endif
if (is_recovery_mode == TRUE)
{
if (timer_id < 0)
static gboolean __bt_check_bt_core(void *data)
{
int bt_status = VCONFKEY_BT_STATUS_OFF;
- int bt_le_status = VCONFKEY_BT_LE_STATUS_OFF;
+ int bt_le_status = 0;
bt_status_t status = BT_DEACTIVATED;
bt_le_status_t le_status = BT_LE_DEACTIVATED;
int flight_mode_deactivation = 0;
BT_DBG("no bluetooth device info, so BT was disabled at previous session");
}
+#ifdef ENABLE_TIZEN_2_4
if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_le_status) < 0) {
BT_ERR("no bluetooth le info, so BT LE was disabled at previous session");
}
+#endif
if (vconf_get_int(BT_OFF_DUE_TO_FLIGHT_MODE, &flight_mode_deactivation) != 0)
BT_ERR("Fail to get the flight_mode_deactivation value");
_bt_core_set_bt_status(BT_POWER_SAVING_MODE, ps_mode_deactivation);
}
- if ((bt_le_status == VCONFKEY_BT_LE_STATUS_ON) && (le_status == BT_LE_DEACTIVATED)) {
+ if ((bt_le_status == 1) && (le_status == BT_LE_DEACTIVATED)) {
BT_DBG("Previous session was le enabled. Turn BT LE on automatically.");
/* Enable the BT LE */
if (adapter_status_le == BT_LE_ACTIVATED) {
int bt_le_status_before_mode = 0;
+#ifdef ENABLE_TIZEN_2_4
if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_le_status_before_mode) == 0)
_bt_core_set_bt_le_status(BT_FLIGHT_MODE, bt_le_status_before_mode);
+#endif
_bt_core_service_request_adapter(BT_DISABLE_ADAPTER_LE);
_bt_disable_adapter_le();
}
if (adapter_status_le == BT_LE_ACTIVATED) {
int bt_le_status_before_mode = 0;
+#ifdef ENABLE_TIZEN_2_4
if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_le_status_before_mode) == 0)
_bt_core_set_bt_le_status(BT_POWER_SAVING_MODE, bt_le_status_before_mode);
+#endif
/* Disable the BT LE */
_bt_core_service_request_adapter(BT_DISABLE_ADAPTER_LE);
flight_mode = _bt_core_is_flight_mode_enabled();
#ifndef TIZEN_WEARABLE
+#ifdef ENABLE_TIZEN_2_4
if (vconf_get_int(VCONFKEY_SETAPPL_PSMODE, &power_saving_mode) != 0)
BT_ERR("Fail to get the power_saving_mode status value");
#endif
+#endif
BT_DBG("flight_mode = %d, power_saving_mode = %d", flight_mode, power_saving_mode);
if (flight_mode == TRUE)
int ret;
BT_DBG("+");
+#ifdef ENABLE_TIZEN_2_4
ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_PSMODE,
(vconf_callback_fn)__bt_core_power_saving_mode_cb, NULL);
-
+#endif
if (ret < 0)
BT_ERR("Unable to register key handler");
#endif
#endif
#ifndef TIZEN_WEARABLE
+#ifdef ENABLE_TIZEN_2_4
vconf_ignore_key_changed(VCONFKEY_SETAPPL_PSMODE,
(vconf_callback_fn)__bt_core_power_saving_mode_cb);
#endif
+#endif
return;
}
bt-service-pbap.c
)
+IF(LIBNOTIFY_SUPPORT)
+LIST(APPEND SRCS
+bt-popup.c
+)
+ENDIF(LIBNOTIFY_SUPPORT)
+
+IF(LIBNOTIFICATION_SUPPORT)
+LIST(APPEND SRCS
+bt-service-agent-notification.c
+)
+ENDIF(LIBNOTIFICATION_SUPPORT)
+
IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
SET(CMAKE_BUILD_TYPE "Release")
ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
capi-content-mime-type
capi-network-connection
pkgmgr
- journal
- eventsystem
)
IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_NETWORK_TETHERING_ENABLE")
ADD_DEFINITIONS("-DAPP_LOCALEDIR=\"${APP_LOCALEDIR}\"")
ADD_DEFINITIONS("-DAPP_SYSCONFDIR=\"${APP_SYSCONFDIR}\"")
+IF(LIBNOTIFY_SUPPORT OR LIBNOTIFICATION_SUPPORT)
+ ADD_DEFINITIONS("-DDATA_DIR_ICON=\"${SHARE_INSTALL_PREFIX}\"")
+ MESSAGE("Icon used for notification is : ${SHARE_INSTALL_PREFIX}/icons/default/bt-icon.png")
+ENDIF(LIBNOTIFY_SUPPORT OR LIBNOTIFICATION_SUPPORT)
+
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+
+# to permit usage of bluetooth_cancel_bonding in bt-popup.c. This build bluetooth-api first.
+IF(LIBNOTIFY_SUPPORT)
+ ADD_DEPENDENCIES(${PROJECT_NAME} bluetooth-api)
+ TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${service_pkgs_LDFLAGS} bluetooth-api)
+ELSE(LIBNOTIFY_SUPPORT)
+ TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${service_pkgs_LDFLAGS})
+ENDIF(LIBNOTIFY_SUPPORT)
+
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${service_pkgs_LDFLAGS})
-INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service DESTINATION /etc/rc.d/init.d)
+#INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service DESTINATION /etc/rc.d/init.d)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service DESTINATION share/dbus-1/system-services)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/auto-pair-blacklist DESTINATION /opt/var/lib/bluetooth/)
+
+# install booting script
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf)
+
IF (TIZEN_WEARABLE)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/wearable/stack_info DESTINATION /usr/etc/bluetooth/)
ELSE ()
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mobile/stack_info DESTINATION /usr/etc/bluetooth/)
ENDIF (TIZEN_WEARABLE)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf DESTINATION /etc/dbus-1/system.d)
+
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
--- /dev/null
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+ <policy group="@TZ_SYS_USER_GROUP@">
+ <allow own="org.projectx.bt"/>
+ <allow own="org.projectx.bt_event"/>
+ <allow send_type="method_call"/>
+ </policy>
+ <policy at_console="true">
+ <allow send_destination="org.projectx.bt"/>
+ </policy>
+ <policy context="default">
+ <allow send_destination="org.projectx.bt"/>
+ </policy>
+</busconfig>
+
--- /dev/null
+# bt-service check previous BT-connection status and re-activate BT when boot.
+
+[Unit]
+Description=Bluetooth Framework Service
+
+[Service]
+Type=dbus
+BusName=org.projectx.bt
+ExecStart=/usr/bin/bt-service
+RemainAfterExit=yes
+
+[Install]
+WantedBy=tizen-middleware.target
#include <dlog.h>
#include <string.h>
#include <vconf.h>
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
#include <syspopup_caller.h>
+#endif
#include <aul.h>
+#ifdef ENABLE_TIZEN_2_4
#include <journal/device.h>
+#endif
#include "bt-internal-types.h"
#include "bt-service-common.h"
static gboolean __bt_is_factory_test_mode(void)
{
int mode = 0;
-
+#ifdef ENABLE_TIZEN_2_4
if (vconf_get_bool(VCONFKEY_BT_DUT_MODE, &mode)) {
BT_ERR("Get the DUT Mode fail");
return TRUE;
}
-
+#endif
if (mode != FALSE) {
BT_INFO("DUT Test Mode !!");
return TRUE;
#include <dlog.h>
#include <string.h>
#include <vconf.h>
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
#include <syspopup_caller.h>
+#endif
#include <aul.h>
+#ifdef ENABLE_TIZEN_2_4
#include <journal/device.h>
+#endif
#include <bundle.h>
+#if 0
#include <eventsystem.h>
+#endif
#include <bundle_internal.h>
#include "alarm.h"
{
int mode = 0;
+#ifdef ENABLE_TIZEN_2_4
if (vconf_get_bool(VCONFKEY_BT_DUT_MODE, &mode)) {
BT_ERR("Get the DUT Mode fail");
return TRUE;
}
+#endif
if (mode != FALSE) {
BT_INFO("DUT Test Mode !!");
if (vconf_set_int(VCONFKEY_BT_DEVICE, VCONFKEY_BT_DEVICE_NONE) != 0)
BT_ERR("Set vconf failed\n");
-
+#if 0
if (_bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_STATE,
EVT_VAL_BT_ON) != ES_R_OK)
BT_ERR("Fail to set value");
+#endif
/* Send enabled event to API */
_bt_send_event(BT_ADAPTER_EVENT, BLUETOOTH_EVENT_ENABLED,
/* Update Bluetooth Status to notify other modules */
if (vconf_set_int(VCONFKEY_BT_STATUS, VCONFKEY_BT_STATUS_OFF) != 0)
BT_ERR("Set vconf failed");
-
+#if 0
if (_bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_STATE,
EVT_VAL_BT_OFF) != ES_R_OK)
BT_ERR("Fail to set value");
+#endif
}
if (vconf_set_int(VCONFKEY_BT_DEVICE, VCONFKEY_BT_DEVICE_NONE) != 0)
__bt_set_local_name();
+#ifdef ENABLE_TIZEN_2_4
/* Update Bluetooth Status to notify other modules */
if (vconf_set_int(VCONFKEY_BT_LE_STATUS, VCONFKEY_BT_LE_STATUS_ON) != 0)
BT_ERR("Set vconf failed\n");
-
+#endif
+#if 0
if (_bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_LE_STATE,
EVT_VAL_BT_LE_ON) != ES_R_OK)
BT_ERR("Fail to set value");
+#endif
/* Send enabled event to API */
/*
/* Update Bluetooth Status to notify other modules */
BT_DBG("Update vconf for BT LE normal Deactivation");
+#ifdef ENABLE_TIZEN_2_4
if (vconf_set_int(VCONFKEY_BT_LE_STATUS, VCONFKEY_BT_LE_STATUS_OFF) != 0)
BT_ERR("Set vconf failed\n");
_bt_adapter_set_le_status(BT_LE_DEACTIVATED);
-
+#endif
+#if 0
if (_bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_LE_STATE,
EVT_VAL_BT_LE_OFF) != ES_R_OK)
BT_ERR("Fail to set value");
+#endif
if (_bt_adapter_get_status() != BT_DEACTIVATED) {
/* Send disabled event */
#endif
#ifndef TIZEN_WEARABLE
+#ifdef ENABLE_TIZEN_2_4
if (vconf_notify_key_changed(VCONFKEY_SETAPPL_PSMODE,
(vconf_callback_fn)__bt_service_flight_ps_mode_cb, NULL) < 0)
BT_ERR("Unable to register key handler");
#endif
+#endif
}
void _bt_service_unregister_vconf_handler(void)
(vconf_callback_fn)__bt_service_flight_ps_mode_cb);
#endif
-#ifndef TIZEN_WEARABLE
+#ifndef TIZEN_WEARABLEi
+#ifdef ENABLE_TIZEN_2_4
vconf_ignore_key_changed(VCONFKEY_SETAPPL_PSMODE,
(vconf_callback_fn)__bt_service_flight_ps_mode_cb);
#endif
+#endif
}
static void __bt_state_event_handler(const char *event_name, bundle *data, void *user_data)
const char *bt_le_status = NULL;
const char *bt_transfering_status = NULL;
BT_DBG("bt state set event(%s) received", event_name);
-
+#ifdef ENABLE_TIZEN_2_4
bt_status = bundle_get_val(data, EVT_KEY_BT_STATE);
BT_DBG("bt_state: (%s)", bt_status);
bt_le_status = bundle_get_val(data, EVT_KEY_BT_LE_STATE);
BT_DBG("bt_state: (%s)", bt_le_status);
+#endif
}
void _bt_handle_adapter_added(void)
__bt_set_enabled();
_bt_adapter_set_status(BT_ACTIVATED);
}
+#ifdef ENABLE_TIZEN_2_4
journal_bt_on();
+#endif
_bt_service_register_vconf_handler();
-
+#if 0
/* eventsystem */
if (eventsystem_register_event(SYS_EVENT_BT_STATE, &status_reg_id,
(eventsystem_handler)__bt_state_event_handler, NULL) != ES_R_OK) {
BT_ERR("Fail to register system event");
}
+#endif
}
void _bt_handle_adapter_removed(void)
int ret;
_bt_adapter_set_status(BT_DEACTIVATED);
+#ifdef ENABLE_TIZEN_2_4
journal_bt_off();
+#endif
__bt_visibility_alarm_remove();
adapter_agent = NULL;
_bt_reliable_terminate_service(NULL);
-
+#if 0
if (eventsystem_unregister_event(status_reg_id) != ES_R_OK) {
BT_ERR("Fail to unregister system event");
}
+#endif
}
#include <string.h>
#include <malloc.h>
#include <stacktrim.h>
+
+#if defined(LIBNOTIFY_SUPPORT)
+#include "bt-popup.h"
+#elif defined(LIBNOTIFICATION_SUPPORT)
+#include "bt-service-agent-notification.h"
+#else
#include <syspopup_caller.h>
+#endif
+
#include <vconf.h>
#include <bundle_internal.h>
retv_if(user_data == NULL, FALSE);
++retry_count;
-
- ret = syspopup_launch("bt-syspopup", b);
+#if defined(LIBNOTIFY_SUPPORT)
+ ret = notify_launch(b);
+#elif defined(LIBNOTIFICATION_SUPPORT)
+ ret = notification_launch(b);
+#else
+ ret = syspopup_launch("bt-syspopup", b);
+#endif
if (ret < 0) {
BT_ERR("Sorry! Can't launch popup, ret=%d, Re-try[%d] time..",
ret, retry_count);
bundle_add(b, "event-type", event_str);
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
ret = syspopup_launch("bt-syspopup", b);
+#endif
if (0 > ret) {
BT_ERR("Popup launch failed...retry %d", ret);
static gboolean __pairing_cancel_request(GapAgentPrivate *agent, const char *address)
{
BT_DBG("On Going Pairing is cancelled by remote\n");
-
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
syspopup_destroy_all();
+#endif
__bt_agent_release_memory();
gap_agent_reply_authorize(agent, GAP_AGENT_CANCEL, NULL);
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
syspopup_destroy_all();
+#endif
__bt_agent_release_memory();
#include <glib.h>
#include <dlog.h>
#include <string.h>
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
#include <syspopup_caller.h>
+#endif
#include "bluetooth-api.h"
#include "bt-internal-types.h"
#include <glib.h>
#include <dlog.h>
#include <string.h>
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
#include <syspopup_caller.h>
+#endif
#include <dbus/dbus.h>
#include "bluetooth-api.h"
#include <termios.h>
#include <net_connection.h>
#include <bundle.h>
+#if 0
#include <eventsystem.h>
-
-#include <bundle.h>
-#include <eventsystem.h>
-
+#endif
#include "bluetooth-api.h"
#include "bt-service-common.h"
BT_INFO("[PM] Number of LE conn: %d disc: %d, Number of BR/EDR conn: %d disc: %d",
le_conn, le_disc, edr_conn, edr_disc);
}
-
+#if 0
int _bt_eventsystem_set_value(const char *event, const char *key, const char *value)
{
int ret;
return ret;
}
-
+#endif
void _bt_swap_byte_ordering(char *data, int data_len)
{
char temp;
#include <gio/gio.h>
#include <dlog.h>
#include <string.h>
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
#include <syspopup_caller.h>
+#endif
#include "bluetooth-api.h"
#include "bt-internal-types.h"
b = (bundle *)user_data;
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
ret = syspopup_launch("bt-syspopup", b);
+#endif
if (ret < 0) {
BT_ERR("Sorry!! Cannot launch popup return = %d, Retrying...", ret);
} else {
else
bundle_add(b, "error", "error");
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
ret = syspopup_launch("bt-syspopup", b);
+#endif
if (0 > ret) {
BT_ERR("Popup launch failed...retry %d \n", ret);
g_timeout_add(200, (GSourceFunc) __bt_syspopup_timer_cb,
GVariant *manufacture_data;
GVariant *param;
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
/* Terminate ALL system popup */
syspopup_destroy_all();
+#endif
g_dbus_proxy_call_finish(proxy, res, &err);
#include <dlog.h>
#include <vconf.h>
#include <vconf-internal-bt-keys.h>
+#if ENABLE_TIZEN_2_4
#include <journal/device.h>
+#endif
#include "bluetooth-api.h"
#include "bt-internal-types.h"
bt_state != VCONFKEY_BT_STATUS_OFF) {
_bt_disable_adapter();
}
+#ifdef ENABLE_TIZEN_2_4
if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_state) == 0 &&
bt_state != VCONFKEY_BT_LE_STATUS_OFF) {
_bt_set_le_disabled(BLUETOOTH_ERROR_NONE);
}
+#endif
}
} else if (strcasecmp(property, "Connectable") == 0) {
gboolean connectable = FALSE;
BT_DBG("HID device class [%x]", remote_dev_info->class);
if (remote_dev_info->class &
BLUETOOTH_DEVICE_MINOR_CLASS_KEY_BOARD) {
+#ifdef ENABLE_TIZEN_2_4
__bt_set_device_values(property_flag,
VCONFKEY_BT_DEVICE_HID_KEYBOARD_CONNECTED);
+#endif
}
if (remote_dev_info->class &
BLUETOOTH_DEVICE_MINOR_CLASS_POINTING_DEVICE) {
+#ifdef ENABLE_TIZEN_2_4
__bt_set_device_values(property_flag,
VCONFKEY_BT_DEVICE_HID_MOUSE_CONNECTED);
+#endif
}
_bt_free_device_info(remote_dev_info);
}
g_free(dev_name);
_bt_logging_connection(TRUE, addr_type);
+#ifdef ENABLE_TIZEN_2_4
journal_bt_connected();
+#endif
param = g_variant_new("(isy)", result, address, addr_type);
/*Send event to application*/
_bt_send_event(BT_DEVICE_EVENT,
_bt_convert_device_path_to_address(path, address);
dev_name = _bt_get_bonded_device_name(address);
+#ifdef ENABLE_TIZEN_2_4
journal_bt_disconnected();
+#endif
/* 0x00 BDADDR_BRDER
0x01 BDADDR_LE_PUBLIC
#include <gio/gio.h>
#include <dlog.h>
#include <string.h>
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
#include <syspopup_caller.h>
+#endif
#include "bluetooth-api.h"
#include "bt-service-common.h"
#include <privilege-control.h>
#endif
#include <bundle.h>
+#if 0
#include <eventsystem.h>
+#endif
#include "bt-internal-types.h"
#include "bt-service-common.h"
if(vconf_set_int(VCONFKEY_BT_STATUS,
VCONFKEY_BT_STATUS_OFF) != 0)
BT_ERR("Set vconf failed\n");
-
+#if 0
if (_bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_STATE,
EVT_VAL_BT_OFF) != ES_R_OK)
BT_ERR("Fail to set value");
+#endif
}
}
+#ifdef ENABLE_TIZEN_2_4
if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_status) < 0) {
BT_ERR("no bluetooth device info, so BT was disabled at previous session");
} else {
if(vconf_set_int(VCONFKEY_BT_LE_STATUS,
VCONFKEY_BT_LE_STATUS_OFF) != 0)
BT_ERR("Set vconf failed\n");
+#if 0
if (_bt_eventsystem_set_value(SYS_EVENT_BT_STATE, EVT_KEY_BT_LE_STATE,
EVT_VAL_BT_LE_OFF) != ES_R_OK)
BT_ERR("Fail to set value");
+#endif
}
}
+#endif
if (main_loop != NULL) {
g_main_loop_quit(main_loop);
static gboolean __bt_check_bt_service(void *data)
{
int bt_status = VCONFKEY_BT_STATUS_OFF;
- int bt_le_status = VCONFKEY_BT_LE_STATUS_OFF;
+ int bt_le_status = 0;
bt_status_t status = BT_DEACTIVATED;
bt_le_status_t le_status = BT_LE_DEACTIVATED;
int flight_mode_deactivation = 0;
BT_DBG("no bluetooth device info, so BT was disabled at previous session");
}
+#ifdef ENABLE_TIZEN_2_4
if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_le_status) < 0) {
BT_ERR("no bluetooth le info, so BT LE was disabled at previous session");
}
+#endif
if (vconf_get_int(BT_OFF_DUE_TO_FLIGHT_MODE, &flight_mode_deactivation) != 0)
BT_ERR("Fail to get the flight_mode_deactivation value");
_bt_enable_core();
}
- if ((bt_le_status == VCONFKEY_BT_LE_STATUS_ON) && (le_status == BT_LE_DEACTIVATED)) {
+ if ((bt_le_status == 1) && (le_status == BT_LE_DEACTIVATED)) {
BT_DBG("Previous session was le enabled. Turn BT LE on automatically.");
/* Enable the BT LE */
#include <dlog.h>
#include <string.h>
#include <stdio.h>
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
#include <syspopup_caller.h>
+#endif
#include <net_connection.h>
#include "bluetooth-api.h"
#include <string.h>
#include <malloc.h>
#include <stacktrim.h>
+#if !defined(LIBNOTIFY_SUPPORT) && !defined(LIBNOTIFICATION_SUPPORT)
#include <syspopup_caller.h>
+#endif
#include <vconf.h>
#include "bt-internal-types.h"
int _bt_set_non_blocking_tty(int sk);
void _bt_deinit_bluez_proxy(void);
-
+#if 0
int _bt_eventsystem_set_value(const char *event, const char *key, const char *value);
-
+#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
+%bcond_with x
%define _dumpdir /opt/etc/dump.d/module.d
%define _varlibdir /opt/var/lib
Summary: Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
Version: 0.2.148
Release: 1
-Group: TO_BE/FILLED_IN
+Group: Network & Connectivity/Bluetooth
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
+Source1001: bluetooth-frwk.manifest
+%if %{with bluetooth_frwk_libnotify} || %{with bluetooth_frwk_libnotification}
+Source1002: bt-icon.png
+%endif
Requires: sys-assert
Requires: dbus
Requires: syspopup
+%if "%{?profile}" != "mobile"
+Requires: bluetooth-tools
+%endif
BuildRequires: pkgconfig(aul)
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(gio-unix-2.0)
+%if %{with bluetooth_frwk_libnotify}
+BuildRequires: pkgconfig(libnotify)
+BuildRequires: pkgconfig(gdk-pixbuf-2.0)
+BuildRequires: pkgconfig(gtk+-3.0)
+%elif %{without bluetooth_frwk_libnotification}
+BuildRequires: pkgconfig(syspopup-caller)
+Requires: syspopup
+%else
BuildRequires: pkgconfig(syspopup-caller)
+%endif
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(dbus-1)
+%if %{with x}
BuildRequires: pkgconfig(utilX)
+%endif
BuildRequires: pkgconfig(capi-network-connection)
BuildRequires: pkgconfig(alarm-service)
BuildRequires: pkgconfig(security-server)
BuildRequires: pkgconfig(capi-content-mime-type)
BuildRequires: pkgconfig(appcore-efl)
BuildRequires: pkgconfig(pkgmgr)
-BuildRequires: pkgconfig(journal)
-BuildRequires: pkgconfig(eventsystem)
+#BuildRequires: pkgconfig(journal)
+#BuildRequires: pkgconfig(eventsystem)
%if "%{?tizen_profile_name}" == "mobile"
BuildRequires: pkgconfig(capi-network-tethering)
%endif
+#BuildRequires: pkgconfig(cynara-client)
+#BuildRequires: pkgconfig(cynara-creds-dbus)
BuildRequires: cmake
%package devel
Summary: Bluetooth framework for BlueZ and Obexd
-Group: TO_BE/FILLED
+Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description devel
%package service
Summary: Bluetooth Service daemon
-Group: TO_BE/FILLED
+Group: Network & Connectivity/Bluetooth
Requires: %{name} = %{version}-%{release}
%description service
%package core
Summary: Bluetooth Core daemon
-Group: TO_BE/FILLED
+Group: Network & Connectivity/Bluetooth
Requires: %{name} = %{version}-%{release}
%description core
%package test
Summary: Bluetooth test application
-Group: TO_BE/FILLED
+Group: Network & Connectivity/Bluetooth
Requires: %{name} = %{version}-%{release}
%description test
export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
+export CFLAGS="$CFLAGS -fpie -DRFCOMM_DIRECT "
+export LDFLAGS="$CFLAGS -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
+
%if "%{?tizen_profile_name}" == "mobile"
-export CFLAGS="$CFLAGS -DTIZEN_NETWORK_TETHERING_ENABLE"
+export CFLAGS="$CFLAGS -DTIZEN_NETWORK_TETHERING_ENABLE -DTIZEN_BT_FLIGHTMODE_ENABLED"
%endif
%if "%{?tizen_profile_name}" == "wearable"
%endif
%define _servicedir multi-user.target.wants
-%if "%{?tizen_profile_name}" == "mobile"
-export CFLAGS="$CFLAGS -DTIZEN_BT_FLIGHTMODE_ENABLED"
+%ifarch x86_64
+export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
%endif
-export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
+%ifarch aarch64
+export CFLAGS="$CFLAGS -D__TIZEN_MOBILE__ -DTIZEN_TELEPHONY_ENABLED"
+%endif
-export CFLAGS+=" -fpie -DRFCOMM_DIRECT "
-cmake . -DCMAKE_INSTALL_PREFIX=/usr
+
+cmake . -DCMAKE_INSTALL_PREFIX=/usr \
+-DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
+-DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
+%if %{with bluetooth_frwk_libnotify}
+ -DLIBNOTIFY_SUPPORT=On \
+%else
+ -DLIBNOTIFY_SUPPORT=Off \
+%endif
+%if %{with bluetooth_frwk_libnotification}
+ -DLIBNOTIFICATION_SUPPORT=On
+%else
+ -DLIBNOTIFICATION_SUPPORT=Off
+%endif
make
%else
-DTIZEN_WEARABLE=NO \
%endif
+%if "%{?tizen_profile_name}" == "common"
+ -DTIZEN_WEARABLE=NO \
+%endif
+
%install
rm -rf %{buildroot}
install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-service
install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-devel
-mkdir -p %{buildroot}%{_libdir}/systemd/system/%{_servicedir}
-install -m 0644 %{_servicefile} %{buildroot}%{_libdir}/systemd/system/bluetooth-frwk.service
-ln -s ../bluetooth-frwk.service %{buildroot}%{_libdir}/systemd/system/%{_servicedir}/bluetooth-frwk.service
+mkdir -p %{buildroot}%{_unitdir_user}
+install -m 0644 bt-service/bluetooth-frwk-service.service %{buildroot}%{_unitdir_user}
mkdir -p %{buildroot}%{_dumpdir}
install -m 0755 bluetooth_log_dump.sh %{buildroot}%{_dumpdir}
+%if %{with bluetooth_frwk_libnotify} || %{with bluetooth_frwk_libnotification}
+mkdir -p %{buildroot}%{_datadir}/icons/default
+install -m 0644 %{SOURCE1002} %{buildroot}%{_datadir}/icons/default/bt-icon.png
+%endif
+
+# On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
+%if "%{profile}"=="ivi"
+sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service
+%endif
+
+
%post
+/sbin/ldconfig
%if "%{?tizen_profile_name}" == "wearable"
-vconftool set -tf int db/bluetooth/status "1" -g 5000 -s tizen::vconf::public::r::platform::rw
-%else
-vconftool set -tf int db/bluetooth/status "0" -g 5000 -s tizen::vconf::public::r::platform::rw
+vconftool set -f -t int db/bluetooth/status "1" -g 6520
%endif
-#vconftool set -tf int db/bluetooth/lestatus "0" -g 5000 -s tizen::vconf::public::r::platform::rw
-#vconftool set -tf int file/private/bt-core/flight_mode_deactivated "0" -g 5000 -i -s tizen::vconf::platform::rw
-#vconftool set -tf int file/private/bt-core/powersaving_mode_deactivated "0" -g 5000 -i -s tizen::vconf::platform::rw
-#vconftool set -tf int file/private/bt-service/bt_off_due_to_timeout "0" -g 5000 -i -s tizen::vconf::platform::rw
-#vconftool set -tf string memory/bluetooth/sco_headset_name "" -g 5000 -i -s tizen::vconf::platform::rw
-#vconftool set -tf int memory/bluetooth/device "0" -g 5000 -i -s tizen::vconf::platform::rw
-#vconftool set -tf bool memory/bluetooth/dutmode "0" -g 5000 -i -s tizen::vconf::platform::rw
+%if "%{?tizen_profile_name}" == "mobile"
+vconftool set -f -t int db/bluetooth/status "0" -g 6520
+%endif
+%if "%{?tizen_profile_name}" == "common"
+vconftool set -f -t int db/bluetooth/status "0" -g 6520
+%endif
+
+vconftool set -f -t int db/bluetooth/status "0" -s User
+vconftool set -f -t int db/bluetooth/lestatus "0" -s User
+vconftool set -f -t int file/private/bt-core/flight_mode_deactivated "0" -s User
+vconftool set -f -t int file/private/bt-core/powersaving_mode_deactivated "0" -s User
+vconftool set -f -t int file/private/bt-service/bt_off_due_to_timeout "0" -s User
+vconftool set -f -t string memory/bluetooth/sco_headset_name "" -g 6520 -i
+vconftool set -f -t int memory/bluetooth/device "0" -g 6520 -i
+vconftool set -f -t bool memory/bluetooth/btsco "0" -g 6520 -i
+vconftool set -f -t bool memory/bluetooth/dutmode "0" -g 6520 -i
+
-%post service
-mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
-ln -sf %{_libdir}/systemd/system/bluetooth-frwk.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+#%post service
+#mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+#ln -sf %{_libdir}/systemd/system/bluetooth-frwk.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
%postun -p /sbin/ldconfig
%defattr(-, root, root)
%{_libdir}/libbluetooth-api.so.*
%{_datadir}/license/bluetooth-frwk
-%{_libdir}/systemd/system/%{_servicedir}/bluetooth-frwk.service
-%{_libdir}/systemd/system/bluetooth-frwk.service
+#%{_libdir}/systemd/system/%{_servicedir}/bluetooth-frwk.service
+#%{_libdir}/systemd/system/bluetooth-frwk.service
%files devel
%defattr(-, root, root)
%files service
%manifest bluetooth-frwk.manifest
%defattr(-, root, root)
-%{_sysconfdir}/rc.d/init.d/bluetooth-frwk-service
%{_datadir}/dbus-1/system-services/org.projectx.bt.service
%{_bindir}/bt-service
+%{_unitdir_user}/bluetooth-frwk-service.service
+%{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
%{_bindir}/bluetooth-frwk-test
-%{_bindir}/bluetooth-gatt-test
-%{_bindir}/bluetooth-advertising-test
+#%{_bindir}/bluetooth-gatt-test
+#%{_bindir}/bluetooth-advertising-test
%{_varlibdir}/bluetooth
%{_prefix}/etc/bluetooth
-%attr(0666,-,-) %{_varlibdir}/bluetooth/auto-pair-blacklist
-%attr(0666,-,-) %{_prefix}/etc/bluetooth/stack_info
+#%attr(0666,-,-) %{_varlibdir}/bluetooth/auto-pair-blacklist
+#%attr(0666,-,-) %{_prefix}/etc/bluetooth/stack_info
%{_dumpdir}/bluetooth_log_dump.sh
%{_datadir}/license/bluetooth-frwk-service
+%if %{with bluetooth_frwk_libnotify} || %{with bluetooth_frwk_libnotification}
+%{_datadir}/icons/default/bt-icon.png
+%endif
%files core
%manifest bluetooth-frwk-core.manifest