From d2a9269b0aaa15ff8b22e1d383442a291ec0d5e2 Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Mon, 14 Mar 2016 17:11:26 +0900 Subject: [PATCH] Add wearable flags Change-Id: I8df90a948bb09dcb4e8dca1fdf9c14ff9ed0b3e4 Signed-off-by: DoHyun Pyun --- packaging/bluez.spec | 16 +++++++++++++++- tools/hciattach.c | 6 ++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/packaging/bluez.spec b/packaging/bluez.spec index 271137b..de7c1ea 100644 --- a/packaging/bluez.spec +++ b/packaging/bluez.spec @@ -101,6 +101,10 @@ export CFLAGS="${CFLAGS} -D__TIZEN_PATCH__ -DBLUEZ5_27_GATT_CLIENT" export CFLAGS="${CFLAGS} -D__TIZEN_PATCH__ -D__BROADCOM_PATCH__ -DBLUEZ5_27_GATT_CLIENT" %endif +%if "%{?profile}" == "wearable" +export CFLAGS="${CFLAGS} -D__BT_SCMST_FEATURE__ -DSUPPORT_SMS_ONLY -D__BROADCOM_QOS_PATCH__ -DTIZEN_WEARABLE" +%endif + export LDFLAGS=" -lncurses -Wl,--as-needed " export CFLAGS+=" -DPBAP_SIM_ENABLE" %reconfigure --disable-static \ @@ -131,7 +135,11 @@ export CFLAGS+=" -DPBAP_SIM_ENABLE" --enable-gatt \ --enable-experimental \ --enable-autopair=no \ +%if "%{?profile}" == "wearable" + --enable-wearable \ +%else --enable-network \ +%endif --enable-hid=yes \ --enable-tizenunusedplugin=no @@ -152,6 +160,12 @@ install --mode=0644 -D %{S:7} $RPM_BUILD_ROOT/%{_sysconfdir}/modprobe.d/50-bluet # no idea why this is suddenly necessary... install --mode 0755 -d $RPM_BUILD_ROOT/var/lib/bluetooth +%if "%{?profile}" == "wearable" +install -D -m 0644 src/main_w.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf +%else +install -D -m 0644 src/main_m.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf +%endif + #install -D -m 0644 src/bluetooth.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/bluetooth.conf #install -D -m 0644 profiles/audio/audio.conf %{buildroot}%{_sysconfdir}/bluetooth/audio.conf @@ -189,7 +203,7 @@ ln -sf bluetooth.service %{buildroot}%{_libpath}/systemd/system/dbus-org.bluez.s %defattr(-, root, root) %license COPYING #%{_sysconfdir}/bluetooth/audio.conf -#%{_sysconfdir}/bluetooth/main.conf +%{_sysconfdir}/bluetooth/main.conf #%{_sysconfdir}/bluetooth/network.conf #%{_sysconfdir}/bluetooth/rfcomm.conf #%{_sysconfdir}/dbus-1/system.d/bluetooth.conf diff --git a/tools/hciattach.c b/tools/hciattach.c index b3bb512..acfa3c7 100644 --- a/tools/hciattach.c +++ b/tools/hciattach.c @@ -1546,6 +1546,12 @@ int main(int argc, char *argv[]) dev[0] = 0; if (!strchr(opt, '/')) strcpy(dev, "/dev/"); + + if (strlen(opt) > PATH_MAX - (strlen(dev) + 1)) { + fprintf(stderr, "Invalid serial device\n"); + exit(1); + } + strcat(dev, opt); break; -- 2.7.4