+++ /dev/null
-<manifest>
- <define>
- <domain name="bt-core"/>
-
- <request>
- <smack request="dbus" type="rwx"/>
- <smack request="aul::launch" type="x"/>
- </request>
- <permit>
- <smack permit="dbus" type="rwx"/>
- </permit>
- </define>
- <assign>
- <filesystem path="/etc/init.d/bluetooth-frwk-core" label="_" exec_label="none" />
- <filesystem path="/usr/share/dbus-1/system-services/org.projectx.bt_core.service" label="_" exec_label="none" />
- <filesystem path="/usr/bin/bt-core" label="_" exec_label="none"/>
- </assign>
-
- <request>
- <domain name="bt-core"/>
- </request>
-</manifest>
+++ /dev/null
-<manifest>
- <define>
- <domain name="bt-frwk-test"/>
- <request>
- <smack request="bt-service::manager" type="w"/>
- <smack request="bt-service::admin" type="w"/>
- <smack request="bt-service::gap" type="w"/>
- </request>
- </define>
- <request>
- <domain name="bt-frwk-test"/>
- </request>
-</manifest>
<manifest>
- <define>
- <domain name="bt-service"/>
- <provide>
- <label name="bt-service::public"/>
- <label name="bt-service::platform"/>
- </provide>
- <request>
- <smack request="system::vconf" type="rwxat"/>
- <smack request="system::vconf_system" type="rw"/>
- <smack request="system::vconf_setting" type="rw"/>
- <smack request="system::share" type="rwxat"/>
- <smack request="system::ext_storage" type="rwxat"/>
- <smack request="system::media" type="rwxat"/>
- <smack request="system::homedir" type="rwxat"/>
- <smack request="dbus" type="rwx"/>
- <smack request="xorg" type="rwx"/>
- <smack request="device::app_logging" type="w"/>
- <smack request="syspopup::db" type="rwx"/>
- <smack request="device::dialout" type="rw"/>
- <smack request="sys-assert::core" type="rwxat"/>
- <smack request="alarm-server::alarm" type="w"/>
- <smack request="aul::launch" type="x"/>
- <smack request="connman::get" type="rwx"/>
- <smack request="connman::set" type="rwx"/>
- <smack request="connman::profile" type="rwx"/>
- <smack request="telephony_framework::api_ps_public" type="rw"/>
- <smack request="bt-service::public" type="w"/>
- <smack request="bt-service::platform" type="w"/>
- <smack request="tizen::vconf::platform::r" type="rw"/>
- <smack request="tizen::vconf::platform::rw" type="rw"/>
- <smack request="tizen::vconf::public::r::platform::rw" type="rw"/>
- </request>
- <permit>
- <smack permit="dbus" type="rx"/>
- </permit>
- </define>
- <assign>
- <filesystem path="/etc/init.d/bluetooth-frwk" label="_" exec_label="none" />
- <filesystem path="/usr/share/dbus-1/system-services/org.projectx.bt.service" label="_" exec_label="none" />
- <filesystem path="/opt/etc/dump.d/module.d/bluetooth_log_dump.sh" label="_" exec_label="none"/>
- <filesystem path="/usr/etc/bluetooth" label="_" exec_label="none"/>
- <filesystem path="/usr/etc/bluetooth/stack_info" label="_" exec_label="none"/>
- <filesystem path="/opt/var/lib/bluetooth" label="_" exec_label="none"/>
- </assign>
- <request>
- <domain name="bt-service"/>
- </request>
+ <request>
+ <domain name="_"/>
+ </request>
</manifest>
static DBusGConnection *system_conn = NULL;
static GDBusConnection *system_gdbus_conn = NULL;
-static char *cookie;
-static size_t cookie_size;
-
static guint bus_id;
static GDBusConnection *system_gconn = NULL;
{
int ret;
- _bt_destroy_cookie();
-
ret = _bt_deinit_event_handler();
if (ret != BLUETOOTH_ERROR_NONE) {
BT_ERR("Fail to deinit the event handler");
GArray **out_param1)
{
int result = BLUETOOTH_ERROR_NONE;
- char *cookie;
GError *error = NULL;
GArray *in_param5 = NULL;
// GArray *out_param2 = NULL;
in_param5 = g_array_new(TRUE, TRUE, sizeof(gchar));
- cookie = _bt_get_cookie();
-
- if (cookie) {
- g_array_append_vals(in_param5, cookie,
- _bt_get_cookie_size());
- }
-
param1 = g_variant_new_from_data((const GVariantType *)"ay",
in_param1->data, in_param1->len,
TRUE, NULL, NULL);
{
GArray* in_param5 = NULL;
bt_req_info_t *cb_data;
- char *cookie;
GDBusProxy *proxy;
int timeout;
in_param5 = g_array_new(TRUE, TRUE, sizeof(gchar));
- cookie = _bt_get_cookie();
-
- if (cookie) {
- g_array_append_vals(in_param5, cookie,
- _bt_get_cookie_size());
- }
param1 = g_variant_new_from_data((const GVariantType *)"ay",
in_param1->data, in_param1->len,
TRUE, NULL, NULL);
GDBusConnection *_bt_init_system_gdbus_conn(void);
-char *_bt_get_cookie(void);
-
-int _bt_get_cookie_size(void);
-
int _bt_register_osp_server_in_agent(int type, char *uuid, char *path, int fd);
int _bt_unregister_osp_server_in_agent(int type, char *uuid);
-void _bt_generate_cookie(void);
-
-void _bt_destroy_cookie(void);
-
int _bt_check_privilege(int service_type, int service_function);
GDBusConnection *_bt_gdbus_init_system_gconn(void);
MESSAGE("add -DTARGET")
ENDIF("${ARCH}" STREQUAL "arm")
+FIND_PROGRAM(DBUS_BINDING_TOOL NAMES dbus-binding-tool)
+EXEC_PROGRAM("${DBUS_BINDING_TOOL}" ARGS "--prefix=bt ${CMAKE_CURRENT_SOURCE_DIR}/bt-request-service.xml --mode=glib-client --output=${CMAKE_CURRENT_SOURCE_DIR}/include/bt-request-service.h")
+EXEC_PROGRAM("${DBUS_BINDING_TOOL}" ARGS "--prefix=bt_core ${CMAKE_CURRENT_SOURCE_DIR}/bt-core-adapter.xml --mode=glib-server --output=${CMAKE_CURRENT_SOURCE_DIR}/include/bt-core-adapter-method.h")
+
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS("-DVENDOR=\"${APP_VENDOR}\"")
ADD_DEFINITIONS("-DAPPNAME=\"${APP_NAME}\"")
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt_core.service DESTINATION share/dbus-1/system-services)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-core.conf DESTINATION /etc/dbus-1/system.d)
--- /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 user="root">
+ <allow own="org.projectx.bt_core"/>
+ </policy>
+ <policy at_console="true">
+ <allow send_destination="org.projectx.bt_core" />
+ </policy>
+ <policy context="default">
+ <allow send_destination="org.projectx.bt_core" />
+ </policy>
+</busconfig>
+
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
SET(PKG_MODULES
+ vconf
aul
vconf
libprivilege-control
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")
+ 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")
# 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)
+ 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})
+ 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)
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service.in ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service DESTINATION share/dbus-1/system-services)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
g_variant_get(val, "b" ,&powered);
BT_DBG("Powered = %d", powered);
if (powered == FALSE) {
+#ifdef TIZEN_TV
+ _bt_handle_adapter_removed();
+#else
if (vconf_get_int(VCONFKEY_BT_STATUS, &bt_state) == 0 &&
bt_state != VCONFKEY_BT_STATUS_OFF) {
_bt_disable_adapter();
}
+#endif
+
#ifdef ENABLE_TIZEN_2_4
if (vconf_get_int(VCONFKEY_BT_LE_STATUS, &bt_state) == 0 &&
bt_state != VCONFKEY_BT_LE_STATUS_OFF) {
}
#endif
}
+ else {
+#ifdef TIZEN_TV
+ _bt_handle_adapter_added();
+#endif
+ }
} else if (strcasecmp(property, "Connectable") == 0) {
gboolean connectable = FALSE;
static int __bt_init_obexd_receiver(void)
{
BT_DBG("+");
+#if 0
GError *error = NULL;
if (obexd_conn == NULL) {
obexd_conn = NULL;
return BLUETOOTH_ERROR_INTERNAL;
}
-
+#endif
BT_DBG("-");
return BLUETOOTH_ERROR_NONE;
BT_ERR("Fail to init cynara");
return EXIT_FAILURE;
}
-
+#if 0
#ifndef TIZEN_WEARABLE
if (perm_app_set_privilege("bluetooth-frwk-service", NULL, NULL) !=
PC_OPERATION_SUCCESS)
BT_ERR("Failed to set app privilege");
#endif
+#endif
/* Event reciever Init */
if (_bt_init_service_event_receiver() != BLUETOOTH_ERROR_NONE) {
BT_ERR("Fail to init event reciever");
--- /dev/null
+[D-BUS Service]
+Name=org.projectx.bt
+Exec=/bin/sh -c 'export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$UID/dbus/user_bus_socket; exec /usr/bin/bt-service'
+User=@TZ_SYS_DEFAULT_USER@
--- /dev/null
+[Unit]
+Description=Bluetooth service
+After=multi-user.target
+
+[Service]
+Type=dbus
+BusName=org.projectx.bt
+ExecStart=/usr/bin/bt-service
+Restart=always
+RestartSec=1
+KillMode=process
+
+[Install]
+WantedBy=starter.target
BuildRequires: pkgconfig(pkgmgr)
#BuildRequires: pkgconfig(journal)
#BuildRequires: pkgconfig(eventsystem)
-%if "%{?tizen_profile_name}" == "mobile"
+%if "%{?profile}" == "mobile"
BuildRequires: pkgconfig(capi-network-tethering)
%endif
+BuildRequires: cmake
BuildRequires: pkgconfig(libprivilege-control)
BuildRequires: pkgconfig(cynara-client)
BuildRequires: pkgconfig(cynara-creds-dbus)
-BuildRequires: cmake
-
-Requires(post): vconf
-Requires(postun): eglibc
+Requires(post): /usr/bin/vconftool
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
Requires: psmisc
%description
%prep
%setup -q
+cp %{SOURCE1001} .
%build
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"
+%if "%{?profile}" == "mobile"
+echo mobile
export CFLAGS="$CFLAGS -DTIZEN_NETWORK_TETHERING_ENABLE -DTIZEN_BT_FLIGHTMODE_ENABLED"
%endif
-%if "%{?tizen_profile_name}" == "wearable"
+%if "%{?profile}" == "wearable"
+echo wearable
export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
-%define _servicefile packaging/bluetooth-frwk-wearable.service
-%define _servicedir multi-user.target.wants
-%else
-%define _servicefile packaging/bluetooth-frwk-mobile.service
-%define _servicedir graphical.target.wants
%endif
-%define _servicedir multi-user.target.wants
+
+%if "%{?profile}" == "tv"
+echo tv
+export CFLAGS="$CFLAGS -DUSB_BLUETOOTH"
+%endif
%ifarch x86_64
export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
+export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
+%else
+export CFLAGS="$CFLAGS -fpie -DRFCOMM_DIRECT "
+export LDFLAGS="$CFLAGS -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
%endif
%ifarch aarch64
export CFLAGS="$CFLAGS -D__TIZEN_MOBILE__ -DTIZEN_TELEPHONY_ENABLED"
%endif
-
cmake . -DCMAKE_INSTALL_PREFIX=/usr \
-DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
-DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
make
%cmake \
-%if "%{?tizen_profile_name}" == "wearable"
+%if "%{?profile}" == "wearable"
-DTIZEN_WEARABLE=YES \
%else
-DTIZEN_WEARABLE=NO \
%endif
-%if "%{?tizen_profile_name}" == "common"
+%if "%{?profile}" == "common"
-DTIZEN_WEARABLE=NO \
%endif
-
%install
rm -rf %{buildroot}
%make_install
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
%post
/sbin/ldconfig
-%if "%{?tizen_profile_name}" == "wearable"
+%if "%{?profile}" == "wearable"
vconftool set -f -t int db/bluetooth/status "1" -g 6520
%endif
-%if "%{?tizen_profile_name}" == "mobile"
+%if "%{?profile}" == "mobile"
vconftool set -f -t int db/bluetooth/status "0" -g 6520
%endif
-%if "%{?tizen_profile_name}" == "common"
+%if "%{?profile}" == "common"
vconftool set -f -t int db/bluetooth/status "0" -g 6520
%endif
#%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/
+#ln -sf %{_unitdir_user}/bluetooth-frwk.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
%postun -p /sbin/ldconfig
%files
+%manifest %{name}.manifest
%defattr(-, root, root)
%{_libdir}/libbluetooth-api.so.*
%{_datadir}/license/bluetooth-frwk
%{_datadir}/license/bluetooth-frwk-devel
%files service
-%manifest bluetooth-frwk.manifest
+%manifest %{name}.manifest
%defattr(-, root, root)
%{_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
%{_prefix}/etc/bluetooth
#%attr(0666,-,-) %{_varlibdir}/bluetooth/auto-pair-blacklist
#%attr(0666,-,-) %{_prefix}/etc/bluetooth/stack_info
-%{_dumpdir}/bluetooth_log_dump.sh
+#%{_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
+%manifest %{name}.manifest
%defattr(-, root, root)
%{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
%{_bindir}/bt-core
+%{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
%files test
-%manifest bluetooth-frwk-test.manifest
+%manifest %{name}.manifest
%defattr(-, root, root)
%{_bindir}/bluetooth-frwk-test
%{_bindir}/bluetooth-gatt-test