Add wearable flags 83/62083/1 accepted/tizen/common/20160315.221419 accepted/tizen/ivi/20160315.120158 accepted/tizen/mobile/20160315.120101 accepted/tizen/tv/20160315.120118 accepted/tizen/wearable/20160315.120135 submit/tizen/20160315.014600
authorDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 14 Mar 2016 08:11:26 +0000 (17:11 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 14 Mar 2016 08:11:26 +0000 (17:11 +0900)
Change-Id: I8df90a948bb09dcb4e8dca1fdf9c14ff9ed0b3e4
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
packaging/bluez.spec
tools/hciattach.c

index 271137b..de7c1ea 100644 (file)
@@ -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
index b3bb512..acfa3c7 100644 (file)
@@ -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;