* [PATCHv5 7/7] build: Add logging system
From: Andrei Emeltchenko @ 2013-10-04 10:54 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1380884056-27808-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Frederic Danis <frederic.danis@linux.intel.com>
---
Makefile.android | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile.android b/Makefile.android
index e792c10..e161e6d 100644
--- a/Makefile.android
+++ b/Makefile.android
@@ -1,8 +1,8 @@
if ANDROID
noinst_PROGRAMS += android/bluetoothd
-android_bluetoothd_SOURCES = android/main.c
+android_bluetoothd_SOURCES = android/main.c src/log.c
android_bluetoothd_LDADD = @GLIB_LIBS@
endif
-EXTRA_DIST += android/Android.mk
+EXTRA_DIST += android/Android.mk android/log.c
--
1.7.10.4
^ permalink raw reply related
* [PATCHv5 6/7] android-build: Add logging system
From: Andrei Emeltchenko @ 2013-10-04 10:54 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1380884056-27808-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Frederic Danis <frederic.danis@linux.intel.com>
---
android/Android.mk | 2 ++
1 file changed, 2 insertions(+)
diff --git a/android/Android.mk b/android/Android.mk
index fc3d6c2..ec820ac 100644
--- a/android/Android.mk
+++ b/android/Android.mk
@@ -14,10 +14,12 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
main.c \
+ log.c \
LOCAL_C_INCLUDES := \
$(call include-path-for, glib) \
$(call include-path-for, glib)/glib \
+ $(LOCAL_PATH)/../src \
LOCAL_CFLAGS := -DVERSION=\"$(BLUEZ_VERSION)\"
--
1.7.10.4
^ permalink raw reply related
* [PATCHv5 5/7] android: Android version of log.c
From: Andrei Emeltchenko @ 2013-10-04 10:54 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1380884056-27808-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Frederic Danis <frederic.danis@linux.intel.com>
---
android/log.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
android/main.c | 6 +++++
2 files changed, 88 insertions(+)
create mode 100644 android/log.c
diff --git a/android/log.c b/android/log.c
new file mode 100644
index 0000000..31b33d9
--- /dev/null
+++ b/android/log.c
@@ -0,0 +1,82 @@
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <unistd.h>
+#include <sys/uio.h>
+
+#include <glib.h>
+
+void info(const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+
+ vfprintf(stderr, format, ap);
+ fprintf(stderr, "\n");
+
+ va_end(ap);
+}
+
+void warn(const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+
+ vfprintf(stderr, format, ap);
+ fprintf(stderr, "\n");
+
+ va_end(ap);
+}
+
+void error(const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+
+ vfprintf(stderr, format, ap);
+ fprintf(stderr, "\n");
+
+ va_end(ap);
+}
+
+void btd_debug(const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+
+ vfprintf(stderr, format, ap);
+ fprintf(stderr, "\n");
+
+ va_end(ap);
+}
diff --git a/android/main.c b/android/main.c
index 1dba2d4..f88c115 100644
--- a/android/main.c
+++ b/android/main.c
@@ -34,6 +34,8 @@
#include <glib.h>
+#include "log.h"
+
#define SHUTDOWN_GRACE_SECONDS 10
static GMainLoop *event_loop;
@@ -102,9 +104,13 @@ int main(int argc, char *argv[])
sigaction(SIGINT, &sa, NULL);
sigaction(SIGTERM, &sa, NULL);
+ DBG("Entering main loop");
+
g_main_loop_run(event_loop);
g_main_loop_unref(event_loop);
+ info("Exit");
+
return EXIT_SUCCESS;
}
--
1.7.10.4
^ permalink raw reply related
* [PATCHv5 4/7] build: Add BlueZ Android daemon
From: Andrei Emeltchenko @ 2013-10-04 10:54 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1380884056-27808-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Frederic Danis <frederic.danis@linux.intel.com>
---
.gitignore | 2 ++
Makefile.android | 7 +++++++
2 files changed, 9 insertions(+)
diff --git a/.gitignore b/.gitignore
index 8a25a3e..3707209 100644
--- a/.gitignore
+++ b/.gitignore
@@ -98,3 +98,5 @@ unit/test-gobex-packet
unit/test-gobex-transfer
unit/test-*.log
unit/test-*.trs
+
+android/bluetoothd
diff --git a/Makefile.android b/Makefile.android
index 56fa9a7..e792c10 100644
--- a/Makefile.android
+++ b/Makefile.android
@@ -1 +1,8 @@
+if ANDROID
+noinst_PROGRAMS += android/bluetoothd
+
+android_bluetoothd_SOURCES = android/main.c
+android_bluetoothd_LDADD = @GLIB_LIBS@
+endif
+
EXTRA_DIST += android/Android.mk
--
1.7.10.4
^ permalink raw reply related
* [PATCHv5 3/7] android-build: Add BlueZ Android daemon
From: Andrei Emeltchenko @ 2013-10-04 10:54 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1380884056-27808-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Frederic Danis <frederic.danis@linux.intel.com>
Define local mapping to glib path, otherwise this has to be inside central
place in the build repository.
---
android/Android.mk | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/android/Android.mk b/android/Android.mk
index 183f7e2..fc3d6c2 100644
--- a/android/Android.mk
+++ b/android/Android.mk
@@ -2,3 +2,28 @@ LOCAL_PATH := $(call my-dir)
# Retrieve BlueZ version from configure.ac file
BLUEZ_VERSION := $(shell grep ^AC_INIT $(LOCAL_PATH)/../configure.ac | cpp -P -D'AC_INIT(_,v)=v')
+
+# Specify pathmap for glib
+pathmap_INCL += glib:external/bluetooth/glib
+
+#
+# Android BlueZ daemon (bluetoothd)
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ main.c \
+
+LOCAL_C_INCLUDES := \
+ $(call include-path-for, glib) \
+ $(call include-path-for, glib)/glib \
+
+LOCAL_CFLAGS := -DVERSION=\"$(BLUEZ_VERSION)\"
+
+LOCAL_SHARED_LIBRARIES := \
+ libglib \
+
+LOCAL_MODULE := bluetoothd
+
+include $(BUILD_EXECUTABLE)
--
1.7.10.4
^ permalink raw reply related
* [PATCHv5 2/7] android: Add skeleton of BlueZ Android daemon
From: Andrei Emeltchenko @ 2013-10-04 10:54 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1380884056-27808-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Frederic Danis <frederic.danis@linux.intel.com>
---
android/main.c | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 110 insertions(+)
create mode 100644 android/main.c
diff --git a/android/main.c b/android/main.c
new file mode 100644
index 0000000..1dba2d4
--- /dev/null
+++ b/android/main.c
@@ -0,0 +1,110 @@
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <signal.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+
+#include <glib.h>
+
+#define SHUTDOWN_GRACE_SECONDS 10
+
+static GMainLoop *event_loop;
+
+static gboolean quit_eventloop(gpointer user_data)
+{
+ g_main_loop_quit(event_loop);
+
+ return FALSE;
+}
+
+static void sig_term(int sig)
+{
+ static bool __terminated = false;
+
+ if (!__terminated) {
+ g_timeout_add_seconds(SHUTDOWN_GRACE_SECONDS,
+ quit_eventloop, NULL);
+ }
+
+ __terminated = true;
+}
+
+static gboolean option_detach = TRUE;
+static gboolean option_version = FALSE;
+
+static GOptionEntry options[] = {
+ { "nodetach", 'n', G_OPTION_FLAG_REVERSE,
+ G_OPTION_ARG_NONE, &option_detach,
+ "Run with logging in foreground", NULL },
+ { "version", 'v', 0, G_OPTION_ARG_NONE, &option_version,
+ "Show version information and exit", NULL },
+ { NULL }
+};
+
+int main(int argc, char *argv[])
+{
+ GOptionContext *context;
+ GError *err = NULL;
+ struct sigaction sa;
+
+ context = g_option_context_new(NULL);
+ g_option_context_add_main_entries(context, options, NULL);
+
+ if (g_option_context_parse(context, &argc, &argv, &err) == FALSE) {
+ if (err != NULL) {
+ g_printerr("%s\n", err->message);
+ g_error_free(err);
+ } else
+ g_printerr("An unknown error occurred\n");
+
+ exit(EXIT_FAILURE);
+ }
+
+ g_option_context_free(context);
+
+ if (option_version == TRUE) {
+ printf("%s\n", VERSION);
+ exit(EXIT_SUCCESS);
+ }
+
+ event_loop = g_main_loop_new(NULL, FALSE);
+
+ memset(&sa, 0, sizeof(sa));
+ sa.sa_handler = sig_term;
+ sigaction(SIGINT, &sa, NULL);
+ sigaction(SIGTERM, &sa, NULL);
+
+ g_main_loop_run(event_loop);
+
+ g_main_loop_unref(event_loop);
+
+ return EXIT_SUCCESS;
+}
--
1.7.10.4
^ permalink raw reply related
* [PATCHv5 1/7] build: Add skeleton for BlueZ Android
From: Andrei Emeltchenko @ 2013-10-04 10:54 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1380884056-27808-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Frederic Danis <frederic.danis@linux.intel.com>
Retrieve Bluetooth version from configure.ac.
---
Makefile.am | 4 +++-
Makefile.android | 1 +
android/Android.mk | 4 ++++
bootstrap-configure | 1 +
configure.ac | 5 +++++
5 files changed, 14 insertions(+), 1 deletion(-)
create mode 100644 Makefile.android
create mode 100644 android/Android.mk
diff --git a/Makefile.am b/Makefile.am
index 4e4b1c5..51204f4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -179,6 +179,7 @@ test_scripts =
include Makefile.tools
include Makefile.obexd
+include Makefile.android
if HID2HCI
rulesdir = @UDEV_DIR@/rules.d
@@ -293,7 +294,8 @@ pkgconfig_DATA = lib/bluez.pc
endif
DISTCHECK_CONFIGURE_FLAGS = --disable-datafiles --enable-library \
- --disable-systemd --disable-udev
+ --disable-systemd --disable-udev \
+ --enable-android
DISTCLEANFILES = $(pkgconfig_DATA)
diff --git a/Makefile.android b/Makefile.android
new file mode 100644
index 0000000..56fa9a7
--- /dev/null
+++ b/Makefile.android
@@ -0,0 +1 @@
+EXTRA_DIST += android/Android.mk
diff --git a/android/Android.mk b/android/Android.mk
new file mode 100644
index 0000000..183f7e2
--- /dev/null
+++ b/android/Android.mk
@@ -0,0 +1,4 @@
+LOCAL_PATH := $(call my-dir)
+
+# Retrieve BlueZ version from configure.ac file
+BLUEZ_VERSION := $(shell grep ^AC_INIT $(LOCAL_PATH)/../configure.ac | cpp -P -D'AC_INIT(_,v)=v')
diff --git a/bootstrap-configure b/bootstrap-configure
index 7a6e7d1..dc36311 100755
--- a/bootstrap-configure
+++ b/bootstrap-configure
@@ -12,4 +12,5 @@ fi
--sysconfdir=/etc \
--localstatedir=/var \
--enable-experimental \
+ --enable-android \
--disable-datafiles $*
diff --git a/configure.ac b/configure.ac
index 41c2935..7b1f64a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -242,4 +242,9 @@ AC_DEFINE_UNQUOTED(CONFIGDIR, "${configdir}",
[Directory for the configuration files])
AC_SUBST(CONFIGDIR, "${configdir}")
+AC_ARG_ENABLE(android, AC_HELP_STRING([--enable-android],
+ [enable BlueZ for Android]),
+ [enable_android=${enableval}])
+AM_CONDITIONAL(ANDROID, test "${enable_android}" = "yes")
+
AC_OUTPUT(Makefile src/bluetoothd.8 lib/bluez.pc)
--
1.7.10.4
^ permalink raw reply related
* [PATCHv5 0/7] Initial skeleton
From: Andrei Emeltchenko @ 2013-10-04 10:54 UTC (permalink / raw)
To: linux-bluetooth
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Those are modified patches from Frederic Danis.
Changes:
* log is now printed to stderr
Frederic Danis (7):
build: Add skeleton for BlueZ Android
android: Add skeleton of BlueZ Android daemon
android-build: Add BlueZ Android daemon
build: Add BlueZ Android daemon
android: Android version of log.c
android-build: Add logging system
build: Add logging system
.gitignore | 2 +
Makefile.am | 4 +-
Makefile.android | 8 ++++
android/Android.mk | 31 ++++++++++++++
android/log.c | 82 ++++++++++++++++++++++++++++++++++++
android/main.c | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++
bootstrap-configure | 1 +
configure.ac | 5 +++
8 files changed, 248 insertions(+), 1 deletion(-)
create mode 100644 Makefile.android
create mode 100644 android/Android.mk
create mode 100644 android/log.c
create mode 100644 android/main.c
--
1.7.10.4
^ permalink raw reply
* [PATCH 2/2] Bluetooth: Add management command for setting LE scan parameters
From: Marcel Holtmann @ 2013-10-04 10:19 UTC (permalink / raw)
To: linux-bluetooth
The scan interval and window parameters are used for LE passive
background scanning and connection establishment. This allows
userspace to change the values.
These two values should be kept in sync with whatever is used for
the scan parameters service on remote devices. And it puts the
controlling daemon (for example bluetoothd) in charge of setting
the values.
Main use case would be to switch between two sets of values. One
for foreground applications and one for background applications.
At this moment, the values are only used for manual connection
establishment, but soon that should be extended to background
scanning and automatic connection establishment.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
include/net/bluetooth/mgmt.h | 7 +++++++
net/bluetooth/mgmt.c | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 45 insertions(+)
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 2ad433bb..518c5c8 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -362,6 +362,13 @@ struct mgmt_cp_set_static_address {
} __packed;
#define MGMT_SET_STATIC_ADDRESS_SIZE 6
+#define MGMT_OP_SET_SCAN_PARAMS 0x002C
+struct mgmt_cp_set_scan_params {
+ __le16 interval;
+ __le16 window;
+} __packed;
+#define MGMT_SET_SCAN_PARAMS_SIZE 4
+
#define MGMT_EV_CMD_COMPLETE 0x0001
struct mgmt_ev_cmd_complete {
__le16 opcode;
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 16125ff9..2af2f4f 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -3322,6 +3322,43 @@ static int set_static_address(struct sock *sk, struct hci_dev *hdev,
return err;
}
+static int set_scan_params(struct sock *sk, struct hci_dev *hdev,
+ void *data, u16 len)
+{
+ struct mgmt_cp_set_scan_params *cp = data;
+ __u16 interval, window;
+ int err;
+
+ BT_DBG("%s", hdev->name);
+
+ if (!lmp_le_capable(hdev))
+ return cmd_status(sk, hdev->id, MGMT_OP_SET_SCAN_PARAMS,
+ MGMT_STATUS_NOT_SUPPORTED);
+
+ interval = __le16_to_cpu(cp->interval);
+
+ if (interval < 0x0004 || interval > 0x4000)
+ return cmd_status(sk, hdev->id, MGMT_OP_SET_SCAN_PARAMS,
+ MGMT_STATUS_INVALID_PARAMS);
+
+ window = __le16_to_cpu(cp->window);
+
+ if (window < 0x0004 || window > 0x4000)
+ return cmd_status(sk, hdev->id, MGMT_OP_SET_SCAN_PARAMS,
+ MGMT_STATUS_INVALID_PARAMS);
+
+ hci_dev_lock(hdev);
+
+ hdev->le_scan_interval = interval;
+ hdev->le_scan_window = window;
+
+ err = cmd_complete(sk, hdev->id, MGMT_OP_SET_SCAN_PARAMS, 0, NULL, 0);
+
+ hci_dev_unlock(hdev);
+
+ return err;
+}
+
static void fast_connectable_complete(struct hci_dev *hdev, u8 status)
{
struct pending_cmd *cmd;
@@ -3658,6 +3695,7 @@ static const struct mgmt_handler {
{ set_advertising, false, MGMT_SETTING_SIZE },
{ set_bredr, false, MGMT_SETTING_SIZE },
{ set_static_address, false, MGMT_SET_STATIC_ADDRESS_SIZE },
+ { set_scan_params, false, MGMT_SET_SCAN_PARAMS_SIZE },
};
--
1.8.3.1
^ permalink raw reply related
* [PATCH 1/2] Bluetooth: Make LE scan interval and window a controller option
From: Marcel Holtmann @ 2013-10-04 10:19 UTC (permalink / raw)
To: linux-bluetooth
The scan interval and window for LE passive scanning and connection
establishment should be configurable on a per controller basis. So
introduce a setting that later on will allow modifying it.
This setting does not affect LE active scanning during device
discovery phase. As long as that phase uses interleaved discovery,
it will will continuously scan.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
include/net/bluetooth/hci_core.h | 2 ++
net/bluetooth/hci_conn.c | 4 ++--
net/bluetooth/hci_core.c | 3 +++
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index e09c305..7442ece 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -164,6 +164,8 @@ struct hci_dev {
__u16 page_scan_interval;
__u16 page_scan_window;
__u8 page_scan_type;
+ __u16 le_scan_interval;
+ __u16 le_scan_window;
__u16 devid_source;
__u16 devid_vendor;
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 08e601c..c5b115e 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -55,8 +55,8 @@ static void hci_le_create_connection(struct hci_conn *conn)
struct hci_cp_le_create_conn cp;
memset(&cp, 0, sizeof(cp));
- cp.scan_interval = __constant_cpu_to_le16(0x0060);
- cp.scan_window = __constant_cpu_to_le16(0x0030);
+ cp.scan_interval = cpu_to_le16(hdev->le_scan_interval);
+ cp.scan_window = cpu_to_le16(hdev->le_scan_window);
bacpy(&cp.peer_addr, &conn->dst);
cp.peer_addr_type = conn->dst_type;
cp.conn_interval_min = __constant_cpu_to_le16(0x0028);
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 82dbdc6..6c2eff0 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2223,6 +2223,9 @@ struct hci_dev *hci_alloc_dev(void)
hdev->sniff_max_interval = 800;
hdev->sniff_min_interval = 80;
+ hdev->le_scan_interval = 0x0060;
+ hdev->le_scan_window = 0x0030;
+
mutex_init(&hdev->lock);
mutex_init(&hdev->req_lock);
--
1.8.3.1
^ permalink raw reply related
* [PATCH 14/14] build-sys: Add missing $(AM_CFLAGS) to obexd_src_obexd_CFLAGS
From: Szymon Janc @ 2013-10-04 9:05 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1380877538-22614-1-git-send-email-szymon.janc@tieto.com>
This fix not passing extra build flags when --enable-maintainer-mode
is used.
---
Makefile.obexd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.obexd b/Makefile.obexd
index d5377cb..2d4f10d 100644
--- a/Makefile.obexd
+++ b/Makefile.obexd
@@ -85,7 +85,7 @@ obexd_src_obexd_LDADD = lib/libbluetooth-internal.la \
obexd_src_obexd_LDFLAGS = -Wl,--export-dynamic
-obexd_src_obexd_CFLAGS = @GLIB_CFLAGS@ @DBUS_CFLAGS@ @ICAL_CFLAGS@ \
+obexd_src_obexd_CFLAGS = $(AM_CFLAGS) @GLIB_CFLAGS@ @DBUS_CFLAGS@ @ICAL_CFLAGS@ \
-DOBEX_PLUGIN_BUILTIN \
-DPLUGINDIR=\""$(obex_plugindir)"\" \
-fPIC -D_FILE_OFFSET_BITS=64
--
1.8.4
^ permalink raw reply related
* [PATCH 13/14] obexd/MAP: Fix protected property value
From: Szymon Janc @ 2013-10-04 9:05 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1380877538-22614-1-git-send-email-szymon.janc@tieto.com>
"Sent" flag value was returned instead of "Protected" one.
This also fix following build error:
CC obexd/client/obexd-map.o
obexd/client/map.c:711:17: error: ‘get_protected’ defined but not
used [-Werror=unused-function]
cc1: all warnings being treated as errors
---
obexd/client/map.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/obexd/client/map.c b/obexd/client/map.c
index 801d715..4373d74 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -814,7 +814,7 @@ static const GDBusPropertyTable map_msg_properties[] = {
{ "Priority", "b", get_priority },
{ "Read", "b", get_read, set_read },
{ "Sent", "b", get_sent },
- { "Protected", "b", get_sent },
+ { "Protected", "b", get_protected },
{ "Deleted", "b", NULL, set_deleted },
{ }
};
--
1.8.4
^ permalink raw reply related
* [PATCH 12/14] obexd/client: Remove unused static functions
From: Szymon Janc @ 2013-10-04 9:05 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1380877538-22614-1-git-send-email-szymon.janc@tieto.com>
This fix following build error:
CC obexd/client/obexd-dbus.o
obexd/client/dbus.c:70:13: error: ‘append_array_variant’ defined but
not used [-Werror=unused-function]
obexd/client/dbus.c:97:13: error: ‘append_dict_variant’ defined but
not used [-Werror=unused-function]
---
obexd/client/dbus.c | 81 -----------------------------------------------------
1 file changed, 81 deletions(-)
diff --git a/obexd/client/dbus.c b/obexd/client/dbus.c
index d635a45..243af59 100644
--- a/obexd/client/dbus.c
+++ b/obexd/client/dbus.c
@@ -67,87 +67,6 @@ void obex_dbus_dict_append(DBusMessageIter *dict,
dbus_message_iter_close_container(dict, &keyiter);
}
-static void append_array_variant(DBusMessageIter *iter, int type, void *val)
-{
- DBusMessageIter variant, array;
- char typesig[2];
- char arraysig[3];
- const char **str_array = *(const char ***) val;
- int i;
-
- arraysig[0] = DBUS_TYPE_ARRAY;
- arraysig[1] = typesig[0] = type;
- arraysig[2] = typesig[1] = '\0';
-
- dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT,
- arraysig, &variant);
-
- dbus_message_iter_open_container(&variant, DBUS_TYPE_ARRAY,
- typesig, &array);
-
- for (i = 0; str_array[i]; i++)
- dbus_message_iter_append_basic(&array, type,
- &(str_array[i]));
-
- dbus_message_iter_close_container(&variant, &array);
-
- dbus_message_iter_close_container(iter, &variant);
-}
-
-static void append_dict_variant(DBusMessageIter *iter, int type, void *val)
-{
- DBusMessageIter variant, array, entry;
- char typesig[5];
- char arraysig[6];
- const void **val_array = *(const void ***) val;
- int i;
-
- arraysig[0] = DBUS_TYPE_ARRAY;
- arraysig[1] = typesig[0] = DBUS_DICT_ENTRY_BEGIN_CHAR;
- arraysig[2] = typesig[1] = DBUS_TYPE_STRING;
- arraysig[3] = typesig[2] = type;
- arraysig[4] = typesig[3] = DBUS_DICT_ENTRY_END_CHAR;
- arraysig[5] = typesig[4] = '\0';
-
- dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT,
- arraysig, &variant);
-
- dbus_message_iter_open_container(&variant, DBUS_TYPE_ARRAY,
- typesig, &array);
-
- for (i = 0; val_array[i]; i += 2) {
- dbus_message_iter_open_container(&array, DBUS_TYPE_DICT_ENTRY,
- NULL, &entry);
-
- dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING,
- &(val_array[i + 0]));
-
- /*
- * D-Bus expects a char** or uint8* depending on the type
- * given. Since we are dealing with an array through a void**
- * (and thus val_array[i] is a pointer) we need to
- * differentiate DBUS_TYPE_STRING from the others. The other
- * option would be the user to pass the exact type to this
- * function, instead of a pointer to it. However in this case
- * a cast from type to void* would be needed, which is not
- * good.
- */
- if (type == DBUS_TYPE_STRING) {
- dbus_message_iter_append_basic(&entry, type,
- &(val_array[i + 1]));
- } else {
- dbus_message_iter_append_basic(&entry, type,
- val_array[i + 1]);
- }
-
- dbus_message_iter_close_container(&array, &entry);
- }
-
- dbus_message_iter_close_container(&variant, &array);
-
- dbus_message_iter_close_container(iter, &variant);
-}
-
int obex_dbus_signal_property_changed(DBusConnection *conn,
const char *path,
const char *interface,
--
1.8.4
^ permalink raw reply related
* [PATCH 11/14] client/transfer: Return "error" for unknown status in status2str
From: Szymon Janc @ 2013-10-04 9:05 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1380877538-22614-1-git-send-email-szymon.janc@tieto.com>
This can happen only if there is a bug in obexd code.
This fix following build error:
CC obexd/client/obexd-transfer.o
obexd/client/transfer.c: In function ‘status2str’:
obexd/client/transfer.c:277:1: error: control reaches end of non-void
function [-Werror=return-type]
---
obexd/client/transfer.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/obexd/client/transfer.c b/obexd/client/transfer.c
index 99a17e9..5a8d4f2 100644
--- a/obexd/client/transfer.c
+++ b/obexd/client/transfer.c
@@ -272,6 +272,7 @@ static const char *status2str(uint8_t status)
case TRANSFER_STATUS_COMPLETE:
return "complete";
case TRANSFER_STATUS_ERROR:
+ default:
return "error";
}
}
--
1.8.4
^ permalink raw reply related
* [PATCH 10/14] obexd/MAP: Fix missing include
From: Szymon Janc @ 2013-10-04 9:05 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1380877538-22614-1-git-send-email-szymon.janc@tieto.com>
This fix following build error:
CC obexd/client/obexd-map.o
obexd/client/map.c: In function ‘msg_element’:
obexd/client/map.c:1113:2: error: implicit declaration of function ‘strtoull’ [-Werror=implicit-function-declaration]
---
obexd/client/map.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/obexd/client/map.c b/obexd/client/map.c
index fe15bab..801d715 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdbool.h>
#include <inttypes.h>
+#include <stdlib.h>
#include <glib.h>
#include <gdbus/gdbus.h>
#include <gobex/gobex-apparam.h>
--
1.8.4
^ permalink raw reply related
* [PATCH 09/14] obexd/service: Remove unused local variable
From: Szymon Janc @ 2013-10-04 9:05 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1380877538-22614-1-git-send-email-szymon.janc@tieto.com>
This fix following build error:
CC obexd/src/obexd-service.o
obexd/src/service.c: In function ‘obex_service_driver_register’:
obexd/src/service.c:100:10: error: unused variable ‘l’ [-Werror=unused-variable]
---
obexd/src/service.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/obexd/src/service.c b/obexd/src/service.c
index 6b8533b..c088535 100644
--- a/obexd/src/service.c
+++ b/obexd/src/service.c
@@ -97,8 +97,6 @@ static struct obex_service_driver *find_driver(uint16_t service)
int obex_service_driver_register(struct obex_service_driver *driver)
{
- GSList *l;
-
if (!driver) {
error("Invalid driver");
return -EINVAL;
--
1.8.4
^ permalink raw reply related
* [PATCH 08/14] obexd: Return "error" for unknown status in status2str
From: Szymon Janc @ 2013-10-04 9:05 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1380877538-22614-1-git-send-email-szymon.janc@tieto.com>
This can happend only if there is a bug in obexd code.
This fix following buld error:
CC obexd/src/obexd-manager.o
obexd/src/manager.c: In function ‘status2str’:
obexd/src/manager.c:292:1: error: control reaches end of non-void
function [-Werror=return-type]
---
obexd/src/manager.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/obexd/src/manager.c b/obexd/src/manager.c
index 00f3537..cec8a39 100644
--- a/obexd/src/manager.c
+++ b/obexd/src/manager.c
@@ -287,6 +287,7 @@ static const char *status2str(uint8_t status)
case TRANSFER_STATUS_COMPLETE:
return "complete";
case TRANSFER_STATUS_ERROR:
+ default:
return "error";
}
}
--
1.8.4
^ permalink raw reply related
* [PATCH 07/14] obexd: Remove unused local variables
From: Szymon Janc @ 2013-10-04 9:05 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1380877538-22614-1-git-send-email-szymon.janc@tieto.com>
This fix following build errors:
obexd/src/manager.c: In function ‘get_root’:
obexd/src/manager.c:253:23: error: unused variable ‘os’
[-Werror=unused-variable]
obexd/src/manager.c: In function ‘manager_emit_transfer_started’:
obexd/src/manager.c:534:22: error: unused variable ‘id’
[-Werror=unused-variable]
obexd/src/manager.c: In function ‘manager_request_authorization’:
obexd/src/manager.c:684:14: error: unused variable ‘type’
[-Werror=unused-variable]
obexd/src/manager.c:683:14: error: unused variable ‘filename’
[-Werror=unused-variable]
---
obexd/src/manager.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/obexd/src/manager.c b/obexd/src/manager.c
index a67838c..00f3537 100644
--- a/obexd/src/manager.c
+++ b/obexd/src/manager.c
@@ -250,7 +250,6 @@ static gboolean get_target(const GDBusPropertyTable *property,
static gboolean get_root(const GDBusPropertyTable *property,
DBusMessageIter *iter, void *data)
{
- struct obex_session *os = data;
const char *root;
root = obex_option_root_folder();
@@ -531,8 +530,6 @@ void manager_cleanup(void)
void manager_emit_transfer_started(struct obex_transfer *transfer)
{
- static unsigned int id = 0;
-
transfer->status = TRANSFER_STATUS_ACTIVE;
g_dbus_emit_property_changed(connection, transfer->path,
@@ -680,8 +677,6 @@ int manager_request_authorization(struct obex_transfer *transfer, int32_t time,
struct obex_session *os = transfer->session;
DBusMessage *msg;
DBusPendingCall *call;
- const char *filename = os->name ? os->name : "";
- const char *type = os->type ? os->type : "";
unsigned int watch;
gboolean got_reply;
--
1.8.4
^ permalink raw reply related
* [PATCH 06/14] obexd: Remove unused static functions
From: Szymon Janc @ 2013-10-04 9:05 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1380877538-22614-1-git-send-email-szymon.janc@tieto.com>
This fix following build error:
obexd/src/manager.c: At top level:
obexd/src/manager.c:190:13: error:
‘dbus_message_iter_append_dict_entry’ defined but not used
[-Werror=unused-function]
---
obexd/src/manager.c | 75 -----------------------------------------------------
1 file changed, 75 deletions(-)
diff --git a/obexd/src/manager.c b/obexd/src/manager.c
index f64b7b9..a67838c 100644
--- a/obexd/src/manager.c
+++ b/obexd/src/manager.c
@@ -127,81 +127,6 @@ static inline DBusMessage *not_authorized(DBusMessage *msg)
"Not authorized");
}
-static void dbus_message_iter_append_variant(DBusMessageIter *iter,
- int type, void *val)
-{
- DBusMessageIter value;
- DBusMessageIter array;
- const char *sig;
-
- switch (type) {
- case DBUS_TYPE_STRING:
- sig = DBUS_TYPE_STRING_AS_STRING;
- break;
- case DBUS_TYPE_BYTE:
- sig = DBUS_TYPE_BYTE_AS_STRING;
- break;
- case DBUS_TYPE_INT16:
- sig = DBUS_TYPE_INT16_AS_STRING;
- break;
- case DBUS_TYPE_UINT16:
- sig = DBUS_TYPE_UINT16_AS_STRING;
- break;
- case DBUS_TYPE_INT32:
- sig = DBUS_TYPE_INT32_AS_STRING;
- break;
- case DBUS_TYPE_UINT32:
- sig = DBUS_TYPE_UINT32_AS_STRING;
- break;
- case DBUS_TYPE_BOOLEAN:
- sig = DBUS_TYPE_BOOLEAN_AS_STRING;
- break;
- case DBUS_TYPE_ARRAY:
- sig = DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_STRING_AS_STRING;
- break;
- case DBUS_TYPE_OBJECT_PATH:
- sig = DBUS_TYPE_OBJECT_PATH_AS_STRING;
- break;
- default:
- error("Could not append variant with type %d", type);
- return;
- }
-
- dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT, sig, &value);
-
- if (type == DBUS_TYPE_ARRAY) {
- int i;
- const char ***str_array = val;
-
- dbus_message_iter_open_container(&value, DBUS_TYPE_ARRAY,
- DBUS_TYPE_STRING_AS_STRING, &array);
-
- for (i = 0; (*str_array)[i]; i++)
- dbus_message_iter_append_basic(&array, DBUS_TYPE_STRING,
- &((*str_array)[i]));
-
- dbus_message_iter_close_container(&value, &array);
- } else
- dbus_message_iter_append_basic(&value, type, val);
-
- dbus_message_iter_close_container(iter, &value);
-}
-
-static void dbus_message_iter_append_dict_entry(DBusMessageIter *dict,
- const char *key, int type, void *val)
-{
- DBusMessageIter entry;
-
- dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY,
- NULL, &entry);
-
- dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &key);
-
- dbus_message_iter_append_variant(&entry, type, val);
-
- dbus_message_iter_close_container(dict, &entry);
-}
-
static void agent_disconnected(DBusConnection *conn, void *user_data)
{
DBG("Agent exited");
--
1.8.4
^ permalink raw reply related
* [PATCH 05/14] obexd/MAP: Remove unsued mas_drivers variable
From: Szymon Janc @ 2013-10-04 9:05 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1380877538-22614-1-git-send-email-szymon.janc@tieto.com>
This fix following build error:
CC obexd/client/obexd-mns.o
obexd/client/mns.c:344:38: error: ‘mas_drivers’ defined but not used
[-Werror=unused-variable]
cc1: all warnings being treated as errors
---
obexd/client/mns.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/obexd/client/mns.c b/obexd/client/mns.c
index 0663def..315764b 100644
--- a/obexd/client/mns.c
+++ b/obexd/client/mns.c
@@ -341,11 +341,6 @@ static struct obex_mime_type_driver mime_event_report = {
.write = event_report_write,
};
-static struct obex_mime_type_driver *mas_drivers[] = {
- &mime_event_report,
- NULL
-};
-
static int mns_init(void)
{
int err;
--
1.8.4
^ permalink raw reply related
* [PATCH 04/14] obexd/MAP: Fix missing include
From: Szymon Janc @ 2013-10-04 9:05 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1380877538-22614-1-git-send-email-szymon.janc@tieto.com>
This fix following build error:
CC obexd/client/obexd-mns.o
obexd/client/mns.c: In function ‘parse_event_report_handle’:
obexd/client/mns.c:187:2: error: implicit declaration of function
‘strtoull’ [-Werror=implicit-function-declaration]
---
obexd/client/mns.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/obexd/client/mns.c b/obexd/client/mns.c
index b709650..0663def 100644
--- a/obexd/client/mns.c
+++ b/obexd/client/mns.c
@@ -31,6 +31,7 @@
#include <fcntl.h>
#include <inttypes.h>
#include <stdbool.h>
+#include <stdlib.h>
#include <gobex/gobex.h>
#include <gobex/gobex-apparam.h>
--
1.8.4
^ permalink raw reply related
* [PATCH 03/14] obexd/MAP: Fix missing include
From: Szymon Janc @ 2013-10-04 9:05 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1380877538-22614-1-git-send-email-szymon.janc@tieto.com>
This fix following build error:
CC obexd/client/obexd-mns.o
obexd/client/mns.c: In function ‘mns_connect’:
obexd/client/mns.c:105:2: error: implicit declaration of function
‘manager_register_session’ [-Werror=implicit-function-declaration]
obexd/client/mns.c: In function ‘mns_disconnect’:
obexd/client/mns.c:128:2: error: implicit declaration of function
‘manager_unregister_session’ [-Werror=implicit-function-declaration]
---
obexd/client/mns.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/obexd/client/mns.c b/obexd/client/mns.c
index ee64ed6..b709650 100644
--- a/obexd/client/mns.c
+++ b/obexd/client/mns.c
@@ -44,6 +44,8 @@
#include "map_ap.h"
#include "map-event.h"
+#include "../src/manager.h"
+
struct mns_session {
GString *buffer;
GObexApparam *inparams;
--
1.8.4
^ permalink raw reply related
* [PATCH 02/14] obexd/bluetooth: Make dict_append_entry function static
From: Szymon Janc @ 2013-10-04 9:05 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
In-Reply-To: <1380877538-22614-1-git-send-email-szymon.janc@tieto.com>
This fix following build error:
CC obexd/plugins/obexd-bluetooth.o
obexd/plugins/bluetooth.c:242:6: error: no previous declaration for
‘dict_append_entry’ [-Werror=missing-declarations]
---
obexd/plugins/bluetooth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/obexd/plugins/bluetooth.c b/obexd/plugins/bluetooth.c
index 7f8a26d..143d0c2 100644
--- a/obexd/plugins/bluetooth.c
+++ b/obexd/plugins/bluetooth.c
@@ -239,7 +239,7 @@ static void append_variant(DBusMessageIter *iter, int type, void *val)
}
-void dict_append_entry(DBusMessageIter *dict,
+static void dict_append_entry(DBusMessageIter *dict,
const char *key, int type, void *val)
{
DBusMessageIter entry;
--
1.8.4
^ permalink raw reply related
* [PATCH 01/14] obexd/bluetooth: Remove unused local variables
From: Szymon Janc @ 2013-10-04 9:05 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
This ix following build errors:
CC obexd/plugins/obexd-bluetooth.o
obexd/plugins/bluetooth.c: In function ‘register_profile_reply’:
obexd/plugins/bluetooth.c:202:10: error: unused variable ‘err’
[-Werror=unused-variable]
obexd/plugins/bluetooth.c: In function ‘name_acquired’:
obexd/plugins/bluetooth.c:367:15: error: unused variable ‘uuid’
[-Werror=unused-variable]
obexd/plugins/bluetooth.c: In function ‘name_released’:
obexd/plugins/bluetooth.c:389:15: error: unused variable ‘uuid’
[-Werror=unused-variable]
obexd/plugins/bluetooth.c: In function ‘bluetooth_start’:
obexd/plugins/bluetooth.c:400:10: error: unused variable ‘ios’
[-Werror=unused-variable]
---
obexd/plugins/bluetooth.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/obexd/plugins/bluetooth.c b/obexd/plugins/bluetooth.c
index 017ff60..7f8a26d 100644
--- a/obexd/plugins/bluetooth.c
+++ b/obexd/plugins/bluetooth.c
@@ -199,7 +199,6 @@ static void register_profile_reply(DBusPendingCall *call, void *user_data)
struct bluetooth_profile *profile = user_data;
DBusMessage *reply = dbus_pending_call_steal_reply(call);
DBusError derr;
- GError *err = NULL;
dbus_error_init(&derr);
if (!dbus_set_error_from_message(&derr, reply)) {
@@ -364,7 +363,6 @@ static void name_acquired(DBusConnection *conn, void *user_data)
for (l = profiles; l; l = l->next) {
struct bluetooth_profile *profile = l->data;
- const char *uuid;
if (profile->path != NULL)
continue;
@@ -386,7 +384,6 @@ static void name_released(DBusConnection *conn, void *user_data)
for (l = profiles; l; l = l->next) {
struct bluetooth_profile *profile = l->data;
- const char *uuid;
if (profile->path == NULL)
continue;
@@ -397,7 +394,6 @@ static void name_released(DBusConnection *conn, void *user_data)
static void *bluetooth_start(struct obex_server *server, int *err)
{
- GSList *ios = NULL;
const GSList *l;
for (l = server->drivers; l; l = l->next) {
--
1.8.4
^ permalink raw reply related
* Re: [PATCH v4 5/7] android: Android version of log.c
From: Andrei Emeltchenko @ 2013-10-04 8:16 UTC (permalink / raw)
To: Frederic Danis; +Cc: linux-bluetooth
In-Reply-To: <1380632319-7701-5-git-send-email-frederic.danis@linux.intel.com>
On Tue, Oct 01, 2013 at 02:58:37PM +0200, Frederic Danis wrote:
> ---
> android/log.c | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> android/main.c | 34 +++++++++++
> 2 files changed, 206 insertions(+)
> create mode 100644 android/log.c
What is the status with review. Do I understand correctly that it needs to
be changed something like:
void info(const char *format, ...)
{
va_list ap;
va_start(ap, format);
- android_log(LOG_INFO, format, ap);
+ vfprintf(stderr, format, ap);
+ fprintf(stderr, "\n");
va_end(ap);
}
If so I can change this myself and resend patch series.
Best regards
Andrei Emeltchenko
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox