* [PATCH 1/2] android/bluetooth: Set default adapter name on first start
From: Szymon Janc @ 2014-01-09 8:39 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
On first start always set name to default name. Adapter name is
updated on start only if current name is different.
---
android/bluetooth.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/android/bluetooth.c b/android/bluetooth.c
index 9da988b..6aad9b5 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -50,6 +50,8 @@
#include "utils.h"
#include "bluetooth.h"
+#define DEFAULT_ADAPTER_NAME "BlueZ for Android"
+
#define DUT_MODE_FILE "/sys/kernel/debug/bluetooth/hci%u/dut_mode"
#define DEVICE_ID_SOURCE 0x0002 /* USB */
@@ -1734,15 +1736,17 @@ static void read_info_complete(uint8_t status, uint16_t length,
if (!bacmp(&adapter.bdaddr, BDADDR_ANY)) {
bacpy(&adapter.bdaddr, &rp->bdaddr);
- adapter.name = g_strdup((const char *) rp->name);
+ adapter.name = g_strdup(DEFAULT_ADAPTER_NAME);
store_adapter_config();
- set_adapter_name(rp->name, strlen((char *)rp->name));
} else if (bacmp(&adapter.bdaddr, &rp->bdaddr)) {
error("Bluetooth address mismatch");
err = -ENODEV;
goto failed;
}
+ if (g_strcmp0(adapter.name, (const char *) rp->name))
+ set_adapter_name((uint8_t *)adapter.name, strlen(adapter.name));
+
/* Store adapter information */
adapter.dev_class = rp->dev_class[0] | (rp->dev_class[1] << 8) |
(rp->dev_class[2] << 16);
--
1.8.3.2
^ permalink raw reply related
* Re: [PATCH] android: Fix bluetoothd installation path
From: Andrei Emeltchenko @ 2014-01-09 8:36 UTC (permalink / raw)
To: Szymon Janc; +Cc: Andrzej Kaczmarek, linux-bluetooth
In-Reply-To: <1482934.Q0UzPI5uvD@athlon>
Hi All,
On Wed, Jan 08, 2014 at 05:57:22PM +0100, Szymon Janc wrote:
> Hi Andrzej,
>
> On Wednesday 08 January 2014 17:42:01 Andrzej Kaczmarek wrote:
> > This patch removes explicit LOCAL_MODULE_PATH definition for bluetoothd
> > and bluetoothd-snoop modules which caused both binaries to be installed
> > in /system/xbin instead of /system/bin folder.
> > ---
> > android/Android.mk | 2 --
> > 1 file changed, 2 deletions(-)
> >
> > diff --git a/android/Android.mk b/android/Android.mk
> > index 16339b1..8eb918e 100644
> > --- a/android/Android.mk
> > +++ b/android/Android.mk
> > @@ -75,7 +75,6 @@ $(shell mkdir -p $(LOCAL_PATH)/../lib/bluetooth)
> >
> > $(foreach file,$(lib_headers), $(shell ln -sf ../$(file)
> > $(LOCAL_PATH)/../lib/bluetooth/$(file)))
> >
> > -LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
I would better change this to:
LOCAL_MODULE_PATH := $(TARGET_OUT_EXECUTABLES)
Best regards
Andrei Emeltchenko
> > LOCAL_MODULE_TAGS := optional
> > LOCAL_MODULE := bluetoothd
> >
> > @@ -264,7 +263,6 @@ LOCAL_C_INCLUDES := \
> >
> > LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
> >
> > -LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
> > LOCAL_MODULE_TAGS := optional
> > LOCAL_MODULE := bluetoothd-snoop
>
> Applied, thanks.
>
> --
> Szymon K. Janc
> szymon.janc@gmail.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v2] Bluetooth: Add hci_h4p driver
From: Pali Rohár @ 2014-01-08 21:36 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Marcel Holtmann,
Ивайло Димитров,
Gustavo F. Padovan, Johan Hedberg, Pavel Machek, linux-kernel,
linux-bluetooth@vger.kernel.org development
In-Reply-To: <20131230145250.GA16904@earth.universe>
On Monday 30 December 2013 15:52:51 Sebastian Reichel wrote:
> > > > +MODULE_DESCRIPTION("Bluetooth h4 driver with nokia
> > > > extensions"); +MODULE_LICENSE("GPL");
> > > > +MODULE_AUTHOR("Ville Tervo");
> > > > +MODULE_FIRMWARE(FW_NAME_TI1271_PRELE);
> > > > +MODULE_FIRMWARE(FW_NAME_TI1271_LE);
> > > > +MODULE_FIRMWARE(FW_NAME_TI1271);
> > > > +MODULE_FIRMWARE(FW_NAME_BCM2048);
> > > > +MODULE_FIRMWARE(FW_NAME_CSR);
> > >=20
> > > Do we actually have all these firmware files still
> > > available. If not, then focus on the ones we have.
> >=20
> > Firmware files are available for download from nemo project:
> >=20
> > https://api.merproject.org/public/source/nemo:devel:hw:ti:om
> > ap3:n900/bcm-bt-firmware/bcm-bt-firmware-0.21rc3.tar.bz2
> > https://api.merproject.org/public/source/nemo:devel:hw:ti:o
> > map3:n950-n9/ti-wl1273-bt-firmware/bt-firmware-ti1273_0.23+0
> > m6.tar.gz
>=20
> Would be nice to have them added to the linux-firmware.git.
>=20
> -- Sebastian
Can somebody send firmware files for inclusion to linux-firmware?
=2D-=20
Pali Roh=C3=A1r
pali.rohar@gmail.com
^ permalink raw reply
* Re: [PATCH] Bluetooth: Fix outgoing authentication requirement check
From: Marcel Holtmann @ 2014-01-08 19:00 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth@vger.kernel.org development
In-Reply-To: <1389192039-29493-1-git-send-email-johan.hedberg@gmail.com>
Hi Johan,
> The check for HIGH security level dates back to pre-mgmt times when a
> raw L2CAP socket with HIGH security level was used to trigger dedicated
> bonding. For legacy pairing checking for the security level was the only
> way to catch the need to authenticate in all scenarios. With mgmt
> however, the pair_device command does not use HIGH security but MEDIUM
> security. Therefore, the existing code would never trigger
> authentication for a non-SSP connection without an MITM requirement
> (e.g. if user space provided a NoInputNoOutput IO capability). In such a
> scenario the mgmt_pair_device command would return success without
> actually triggering any kind of pairing.
>
> This patch updates the authentication requirement check to also consider
> MEDIUM security level, and thereby ensures that mgmt_pair_device will
> always trigger authentication.
>
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
> This one should probably get a Cc: stable flag. It's also a
> pre-requisite for the first mgmt-tester pairing test case that was
> recently added to user space git.
>
> net/bluetooth/hci_event.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
patch has been applied to bluetooth-next tree.
I want to give this some time to get tested via bluetooth-next before we mark this as to be backported to stable.
Regards
Marcel
^ permalink raw reply
* Re: pull request: bluetooth-next 2014-01-07
From: John W. Linville @ 2014-01-08 18:45 UTC (permalink / raw)
To: Gustavo Padovan, linux-wireless, linux-bluetooth, linux-kernel
In-Reply-To: <20140107152251.GA24183@joana>
On Tue, Jan 07, 2014 at 01:22:51PM -0200, Gustavo Padovan wrote:
> Hi John,
>
> More patches to 3.14. The bulk of changes here is the 6LoWPAN support for
> Bluetooth LE Devices. The commits that touches net/ieee802154/ are already
> acked by David Miller. Other than that we have some RFCOMM fixes and
> improvements plus fixes and clean ups all over the tree.
>
> Please pull, or let me know of any concerns you have.
>
> Gustavo
>
> ---
> The following changes since commit 71fb419724fadab4efdf98210aa3fe053bd81d29:
>
> Bluetooth: Fix handling of L2CAP Command Reject over LE (2013-12-10 01:15:44 -0800)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git for-upstream
>
> for you to fetch changes up to e825eb1d7e06f616003c17e2e8e421c2e5e44142:
>
> Bluetooth: Fix 6loWPAN peer lookup (2014-01-07 11:32:15 -0200)
Pulling now...
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply
* Re: [PATCH] android: Fix bluetoothd installation path
From: Szymon Janc @ 2014-01-08 16:57 UTC (permalink / raw)
To: Andrzej Kaczmarek; +Cc: linux-bluetooth
In-Reply-To: <1389199321-26623-1-git-send-email-andrzej.kaczmarek@tieto.com>
Hi Andrzej,
On Wednesday 08 January 2014 17:42:01 Andrzej Kaczmarek wrote:
> This patch removes explicit LOCAL_MODULE_PATH definition for bluetoothd
> and bluetoothd-snoop modules which caused both binaries to be installed
> in /system/xbin instead of /system/bin folder.
> ---
> android/Android.mk | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/android/Android.mk b/android/Android.mk
> index 16339b1..8eb918e 100644
> --- a/android/Android.mk
> +++ b/android/Android.mk
> @@ -75,7 +75,6 @@ $(shell mkdir -p $(LOCAL_PATH)/../lib/bluetooth)
>
> $(foreach file,$(lib_headers), $(shell ln -sf ../$(file)
> $(LOCAL_PATH)/../lib/bluetooth/$(file)))
>
> -LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
> LOCAL_MODULE_TAGS := optional
> LOCAL_MODULE := bluetoothd
>
> @@ -264,7 +263,6 @@ LOCAL_C_INCLUDES := \
>
> LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
>
> -LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
> LOCAL_MODULE_TAGS := optional
> LOCAL_MODULE := bluetoothd-snoop
Applied, thanks.
--
Szymon K. Janc
szymon.janc@gmail.com
^ permalink raw reply
* [PATCH] android: Fix bluetoothd installation path
From: Andrzej Kaczmarek @ 2014-01-08 16:42 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Andrzej Kaczmarek
This patch removes explicit LOCAL_MODULE_PATH definition for bluetoothd
and bluetoothd-snoop modules which caused both binaries to be installed
in /system/xbin instead of /system/bin folder.
---
android/Android.mk | 2 --
1 file changed, 2 deletions(-)
diff --git a/android/Android.mk b/android/Android.mk
index 16339b1..8eb918e 100644
--- a/android/Android.mk
+++ b/android/Android.mk
@@ -75,7 +75,6 @@ $(shell mkdir -p $(LOCAL_PATH)/../lib/bluetooth)
$(foreach file,$(lib_headers), $(shell ln -sf ../$(file) $(LOCAL_PATH)/../lib/bluetooth/$(file)))
-LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := bluetoothd
@@ -264,7 +263,6 @@ LOCAL_C_INCLUDES := \
LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
-LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := bluetoothd-snoop
--
1.8.5.2
^ permalink raw reply related
* Re: [PATCH v2] android/audio: Add listener thread on the Audio HAL socket
From: Luiz Augusto von Dentz @ 2014-01-08 15:47 UTC (permalink / raw)
To: Lukasz Rymanowski
Cc: linux-bluetooth@vger.kernel.org, Szymon Janc, Johan Hedberg
In-Reply-To: <1389194371-14595-1-git-send-email-lukasz.rymanowski@tieto.com>
Hi Lukasz,
On Wed, Jan 8, 2014 at 5:19 PM, Lukasz Rymanowski
<lukasz.rymanowski@tieto.com> wrote:
> This patch add thread which is reponsible for listen on audio HAL
> socket, open a2dp endpoint(s) and maintain socket.
> When bluetooth daemon goes down, HAL audio plugin starts to listen on Audio HAL
> socket again.
>
> ---
> android/Makefile.am | 5 ++-
> android/hal-audio.c | 126 +++++++++++++++++++++++++++++++++++++++++++++++++++-
> 2 files changed, 129 insertions(+), 2 deletions(-)
>
> diff --git a/android/Makefile.am b/android/Makefile.am
> index 8810369..88ffa7f 100644
> --- a/android/Makefile.am
> +++ b/android/Makefile.am
> @@ -112,7 +112,8 @@ android_android_tester_LDFLAGS = -pthread
>
> noinst_LTLIBRARIES += android/libaudio-internal.la
>
> -android_libaudio_internal_la_SOURCES = android/hal-audio.c \
> +android_libaudio_internal_la_SOURCES = androdid/audio-msg.h \
> + android/hal-audio.c \
> android/hardware/audio.h \
> android/hardware/audio_effect.h \
> android/hardware/hardware.h \
> @@ -120,6 +121,8 @@ android_libaudio_internal_la_SOURCES = android/hal-audio.c \
>
> android_libaudio_internal_la_CFLAGS = -I$(srcdir)/android
>
> +android_libaudio_internal_la_LDFLAGS = -pthread
> +
> endif
>
> EXTRA_DIST += android/Android.mk android/hal-ipc-api.txt android/README \
> diff --git a/android/hal-audio.c b/android/hal-audio.c
> index 1743b42..12d3e0d 100644
> --- a/android/hal-audio.c
> +++ b/android/hal-audio.c
> @@ -16,15 +16,28 @@
> */
>
> #include <errno.h>
> +#include <pthread.h>
> +#include <poll.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> +#include <sys/socket.h>
> +#include <sys/un.h>
> +#include <unistd.h>
>
> #include <hardware/audio.h>
> #include <hardware/hardware.h>
>
> +#include "audio-msg.h"
> #include "hal-log.h"
>
> +static int audio_sk = -1;
> +static bool close_thread = false;
> +
> +static pthread_t bt_watcher_th = 0;
> +static pthread_mutex_t sk_mutex = PTHREAD_MUTEX_INITIALIZER;
> +static pthread_mutex_t close_mutex = PTHREAD_MUTEX_INITIALIZER;
> +
> struct a2dp_audio_dev {
> struct audio_hw_device dev;
> struct audio_stream_out *out;
> @@ -384,15 +397,117 @@ static int audio_dump(const audio_hw_device_t *device, int fd)
>
> static int audio_close(hw_device_t *device)
> {
> + struct a2dp_audio_dev *a2dp_dev = (struct a2dp_audio_dev *)device;
> +
> DBG("");
> - free(device);
> +
> + pthread_mutex_lock(&close_mutex);
> + shutdown(audio_sk, SHUT_RDWR);
> + close_thread = true;
> + pthread_mutex_unlock(&close_mutex);
> +
> + pthread_join(bt_watcher_th, NULL);
> +
> + free(a2dp_dev);
> return 0;
> }
>
> +static bool create_audio_ipc(void)
> +{
> + struct sockaddr_un addr;
> + int err;
> + int sk;
> +
> + DBG("");
> +
> + sk = socket(PF_LOCAL, SOCK_SEQPACKET, 0);
> + if (sk < 0) {
> + err = errno;
> + error("Failed to create socket: %d (%s)", err, strerror(err));
> + return false;
> + }
> +
> + memset(&addr, 0, sizeof(addr));
> + addr.sun_family = AF_UNIX;
> +
> + memcpy(addr.sun_path, BLUEZ_AUDIO_SK_PATH,
> + sizeof(BLUEZ_AUDIO_SK_PATH));
> +
> + if (bind(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
> + err = errno;
> + error("Failed to bind socket: %d (%s)", err, strerror(err));
> + goto failed;
> + }
> +
> + if (listen(sk, 1) < 0) {
> + err = errno;
> + error("Failed to listen on the socket: %d (%s)", err,
> + strerror(err));
> + goto failed;
> + }
> +
> + audio_sk = accept(sk, NULL, NULL);
> + if (audio_sk < 0) {
> + err = errno;
> + error("Failed to accept socket: %d (%s)", err, strerror(err));
> + goto failed;
> + }
> +
> + close(sk);
> + return true;
> +
> +failed:
> + close(sk);
> + return false;
> +}
> +
> +static void *bluetoothd_watcher_thread(void *data)
> +{
> + bool done = false;
> + struct a2dp_audio_dev *a2dp_dev = (struct a2dp_audio_dev *) data;
> + struct pollfd pfd;
> +
> + DBG("");
> +
> + while (!done) {
> + if(!create_audio_ipc()) {
> + error("Failed to create listening socket");
> + sleep(1);
> + continue;
> + }
> +
> + DBG("Audio IPC: Connected");
> +
> + /* TODO: Register ENDPOINT here */
> +
> + memset(&pfd, 0, sizeof(pfd));
> + pfd.fd = audio_sk;
> + pfd.events = POLLHUP | POLLERR | POLLNVAL;
> +
> + /* Check if socket is still alive. Empty while loop.*/
> + while (poll(&pfd, 1, -1) < 0 && errno == EINTR);
> +
> + if (pfd.revents & (POLLHUP | POLLERR | POLLNVAL)) {
> + info("Audio HAL: Socket closed");
> + audio_sk = -1;
> + }
> +
> + /*Check if audio_dev is closed */
> + pthread_mutex_lock(&close_mutex);
> + done = close_thread;
> + close_thread = false;
> + pthread_mutex_unlock(&close_mutex);
> + }
> +
> + info("Closing bluetooth_watcher thread");
> + return NULL;
> +}
> +
> static int audio_open(const hw_module_t *module, const char *name,
> hw_device_t **device)
> {
> struct a2dp_audio_dev *a2dp_dev;
> + int err;
>
> DBG("");
>
> @@ -430,6 +545,15 @@ static int audio_open(const hw_module_t *module, const char *name,
> * audio_hw_device. We will rely on this later in the code.*/
> *device = &a2dp_dev->dev.common;
>
> + err = pthread_create(&bt_watcher_th, NULL, bluetoothd_watcher_thread,
> + NULL);
> + if (err < 0) {
> + bt_watcher_th = 0;
> + error("Failed to start bluetoothd watcher thread: %d (%s)",
> + -err, strerror(-err));
> + return (-err);
> + }
> +
> return 0;
> }
>
> --
> 1.8.4
Pushed after stripping out some code not really used and fix a type in
Makefile.am.
--
Luiz Augusto von Dentz
^ permalink raw reply
* Re: [PATCH] emulator: Fix possible NULL dereference
From: Johan Hedberg @ 2014-01-08 15:26 UTC (permalink / raw)
To: Andrei Emeltchenko; +Cc: linux-bluetooth
In-Reply-To: <1389193854-25769-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
Hi Andrei,
On Wed, Jan 08, 2014, Andrei Emeltchenko wrote:
> Move test dereference after it is checked for NULL.
> ---
> tools/mgmt-tester.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
> index c518e47..325def1 100644
> --- a/tools/mgmt-tester.c
> +++ b/tools/mgmt-tester.c
> @@ -2646,6 +2646,14 @@ static void test_setup(const void *test_data)
> const struct generic_data *test = data->test_data;
> const uint16_t *cmd;
>
> + if (!test || !test->setup_settings) {
> + if (data->test_setup)
> + data->test_setup(data);
> + else
> + tester_setup_complete();
> + return;
> + }
> +
> if (test->pin) {
> struct bthost *bthost = hciemu_client_get_host(data->hciemu);
>
> @@ -2655,14 +2663,6 @@ static void test_setup(const void *test_data)
> data, NULL);
> }
>
> - if (!test || !test->setup_settings) {
> - if (data->test_setup)
> - data->test_setup(data);
> - else
> - tester_setup_complete();
> - return;
> - }
> -
> for (cmd = test->setup_settings; *cmd; cmd++) {
> unsigned char simple_param[] = { 0x01 };
> unsigned char discov_param[] = { 0x01, 0x00, 0x00 };
This isn't quite right since setup_settings might be NULL while pin is
non-NULL. I pushed a simpler correct fix myself.
Johan
^ permalink raw reply
* [PATCH v2] android/audio: Add listener thread on the Audio HAL socket
From: Lukasz Rymanowski @ 2014-01-08 15:19 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.dentz, szymon.janc, johan.hedberg, Lukasz Rymanowski
This patch add thread which is reponsible for listen on audio HAL
socket, open a2dp endpoint(s) and maintain socket.
When bluetooth daemon goes down, HAL audio plugin starts to listen on Audio HAL
socket again.
---
android/Makefile.am | 5 ++-
android/hal-audio.c | 126 +++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 129 insertions(+), 2 deletions(-)
diff --git a/android/Makefile.am b/android/Makefile.am
index 8810369..88ffa7f 100644
--- a/android/Makefile.am
+++ b/android/Makefile.am
@@ -112,7 +112,8 @@ android_android_tester_LDFLAGS = -pthread
noinst_LTLIBRARIES += android/libaudio-internal.la
-android_libaudio_internal_la_SOURCES = android/hal-audio.c \
+android_libaudio_internal_la_SOURCES = androdid/audio-msg.h \
+ android/hal-audio.c \
android/hardware/audio.h \
android/hardware/audio_effect.h \
android/hardware/hardware.h \
@@ -120,6 +121,8 @@ android_libaudio_internal_la_SOURCES = android/hal-audio.c \
android_libaudio_internal_la_CFLAGS = -I$(srcdir)/android
+android_libaudio_internal_la_LDFLAGS = -pthread
+
endif
EXTRA_DIST += android/Android.mk android/hal-ipc-api.txt android/README \
diff --git a/android/hal-audio.c b/android/hal-audio.c
index 1743b42..12d3e0d 100644
--- a/android/hal-audio.c
+++ b/android/hal-audio.c
@@ -16,15 +16,28 @@
*/
#include <errno.h>
+#include <pthread.h>
+#include <poll.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <unistd.h>
#include <hardware/audio.h>
#include <hardware/hardware.h>
+#include "audio-msg.h"
#include "hal-log.h"
+static int audio_sk = -1;
+static bool close_thread = false;
+
+static pthread_t bt_watcher_th = 0;
+static pthread_mutex_t sk_mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t close_mutex = PTHREAD_MUTEX_INITIALIZER;
+
struct a2dp_audio_dev {
struct audio_hw_device dev;
struct audio_stream_out *out;
@@ -384,15 +397,117 @@ static int audio_dump(const audio_hw_device_t *device, int fd)
static int audio_close(hw_device_t *device)
{
+ struct a2dp_audio_dev *a2dp_dev = (struct a2dp_audio_dev *)device;
+
DBG("");
- free(device);
+
+ pthread_mutex_lock(&close_mutex);
+ shutdown(audio_sk, SHUT_RDWR);
+ close_thread = true;
+ pthread_mutex_unlock(&close_mutex);
+
+ pthread_join(bt_watcher_th, NULL);
+
+ free(a2dp_dev);
return 0;
}
+static bool create_audio_ipc(void)
+{
+ struct sockaddr_un addr;
+ int err;
+ int sk;
+
+ DBG("");
+
+ sk = socket(PF_LOCAL, SOCK_SEQPACKET, 0);
+ if (sk < 0) {
+ err = errno;
+ error("Failed to create socket: %d (%s)", err, strerror(err));
+ return false;
+ }
+
+ memset(&addr, 0, sizeof(addr));
+ addr.sun_family = AF_UNIX;
+
+ memcpy(addr.sun_path, BLUEZ_AUDIO_SK_PATH,
+ sizeof(BLUEZ_AUDIO_SK_PATH));
+
+ if (bind(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
+ err = errno;
+ error("Failed to bind socket: %d (%s)", err, strerror(err));
+ goto failed;
+ }
+
+ if (listen(sk, 1) < 0) {
+ err = errno;
+ error("Failed to listen on the socket: %d (%s)", err,
+ strerror(err));
+ goto failed;
+ }
+
+ audio_sk = accept(sk, NULL, NULL);
+ if (audio_sk < 0) {
+ err = errno;
+ error("Failed to accept socket: %d (%s)", err, strerror(err));
+ goto failed;
+ }
+
+ close(sk);
+ return true;
+
+failed:
+ close(sk);
+ return false;
+}
+
+static void *bluetoothd_watcher_thread(void *data)
+{
+ bool done = false;
+ struct a2dp_audio_dev *a2dp_dev = (struct a2dp_audio_dev *) data;
+ struct pollfd pfd;
+
+ DBG("");
+
+ while (!done) {
+ if(!create_audio_ipc()) {
+ error("Failed to create listening socket");
+ sleep(1);
+ continue;
+ }
+
+ DBG("Audio IPC: Connected");
+
+ /* TODO: Register ENDPOINT here */
+
+ memset(&pfd, 0, sizeof(pfd));
+ pfd.fd = audio_sk;
+ pfd.events = POLLHUP | POLLERR | POLLNVAL;
+
+ /* Check if socket is still alive. Empty while loop.*/
+ while (poll(&pfd, 1, -1) < 0 && errno == EINTR);
+
+ if (pfd.revents & (POLLHUP | POLLERR | POLLNVAL)) {
+ info("Audio HAL: Socket closed");
+ audio_sk = -1;
+ }
+
+ /*Check if audio_dev is closed */
+ pthread_mutex_lock(&close_mutex);
+ done = close_thread;
+ close_thread = false;
+ pthread_mutex_unlock(&close_mutex);
+ }
+
+ info("Closing bluetooth_watcher thread");
+ return NULL;
+}
+
static int audio_open(const hw_module_t *module, const char *name,
hw_device_t **device)
{
struct a2dp_audio_dev *a2dp_dev;
+ int err;
DBG("");
@@ -430,6 +545,15 @@ static int audio_open(const hw_module_t *module, const char *name,
* audio_hw_device. We will rely on this later in the code.*/
*device = &a2dp_dev->dev.common;
+ err = pthread_create(&bt_watcher_th, NULL, bluetoothd_watcher_thread,
+ NULL);
+ if (err < 0) {
+ bt_watcher_th = 0;
+ error("Failed to start bluetoothd watcher thread: %d (%s)",
+ -err, strerror(-err));
+ return (-err);
+ }
+
return 0;
}
--
1.8.4
^ permalink raw reply related
* [PATCH] emulator: Fix possible NULL dereference
From: Andrei Emeltchenko @ 2014-01-08 15:10 UTC (permalink / raw)
To: linux-bluetooth
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Move test dereference after it is checked for NULL.
---
tools/mgmt-tester.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index c518e47..325def1 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -2646,6 +2646,14 @@ static void test_setup(const void *test_data)
const struct generic_data *test = data->test_data;
const uint16_t *cmd;
+ if (!test || !test->setup_settings) {
+ if (data->test_setup)
+ data->test_setup(data);
+ else
+ tester_setup_complete();
+ return;
+ }
+
if (test->pin) {
struct bthost *bthost = hciemu_client_get_host(data->hciemu);
@@ -2655,14 +2663,6 @@ static void test_setup(const void *test_data)
data, NULL);
}
- if (!test || !test->setup_settings) {
- if (data->test_setup)
- data->test_setup(data);
- else
- tester_setup_complete();
- return;
- }
-
for (cmd = test->setup_settings; *cmd; cmd++) {
unsigned char simple_param[] = { 0x01 };
unsigned char discov_param[] = { 0x01, 0x00, 0x00 };
--
1.8.3.2
^ permalink raw reply related
* Re: [PATCH_v3] android-tester: Add HIDHost initial interface setup test
From: Szymon Janc @ 2014-01-08 14:58 UTC (permalink / raw)
To: Ravi kumar Veeramally; +Cc: linux-bluetooth
In-Reply-To: <1389190750-15156-1-git-send-email-ravikumar.veeramally@linux.intel.com>
Hi Ravi,
On Wednesday 08 of January 2014 16:19:10 Ravi kumar Veeramally wrote:
> ---
> android/android-tester.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 53 insertions(+)
>
> diff --git a/android/android-tester.c b/android/android-tester.c
> index 9a161ad..a448ab5 100644
> --- a/android/android-tester.c
> +++ b/android/android-tester.c
> @@ -39,6 +39,7 @@
> #include <hardware/hardware.h>
> #include <hardware/bluetooth.h>
> #include <hardware/bt_sock.h>
> +#include <hardware/bt_hh.h>
>
> #include "utils.h"
>
> @@ -79,6 +80,7 @@ struct test_data {
> struct hw_device_t *device;
> const bt_interface_t *if_bluetooth;
> const btsock_interface_t *if_sock;
> + const bthh_interface_t *if_hid;
>
> bool mgmt_settings_set;
> bool cb_count_checked;
> @@ -958,6 +960,16 @@ static bt_callbacks_t bt_callbacks = {
> .le_test_mode_cb = NULL
> };
>
> +static bthh_callbacks_t bthh_callbacks = {
> + .size = sizeof(bthh_callbacks),
> + .connection_state_cb = NULL,
> + .hid_info_cb = NULL,
> + .protocol_mode_cb = NULL,
> + .idle_time_cb = NULL,
> + .get_report_cb = NULL,
> + .virtual_unplug_cb = NULL
> +};
> +
> static void setup(struct test_data *data)
> {
> const hw_module_t *module;
> @@ -1064,6 +1076,11 @@ static void teardown(const void *test_data)
> {
> struct test_data *data = tester_get_data();
>
> + if (data->if_hid) {
> + data->if_hid->cleanup();
> + data->if_hid = NULL;
> + }
> +
> if (data->if_bluetooth) {
> data->if_bluetooth->cleanup();
> data->if_bluetooth = NULL;
> @@ -1860,6 +1877,39 @@ clean:
> close(sock_fd);
> }
>
> +static void setup_hidhost_interface(const void *test_data)
> +{
> + struct test_data *data = tester_get_data();
> + bt_status_t status;
> + const void *hid;
> +
> + setup(data);
> +
> + status = data->if_bluetooth->init(&bt_callbacks);
> + if (status != BT_STATUS_SUCCESS) {
> + data->if_bluetooth = NULL;
> + tester_setup_failed();
> + return;
> + }
> +
> + hid = data->if_bluetooth->get_profile_interface(BT_PROFILE_HIDHOST_ID);
> + if (!hid) {
> + tester_setup_failed();
> + return;
> + }
> +
> + data->if_hid = hid;
> +
> + status = data->if_hid->init(&bthh_callbacks);
> + if (status != BT_STATUS_SUCCESS) {
> + data->if_hid = NULL;
> + tester_setup_failed();
> + return;
> + }
> +
> + tester_setup_complete();
> +}
> +
> #define test_bredrle(name, data, test_setup, test, test_teardown) \
> do { \
> struct test_data *user; \
> @@ -2071,5 +2121,8 @@ int main(int argc, char *argv[])
> setup_socket_interface_enabled,
> test_socket_real_connect, teardown);
>
> + test_bredrle("HIDHost Init", NULL, setup_hidhost_interface,
> + test_dummy, teardown);
> +
> return tester_run();
> }
>
Patch applied, thanks.
--
Best regards,
Szymon Janc
^ permalink raw reply
* Re: [PATCH] android/pixit: Add PTS version to respective pixit
From: Szymon Janc @ 2014-01-08 14:51 UTC (permalink / raw)
To: Sebastian Chlad; +Cc: linux-bluetooth, Sebastian Chlad
In-Reply-To: <1389133067-5157-1-git-send-email-sebastianx.chlad@intel.com>
Hi Sebastian,
On Tuesday 07 of January 2014 23:17:47 Sebastian Chlad wrote:
> ---
> android/pixit-did.txt | 2 ++
> android/pixit-gap.txt | 2 ++
> android/pixit-hid.txt | 2 ++
> android/pixit-l2cap.txt | 2 ++
> android/pixit-opp.txt | 2 ++
> android/pixit-pan.txt | 2 ++
> android/pixit-pbap.txt | 2 ++
> 7 files changed, 14 insertions(+)
>
> diff --git a/android/pixit-did.txt b/android/pixit-did.txt
> index 2527845..8c64d52 100644
> --- a/android/pixit-did.txt
> +++ b/android/pixit-did.txt
> @@ -1,5 +1,7 @@
> DID PIXIT for the PTS tool.
>
> +PTS version: 5.0
> +
> * - different than PTS defaults
> & - should be set to IUT Bluetooth address
>
> diff --git a/android/pixit-gap.txt b/android/pixit-gap.txt
> index 786c55e..f3c7726 100644
> --- a/android/pixit-gap.txt
> +++ b/android/pixit-gap.txt
> @@ -1,5 +1,7 @@
> GAP PIXIT for the PTS tool.
>
> +PTS version: 5.0
> +
> * - different than PTS defaults
> & - should be set to IUT Bluetooth address
>
> diff --git a/android/pixit-hid.txt b/android/pixit-hid.txt
> index f306615..1d36c92 100644
> --- a/android/pixit-hid.txt
> +++ b/android/pixit-hid.txt
> @@ -1,5 +1,7 @@
> HID PIXIT for the PTS tool.
>
> +PTS version: 5.0
> +
> * - different than PTS defaults
> & - should be set to IUT Bluetooth address
>
> diff --git a/android/pixit-l2cap.txt b/android/pixit-l2cap.txt
> index 7de6638..a307625 100644
> --- a/android/pixit-l2cap.txt
> +++ b/android/pixit-l2cap.txt
> @@ -1,5 +1,7 @@
> L2CAP PIXIT for the PTS tool.
>
> +PTS version: 5.0
> +
> * - different than PTS defaults
> & - should be set to IUT Bluetooth address
>
> diff --git a/android/pixit-opp.txt b/android/pixit-opp.txt
> index 1b1e834..93f6a29 100644
> --- a/android/pixit-opp.txt
> +++ b/android/pixit-opp.txt
> @@ -1,5 +1,7 @@
> OPP PIXIT for the PTS tool.
>
> +PTS version: 5.0
> +
> * - different than PTS defaults
> & - should be set to IUT Bluetooth address
>
> diff --git a/android/pixit-pan.txt b/android/pixit-pan.txt
> index 2d180da..6544a9c 100644
> --- a/android/pixit-pan.txt
> +++ b/android/pixit-pan.txt
> @@ -1,5 +1,7 @@
> PAN PIXIT for the PTS tool.
>
> +PTS version: 5.0
> +
> * - different than PTS defaults
> & - should be set to IUT Bluetooth address
>
> diff --git a/android/pixit-pbap.txt b/android/pixit-pbap.txt
> index 272cbc3..470f4c5 100644
> --- a/android/pixit-pbap.txt
> +++ b/android/pixit-pbap.txt
> @@ -1,5 +1,7 @@
> PBAP PIXIT for the PTS tool.
>
> +PTS version: 5.0
> +
> * - different than PTS defaults
> & - should be set to IUT Bluetooth address
>
>
Applied, thanks.
--
Best regards,
Szymon Janc
^ permalink raw reply
* [PATCH] Bluetooth: Fix outgoing authentication requirement check
From: johan.hedberg @ 2014-01-08 14:40 UTC (permalink / raw)
To: linux-bluetooth
From: Johan Hedberg <johan.hedberg@intel.com>
The check for HIGH security level dates back to pre-mgmt times when a
raw L2CAP socket with HIGH security level was used to trigger dedicated
bonding. For legacy pairing checking for the security level was the only
way to catch the need to authenticate in all scenarios. With mgmt
however, the pair_device command does not use HIGH security but MEDIUM
security. Therefore, the existing code would never trigger
authentication for a non-SSP connection without an MITM requirement
(e.g. if user space provided a NoInputNoOutput IO capability). In such a
scenario the mgmt_pair_device command would return success without
actually triggering any kind of pairing.
This patch updates the authentication requirement check to also consider
MEDIUM security level, and thereby ensures that mgmt_pair_device will
always trigger authentication.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
This one should probably get a Cc: stable flag. It's also a
pre-requisite for the first mgmt-tester pairing test case that was
recently added to user space git.
net/bluetooth/hci_event.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 5f812455a450..cfcce448957b 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1185,9 +1185,12 @@ static int hci_outgoing_auth_needed(struct hci_dev *hdev,
return 0;
/* Only request authentication for SSP connections or non-SSP
- * devices with sec_level HIGH or if MITM protection is requested */
+ * devices with sec_level MEDIUM or HIGH or if MITM protection
+ * is requested.
+ */
if (!hci_conn_ssp_enabled(conn) && !(conn->auth_type & 0x01) &&
- conn->pending_sec_level != BT_SECURITY_HIGH)
+ conn->pending_sec_level != BT_SECURITY_HIGH &&
+ conn->pending_sec_level != BT_SECURITY_MEDIUM)
return 0;
return 1;
--
1.8.4.2
^ permalink raw reply related
* Re: [PATCH 1/2] android/audio: Add wrapper stuct for audio structures
From: Luiz Augusto von Dentz @ 2014-01-08 14:38 UTC (permalink / raw)
To: Lukasz Rymanowski
Cc: linux-bluetooth@vger.kernel.org, Szymon Janc, Johan Hedberg
In-Reply-To: <1389188229-3977-1-git-send-email-lukasz.rymanowski@tieto.com>
Hi Lukasz,
On Wed, Jan 8, 2014 at 3:37 PM, Lukasz Rymanowski
<lukasz.rymanowski@tieto.com> wrote:
> This patch add wrapping struct for audio_hw_dev and audio_stream_out.
> We will need this to keep some more addition info related to a2dp stream
> and also hal IPC.
>
> ---
> android/hal-audio.c | 109 +++++++++++++++++++++++++++++++---------------------
> 1 file changed, 65 insertions(+), 44 deletions(-)
>
> diff --git a/android/hal-audio.c b/android/hal-audio.c
> index 7f4a3f2..bb68648 100644
> --- a/android/hal-audio.c
> +++ b/android/hal-audio.c
> @@ -25,6 +25,15 @@
>
> #include "hal-log.h"
>
> +struct a2dp_stream_out {
> + struct audio_stream_out stream;
> +};
> +
> +struct a2dp_audio_dev {
> + struct audio_hw_device dev;
> + struct a2dp_stream_out *stream_out;
> +};
> +
> static ssize_t out_write(struct audio_stream_out *stream, const void *buffer,
> size_t bytes)
> {
> @@ -230,32 +239,37 @@ static int audio_open_output_stream(struct audio_hw_device *dev,
> struct audio_stream_out **stream_out)
>
> {
> - struct audio_stream_out *out;
> + struct a2dp_audio_dev *a2dp_dev = (struct a2dp_audio_dev *)dev;
> + struct a2dp_stream_out *a2dp_out;
>
> - out = calloc(1, sizeof(struct audio_stream_out));
> - if (!out)
> + a2dp_out = calloc(1, sizeof(struct a2dp_stream_out));
> + if (!a2dp_out)
> return -ENOMEM;
>
> DBG("");
>
> - out->common.get_sample_rate = out_get_sample_rate;
> - out->common.set_sample_rate = out_set_sample_rate;
> - out->common.get_buffer_size = out_get_buffer_size;
> - out->common.get_channels = out_get_channels;
> - out->common.get_format = out_get_format;
> - out->common.set_format = out_set_format;
> - out->common.standby = out_standby;
> - out->common.dump = out_dump;
> - out->common.set_parameters = out_set_parameters;
> - out->common.get_parameters = out_get_parameters;
> - out->common.add_audio_effect = out_add_audio_effect;
> - out->common.remove_audio_effect = out_remove_audio_effect;
> - out->get_latency = out_get_latency;
> - out->set_volume = out_set_volume;
> - out->write = out_write;
> - out->get_render_position = out_get_render_position;
> -
> - *stream_out = out;
> + a2dp_out->stream.common.get_sample_rate = out_get_sample_rate;
> + a2dp_out->stream.common.set_sample_rate = out_set_sample_rate;
> + a2dp_out->stream.common.get_buffer_size = out_get_buffer_size;
> + a2dp_out->stream.common.get_channels = out_get_channels;
> + a2dp_out->stream.common.get_format = out_get_format;
> + a2dp_out->stream.common.set_format = out_set_format;
> + a2dp_out->stream.common.standby = out_standby;
> + a2dp_out->stream.common.dump = out_dump;
> + a2dp_out->stream.common.set_parameters = out_set_parameters;
> + a2dp_out->stream.common.get_parameters = out_get_parameters;
> + a2dp_out->stream.common.add_audio_effect = out_add_audio_effect;
> + a2dp_out->stream.common.remove_audio_effect = out_remove_audio_effect;
> + a2dp_out->stream.get_latency = out_get_latency;
> + a2dp_out->stream.set_volume = out_set_volume;
> + a2dp_out->stream.write = out_write;
> + a2dp_out->stream.get_render_position = out_get_render_position;
> +
> + /* Note that &a2dp_out->stream pointer is same as a2dp_out. This
> + * results from the structure of a2dp_stream_out struct. We rely on it
> + * later in the code */
> + *stream_out = &a2dp_out->stream;
> + a2dp_dev->stream_out = a2dp_out;
>
> return 0;
> }
> @@ -264,6 +278,10 @@ static void audio_close_output_stream(struct audio_hw_device *dev,
> struct audio_stream_out *stream)
> {
> DBG("");
> + struct a2dp_audio_dev *a2dp_dev = (struct a2dp_audio_dev *)dev;
> +
> + free(stream);
> + a2dp_dev->stream_out = NULL;
> }
>
> static int audio_set_parameters(struct audio_hw_device *dev,
> @@ -381,7 +399,7 @@ static int audio_close(hw_device_t *device)
> static int audio_open(const hw_module_t *module, const char *name,
> hw_device_t **device)
> {
> - struct audio_hw_device *audio;
> + struct a2dp_audio_dev *a2dp_dev;
>
> DBG("");
>
> @@ -391,30 +409,33 @@ static int audio_open(const hw_module_t *module, const char *name,
> return -EINVAL;
> }
>
> - audio = calloc(1, sizeof(struct audio_hw_device));
> - if (!audio)
> + a2dp_dev = calloc(1, sizeof(struct a2dp_audio_dev));
> + if (!a2dp_dev)
> return -ENOMEM;
>
> - audio->common.version = AUDIO_DEVICE_API_VERSION_CURRENT;
> - audio->common.module = (struct hw_module_t *) module;
> - audio->common.close = audio_close;
> -
> - audio->init_check = audio_init_check;
> - audio->set_voice_volume = audio_set_voice_volume;
> - audio->set_master_volume = audio_set_master_volume;
> - audio->set_mode = audio_set_mode;
> - audio->set_mic_mute = audio_set_mic_mute;
> - audio->get_mic_mute = audio_get_mic_mute;
> - audio->set_parameters = audio_set_parameters;
> - audio->get_parameters = audio_get_parameters;
> - audio->get_input_buffer_size = audio_get_input_buffer_size;
> - audio->open_output_stream = audio_open_output_stream;
> - audio->close_output_stream = audio_close_output_stream;
> - audio->open_input_stream = audio_open_input_stream;
> - audio->close_input_stream = audio_close_input_stream;
> - audio->dump = audio_dump;
> -
> - *device = &audio->common;
> + a2dp_dev->dev.common.version = AUDIO_DEVICE_API_VERSION_CURRENT;
> + a2dp_dev->dev.common.module = (struct hw_module_t *) module;
> + a2dp_dev->dev.common.close = audio_close;
> +
> + a2dp_dev->dev.init_check = audio_init_check;
> + a2dp_dev->dev.set_voice_volume = audio_set_voice_volume;
> + a2dp_dev->dev.set_master_volume = audio_set_master_volume;
> + a2dp_dev->dev.set_mode = audio_set_mode;
> + a2dp_dev->dev.set_mic_mute = audio_set_mic_mute;
> + a2dp_dev->dev.get_mic_mute = audio_get_mic_mute;
> + a2dp_dev->dev.set_parameters = audio_set_parameters;
> + a2dp_dev->dev.get_parameters = audio_get_parameters;
> + a2dp_dev->dev.get_input_buffer_size = audio_get_input_buffer_size;
> + a2dp_dev->dev.open_output_stream = audio_open_output_stream;
> + a2dp_dev->dev.close_output_stream = audio_close_output_stream;
> + a2dp_dev->dev.open_input_stream = audio_open_input_stream;
> + a2dp_dev->dev.close_input_stream = audio_close_input_stream;
> + a2dp_dev->dev.dump = audio_dump;
> +
> + /* Note that &a2dp_dev->dev.common is the same pointer as a2dp_dev.
> + * This results from the structure of following structs:a2dp_audio_dev,
> + * audio_hw_device. We will rely on this later in the code.*/
> + *device = &a2dp_dev->dev.common;
>
> return 0;
> }
> --
> 1.8.4
Ive pushed this one with some modifications, it doesn't seems
necessary to create a wrapper for audio_stream_out so I prefer to
introduce it later whenever it becomes necessary.
--
Luiz Augusto von Dentz
^ permalink raw reply
* Re: [PATCH_v2] android-tester: Add HIDHost initial interface setup test
From: Ravi kumar Veeramally @ 2014-01-08 14:20 UTC (permalink / raw)
To: Szymon Janc; +Cc: linux-bluetooth
In-Reply-To: <1581614.crLN0P0epW@uw000953>
Hi,
On 01/08/2014 04:02 PM, Szymon Janc wrote:
> Hi Ravi,
>
> On Wednesday 08 of January 2014 13:02:37 Ravi kumar Veeramally wrote:
>> ---
>> android/android-tester.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 53 insertions(+)
>>
>> diff --git a/android/android-tester.c b/android/android-tester.c
>> index 9a161ad..cbb827d 100644
>> --- a/android/android-tester.c
>> +++ b/android/android-tester.c
>> @@ -39,6 +39,7 @@
>> #include <hardware/hardware.h>
>> #include <hardware/bluetooth.h>
>> #include <hardware/bt_sock.h>
>> +#include <hardware/bt_hh.h>
>>
>> #include "utils.h"
>>
>> @@ -79,6 +80,7 @@ struct test_data {
>> struct hw_device_t *device;
>> const bt_interface_t *if_bluetooth;
>> const btsock_interface_t *if_sock;
>> + const bthh_interface_t *if_hid;
>>
>> bool mgmt_settings_set;
>> bool cb_count_checked;
>> @@ -958,6 +960,16 @@ static bt_callbacks_t bt_callbacks = {
>> .le_test_mode_cb = NULL
>> };
>>
>> +static bthh_callbacks_t bthh_callbacks = {
>> + .size = sizeof(bthh_callbacks),
>> + .connection_state_cb = NULL,
>> + .hid_info_cb = NULL,
>> + .protocol_mode_cb = NULL,
>> + .idle_time_cb = NULL,
>> + .get_report_cb = NULL,
>> + .virtual_unplug_cb = NULL
>> +};
>> +
>> static void setup(struct test_data *data)
>> {
>> const hw_module_t *module;
>> @@ -1069,6 +1081,11 @@ static void teardown(const void *test_data)
>> data->if_bluetooth = NULL;
>> }
>>
>> + if (data->if_hid) {
>> + data->if_hid->cleanup();
>> + data->if_hid = NULL;
>> + }
>> +
> This results in test being aborted due to IPC error. After bluetooth
> service is closed daemon exits. I think hid cleanup should be called
> before bluetooth cleanup.
>
> In future also please pay attention to tester output while testing your patches
> i.e. tests summary should be printed.
Sorry, updated and sent _v3.
Thanks,
Ravi.
>
>> data->device->close(data->device);
>>
>> if (data->bluetoothd_pid)
>> @@ -1860,6 +1877,39 @@ clean:
>> close(sock_fd);
>> }
>>
>> +static void setup_hidhost_interface(const void *test_data)
>> +{
>> + struct test_data *data = tester_get_data();
>> + bt_status_t status;
>> + const void *hid;
>> +
>> + setup(data);
>> +
>> + status = data->if_bluetooth->init(&bt_callbacks);
>> + if (status != BT_STATUS_SUCCESS) {
>> + data->if_bluetooth = NULL;
>> + tester_setup_failed();
>> + return;
>> + }
>> +
>> + hid = data->if_bluetooth->get_profile_interface(BT_PROFILE_HIDHOST_ID);
>> + if (!hid) {
>> + tester_setup_failed();
>> + return;
>> + }
>> +
>> + data->if_hid = hid;
>> +
>> + status = data->if_hid->init(&bthh_callbacks);
>> + if (status != BT_STATUS_SUCCESS) {
>> + data->if_hid = NULL;
>> + tester_setup_failed();
>> + return;
>> + }
>> +
>> + tester_setup_complete();
>> +}
>> +
>> #define test_bredrle(name, data, test_setup, test, test_teardown) \
>> do { \
>> struct test_data *user; \
>> @@ -2071,5 +2121,8 @@ int main(int argc, char *argv[])
>> setup_socket_interface_enabled,
>> test_socket_real_connect, teardown);
>>
>> + test_bredrle("HIDHost Init", NULL, setup_hidhost_interface,
>> + test_dummy, teardown);
>> +
>> return tester_run();
>> }
>>
^ permalink raw reply
* [PATCH_v3] android-tester: Add HIDHost initial interface setup test
From: Ravi kumar Veeramally @ 2014-01-08 14:19 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
---
android/android-tester.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/android/android-tester.c b/android/android-tester.c
index 9a161ad..a448ab5 100644
--- a/android/android-tester.c
+++ b/android/android-tester.c
@@ -39,6 +39,7 @@
#include <hardware/hardware.h>
#include <hardware/bluetooth.h>
#include <hardware/bt_sock.h>
+#include <hardware/bt_hh.h>
#include "utils.h"
@@ -79,6 +80,7 @@ struct test_data {
struct hw_device_t *device;
const bt_interface_t *if_bluetooth;
const btsock_interface_t *if_sock;
+ const bthh_interface_t *if_hid;
bool mgmt_settings_set;
bool cb_count_checked;
@@ -958,6 +960,16 @@ static bt_callbacks_t bt_callbacks = {
.le_test_mode_cb = NULL
};
+static bthh_callbacks_t bthh_callbacks = {
+ .size = sizeof(bthh_callbacks),
+ .connection_state_cb = NULL,
+ .hid_info_cb = NULL,
+ .protocol_mode_cb = NULL,
+ .idle_time_cb = NULL,
+ .get_report_cb = NULL,
+ .virtual_unplug_cb = NULL
+};
+
static void setup(struct test_data *data)
{
const hw_module_t *module;
@@ -1064,6 +1076,11 @@ static void teardown(const void *test_data)
{
struct test_data *data = tester_get_data();
+ if (data->if_hid) {
+ data->if_hid->cleanup();
+ data->if_hid = NULL;
+ }
+
if (data->if_bluetooth) {
data->if_bluetooth->cleanup();
data->if_bluetooth = NULL;
@@ -1860,6 +1877,39 @@ clean:
close(sock_fd);
}
+static void setup_hidhost_interface(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ bt_status_t status;
+ const void *hid;
+
+ setup(data);
+
+ status = data->if_bluetooth->init(&bt_callbacks);
+ if (status != BT_STATUS_SUCCESS) {
+ data->if_bluetooth = NULL;
+ tester_setup_failed();
+ return;
+ }
+
+ hid = data->if_bluetooth->get_profile_interface(BT_PROFILE_HIDHOST_ID);
+ if (!hid) {
+ tester_setup_failed();
+ return;
+ }
+
+ data->if_hid = hid;
+
+ status = data->if_hid->init(&bthh_callbacks);
+ if (status != BT_STATUS_SUCCESS) {
+ data->if_hid = NULL;
+ tester_setup_failed();
+ return;
+ }
+
+ tester_setup_complete();
+}
+
#define test_bredrle(name, data, test_setup, test, test_teardown) \
do { \
struct test_data *user; \
@@ -2071,5 +2121,8 @@ int main(int argc, char *argv[])
setup_socket_interface_enabled,
test_socket_real_connect, teardown);
+ test_bredrle("HIDHost Init", NULL, setup_hidhost_interface,
+ test_dummy, teardown);
+
return tester_run();
}
--
1.8.3.2
^ permalink raw reply related
* Re: [PATCH_v2] android-tester: Add HIDHost initial interface setup test
From: Szymon Janc @ 2014-01-08 14:02 UTC (permalink / raw)
To: Ravi kumar Veeramally; +Cc: linux-bluetooth
In-Reply-To: <1389178957-8730-1-git-send-email-ravikumar.veeramally@linux.intel.com>
Hi Ravi,
On Wednesday 08 of January 2014 13:02:37 Ravi kumar Veeramally wrote:
> ---
> android/android-tester.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 53 insertions(+)
>
> diff --git a/android/android-tester.c b/android/android-tester.c
> index 9a161ad..cbb827d 100644
> --- a/android/android-tester.c
> +++ b/android/android-tester.c
> @@ -39,6 +39,7 @@
> #include <hardware/hardware.h>
> #include <hardware/bluetooth.h>
> #include <hardware/bt_sock.h>
> +#include <hardware/bt_hh.h>
>
> #include "utils.h"
>
> @@ -79,6 +80,7 @@ struct test_data {
> struct hw_device_t *device;
> const bt_interface_t *if_bluetooth;
> const btsock_interface_t *if_sock;
> + const bthh_interface_t *if_hid;
>
> bool mgmt_settings_set;
> bool cb_count_checked;
> @@ -958,6 +960,16 @@ static bt_callbacks_t bt_callbacks = {
> .le_test_mode_cb = NULL
> };
>
> +static bthh_callbacks_t bthh_callbacks = {
> + .size = sizeof(bthh_callbacks),
> + .connection_state_cb = NULL,
> + .hid_info_cb = NULL,
> + .protocol_mode_cb = NULL,
> + .idle_time_cb = NULL,
> + .get_report_cb = NULL,
> + .virtual_unplug_cb = NULL
> +};
> +
> static void setup(struct test_data *data)
> {
> const hw_module_t *module;
> @@ -1069,6 +1081,11 @@ static void teardown(const void *test_data)
> data->if_bluetooth = NULL;
> }
>
> + if (data->if_hid) {
> + data->if_hid->cleanup();
> + data->if_hid = NULL;
> + }
> +
This results in test being aborted due to IPC error. After bluetooth
service is closed daemon exits. I think hid cleanup should be called
before bluetooth cleanup.
In future also please pay attention to tester output while testing your patches
i.e. tests summary should be printed.
> data->device->close(data->device);
>
> if (data->bluetoothd_pid)
> @@ -1860,6 +1877,39 @@ clean:
> close(sock_fd);
> }
>
> +static void setup_hidhost_interface(const void *test_data)
> +{
> + struct test_data *data = tester_get_data();
> + bt_status_t status;
> + const void *hid;
> +
> + setup(data);
> +
> + status = data->if_bluetooth->init(&bt_callbacks);
> + if (status != BT_STATUS_SUCCESS) {
> + data->if_bluetooth = NULL;
> + tester_setup_failed();
> + return;
> + }
> +
> + hid = data->if_bluetooth->get_profile_interface(BT_PROFILE_HIDHOST_ID);
> + if (!hid) {
> + tester_setup_failed();
> + return;
> + }
> +
> + data->if_hid = hid;
> +
> + status = data->if_hid->init(&bthh_callbacks);
> + if (status != BT_STATUS_SUCCESS) {
> + data->if_hid = NULL;
> + tester_setup_failed();
> + return;
> + }
> +
> + tester_setup_complete();
> +}
> +
> #define test_bredrle(name, data, test_setup, test, test_teardown) \
> do { \
> struct test_data *user; \
> @@ -2071,5 +2121,8 @@ int main(int argc, char *argv[])
> setup_socket_interface_enabled,
> test_socket_real_connect, teardown);
>
> + test_bredrle("HIDHost Init", NULL, setup_hidhost_interface,
> + test_dummy, teardown);
> +
> return tester_run();
> }
>
--
Best regards,
Szymon Janc
^ permalink raw reply
* [PATCH 2/2] android/audio: Add listener thread on the Audio HAL socket
From: Lukasz Rymanowski @ 2014-01-08 13:37 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.dentz, szymon.janc, johan.hedberg, Lukasz Rymanowski
In-Reply-To: <1389188229-3977-1-git-send-email-lukasz.rymanowski@tieto.com>
This patch add thread which is reponsible for listen on audio HAL
socket and later open a2dp endpoint(s) and maintain socket.
When bluetooth daemon goes down, HAL audio plugin starts to listen on Audio HAL
socket again.
---
android/Makefile.am | 5 ++-
android/hal-audio.c | 126 +++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 129 insertions(+), 2 deletions(-)
diff --git a/android/Makefile.am b/android/Makefile.am
index 8810369..88ffa7f 100644
--- a/android/Makefile.am
+++ b/android/Makefile.am
@@ -112,7 +112,8 @@ android_android_tester_LDFLAGS = -pthread
noinst_LTLIBRARIES += android/libaudio-internal.la
-android_libaudio_internal_la_SOURCES = android/hal-audio.c \
+android_libaudio_internal_la_SOURCES = androdid/audio-msg.h \
+ android/hal-audio.c \
android/hardware/audio.h \
android/hardware/audio_effect.h \
android/hardware/hardware.h \
@@ -120,6 +121,8 @@ android_libaudio_internal_la_SOURCES = android/hal-audio.c \
android_libaudio_internal_la_CFLAGS = -I$(srcdir)/android
+android_libaudio_internal_la_LDFLAGS = -pthread
+
endif
EXTRA_DIST += android/Android.mk android/hal-ipc-api.txt android/README \
diff --git a/android/hal-audio.c b/android/hal-audio.c
index bb68648..c3d3bf4 100644
--- a/android/hal-audio.c
+++ b/android/hal-audio.c
@@ -16,15 +16,28 @@
*/
#include <errno.h>
+#include <pthread.h>
+#include <poll.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <unistd.h>
#include <hardware/audio.h>
#include <hardware/hardware.h>
+#include "audio-msg.h"
#include "hal-log.h"
+static int audio_sk = -1;
+static bool close_thread;
+
+static pthread_t bt_watcher_th = 0;
+static pthread_mutex_t sk_mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t close_mutex = PTHREAD_MUTEX_INITIALIZER;
+
struct a2dp_stream_out {
struct audio_stream_out stream;
};
@@ -391,15 +404,117 @@ static int audio_dump(const audio_hw_device_t *device, int fd)
static int audio_close(hw_device_t *device)
{
+ struct a2dp_audio_dev *a2dp_dev = (struct a2dp_audio_dev *)device;
+
DBG("");
- free(device);
+
+ pthread_mutex_lock(&close_mutex);
+ shutdown(audio_sk, SHUT_RDWR);
+ close_thread = true;
+ pthread_mutex_unlock(&close_mutex);
+
+ (void) pthread_join(bt_watcher_th, NULL);
+
+ free(a2dp_dev);
return 0;
}
+static bool create_audio_ipc(void)
+{
+ struct sockaddr_un addr;
+ int err;
+ int sk;
+
+ DBG("");
+
+ sk = socket(PF_LOCAL, SOCK_SEQPACKET, 0);
+ if (sk < 0) {
+ err = errno;
+ error("Failed to create socket: %d (%s)", err, strerror(err));
+ return false;
+ }
+
+ memset(&addr, 0, sizeof(addr));
+ addr.sun_family = AF_UNIX;
+
+ memcpy(addr.sun_path, BLUEZ_AUDIO_SK_PATH,
+ sizeof(BLUEZ_AUDIO_SK_PATH));
+
+ if (bind(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
+ err = errno;
+ error("Failed to bind socket: %d (%s)", err, strerror(err));
+ goto error;
+ }
+
+ if (listen(sk, 1) < 0) {
+ err = errno;
+ error("Failed to bind socket: %d (%s)", err, strerror(err));
+ goto error;
+ }
+
+ audio_sk = accept(sk, NULL, NULL);
+ if (audio_sk < 0) {
+ err = errno;
+ error("Failed to accept socket: %d (%s)", err, strerror(err));
+ goto error;
+ }
+
+ close(sk);
+ return true;
+
+error:
+ close(sk);
+ return false;
+}
+
+static void *bluetoothd_watcher_thread(void *data)
+{
+ bool done = false;
+ struct a2dp_audio_dev *a2dp_dev = (struct a2dp_audio_dev *)data;
+ struct pollfd pfd;
+
+ DBG("");
+
+ close_thread = false;
+
+ while (!done) {
+ if(!create_audio_ipc()) {
+ error("Failed to create listening socket");
+ continue;
+ }
+
+ DBG("Audio IPC: Connected");
+
+ /* TODO: Register ENDPOINT here */
+
+ memset(&pfd, 0, sizeof(pfd));
+ pfd.fd = audio_sk;
+ pfd.events = POLLHUP | POLLERR | POLLNVAL;
+
+ /* Check if socket is still alive */
+ while (poll(&pfd, 1, -1) < 0 && errno == EINTR);
+
+ if (pfd.revents & (POLLHUP | POLLERR | POLLNVAL)) {
+ info("Audio HAL: Socket closed");
+ audio_sk = -1;
+ }
+
+ /*Check if audio_dev is closed */
+ pthread_mutex_lock(&close_mutex);
+ done = close_thread;
+ pthread_mutex_unlock(&close_mutex);
+ }
+
+ info("Closing bluetooth_watcher thread");
+ pthread_exit(NULL);
+ return NULL;
+}
+
static int audio_open(const hw_module_t *module, const char *name,
hw_device_t **device)
{
struct a2dp_audio_dev *a2dp_dev;
+ int err;
DBG("");
@@ -437,6 +552,15 @@ static int audio_open(const hw_module_t *module, const char *name,
* audio_hw_device. We will rely on this later in the code.*/
*device = &a2dp_dev->dev.common;
+ err = pthread_create(&bt_watcher_th, NULL, bluetoothd_watcher_thread,
+ NULL);
+ if (err < 0) {
+ bt_watcher_th = 0;
+ error("Failed to start bluetoothd watcher thread: %d (%s)",
+ -err, strerror(-err));
+ return (-err);
+ }
+
return 0;
}
--
1.8.4
^ permalink raw reply related
* [PATCH 1/2] android/audio: Add wrapper stuct for audio structures
From: Lukasz Rymanowski @ 2014-01-08 13:37 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.dentz, szymon.janc, johan.hedberg, Lukasz Rymanowski
This patch add wrapping struct for audio_hw_dev and audio_stream_out.
We will need this to keep some more addition info related to a2dp stream
and also hal IPC.
---
android/hal-audio.c | 109 +++++++++++++++++++++++++++++++---------------------
1 file changed, 65 insertions(+), 44 deletions(-)
diff --git a/android/hal-audio.c b/android/hal-audio.c
index 7f4a3f2..bb68648 100644
--- a/android/hal-audio.c
+++ b/android/hal-audio.c
@@ -25,6 +25,15 @@
#include "hal-log.h"
+struct a2dp_stream_out {
+ struct audio_stream_out stream;
+};
+
+struct a2dp_audio_dev {
+ struct audio_hw_device dev;
+ struct a2dp_stream_out *stream_out;
+};
+
static ssize_t out_write(struct audio_stream_out *stream, const void *buffer,
size_t bytes)
{
@@ -230,32 +239,37 @@ static int audio_open_output_stream(struct audio_hw_device *dev,
struct audio_stream_out **stream_out)
{
- struct audio_stream_out *out;
+ struct a2dp_audio_dev *a2dp_dev = (struct a2dp_audio_dev *)dev;
+ struct a2dp_stream_out *a2dp_out;
- out = calloc(1, sizeof(struct audio_stream_out));
- if (!out)
+ a2dp_out = calloc(1, sizeof(struct a2dp_stream_out));
+ if (!a2dp_out)
return -ENOMEM;
DBG("");
- out->common.get_sample_rate = out_get_sample_rate;
- out->common.set_sample_rate = out_set_sample_rate;
- out->common.get_buffer_size = out_get_buffer_size;
- out->common.get_channels = out_get_channels;
- out->common.get_format = out_get_format;
- out->common.set_format = out_set_format;
- out->common.standby = out_standby;
- out->common.dump = out_dump;
- out->common.set_parameters = out_set_parameters;
- out->common.get_parameters = out_get_parameters;
- out->common.add_audio_effect = out_add_audio_effect;
- out->common.remove_audio_effect = out_remove_audio_effect;
- out->get_latency = out_get_latency;
- out->set_volume = out_set_volume;
- out->write = out_write;
- out->get_render_position = out_get_render_position;
-
- *stream_out = out;
+ a2dp_out->stream.common.get_sample_rate = out_get_sample_rate;
+ a2dp_out->stream.common.set_sample_rate = out_set_sample_rate;
+ a2dp_out->stream.common.get_buffer_size = out_get_buffer_size;
+ a2dp_out->stream.common.get_channels = out_get_channels;
+ a2dp_out->stream.common.get_format = out_get_format;
+ a2dp_out->stream.common.set_format = out_set_format;
+ a2dp_out->stream.common.standby = out_standby;
+ a2dp_out->stream.common.dump = out_dump;
+ a2dp_out->stream.common.set_parameters = out_set_parameters;
+ a2dp_out->stream.common.get_parameters = out_get_parameters;
+ a2dp_out->stream.common.add_audio_effect = out_add_audio_effect;
+ a2dp_out->stream.common.remove_audio_effect = out_remove_audio_effect;
+ a2dp_out->stream.get_latency = out_get_latency;
+ a2dp_out->stream.set_volume = out_set_volume;
+ a2dp_out->stream.write = out_write;
+ a2dp_out->stream.get_render_position = out_get_render_position;
+
+ /* Note that &a2dp_out->stream pointer is same as a2dp_out. This
+ * results from the structure of a2dp_stream_out struct. We rely on it
+ * later in the code */
+ *stream_out = &a2dp_out->stream;
+ a2dp_dev->stream_out = a2dp_out;
return 0;
}
@@ -264,6 +278,10 @@ static void audio_close_output_stream(struct audio_hw_device *dev,
struct audio_stream_out *stream)
{
DBG("");
+ struct a2dp_audio_dev *a2dp_dev = (struct a2dp_audio_dev *)dev;
+
+ free(stream);
+ a2dp_dev->stream_out = NULL;
}
static int audio_set_parameters(struct audio_hw_device *dev,
@@ -381,7 +399,7 @@ static int audio_close(hw_device_t *device)
static int audio_open(const hw_module_t *module, const char *name,
hw_device_t **device)
{
- struct audio_hw_device *audio;
+ struct a2dp_audio_dev *a2dp_dev;
DBG("");
@@ -391,30 +409,33 @@ static int audio_open(const hw_module_t *module, const char *name,
return -EINVAL;
}
- audio = calloc(1, sizeof(struct audio_hw_device));
- if (!audio)
+ a2dp_dev = calloc(1, sizeof(struct a2dp_audio_dev));
+ if (!a2dp_dev)
return -ENOMEM;
- audio->common.version = AUDIO_DEVICE_API_VERSION_CURRENT;
- audio->common.module = (struct hw_module_t *) module;
- audio->common.close = audio_close;
-
- audio->init_check = audio_init_check;
- audio->set_voice_volume = audio_set_voice_volume;
- audio->set_master_volume = audio_set_master_volume;
- audio->set_mode = audio_set_mode;
- audio->set_mic_mute = audio_set_mic_mute;
- audio->get_mic_mute = audio_get_mic_mute;
- audio->set_parameters = audio_set_parameters;
- audio->get_parameters = audio_get_parameters;
- audio->get_input_buffer_size = audio_get_input_buffer_size;
- audio->open_output_stream = audio_open_output_stream;
- audio->close_output_stream = audio_close_output_stream;
- audio->open_input_stream = audio_open_input_stream;
- audio->close_input_stream = audio_close_input_stream;
- audio->dump = audio_dump;
-
- *device = &audio->common;
+ a2dp_dev->dev.common.version = AUDIO_DEVICE_API_VERSION_CURRENT;
+ a2dp_dev->dev.common.module = (struct hw_module_t *) module;
+ a2dp_dev->dev.common.close = audio_close;
+
+ a2dp_dev->dev.init_check = audio_init_check;
+ a2dp_dev->dev.set_voice_volume = audio_set_voice_volume;
+ a2dp_dev->dev.set_master_volume = audio_set_master_volume;
+ a2dp_dev->dev.set_mode = audio_set_mode;
+ a2dp_dev->dev.set_mic_mute = audio_set_mic_mute;
+ a2dp_dev->dev.get_mic_mute = audio_get_mic_mute;
+ a2dp_dev->dev.set_parameters = audio_set_parameters;
+ a2dp_dev->dev.get_parameters = audio_get_parameters;
+ a2dp_dev->dev.get_input_buffer_size = audio_get_input_buffer_size;
+ a2dp_dev->dev.open_output_stream = audio_open_output_stream;
+ a2dp_dev->dev.close_output_stream = audio_close_output_stream;
+ a2dp_dev->dev.open_input_stream = audio_open_input_stream;
+ a2dp_dev->dev.close_input_stream = audio_close_input_stream;
+ a2dp_dev->dev.dump = audio_dump;
+
+ /* Note that &a2dp_dev->dev.common is the same pointer as a2dp_dev.
+ * This results from the structure of following structs:a2dp_audio_dev,
+ * audio_hw_device. We will rely on this later in the code.*/
+ *device = &a2dp_dev->dev.common;
return 0;
}
--
1.8.4
^ permalink raw reply related
* Re: [PATCH] android/pics: Update PICS to PTS 5.0
From: Szymon Janc @ 2014-01-08 13:20 UTC (permalink / raw)
To: Sebastian Chlad; +Cc: linux-bluetooth
In-Reply-To: <1389181018-30211-1-git-send-email-sebastianx.chlad@intel.com>
Hi Sebastian,
> Update PICS settings for HID, L2CAP, OPP, PAN and PBAP
> ---
> android/pics-hid.txt | 2 ++
> android/pics-l2cap.txt | 2 ++
> android/pics-opp.txt | 2 ++
> android/pics-pan.txt | 2 ++
> android/pics-pbap.txt | 5 +++--
> 5 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/android/pics-hid.txt b/android/pics-hid.txt
> index b0b7d52..ac37e45 100644
> --- a/android/pics-hid.txt
> +++ b/android/pics-hid.txt
> @@ -1,5 +1,7 @@
> HID PICS for the PTS tool.
>
> +PTS version: 5.0
> +
> * - different than PTS defaults
> # - not yet implemented/supported
>
> diff --git a/android/pics-l2cap.txt b/android/pics-l2cap.txt
> index ef25133..7b49627 100644
> --- a/android/pics-l2cap.txt
> +++ b/android/pics-l2cap.txt
> @@ -1,5 +1,7 @@
> L2CAP PICS for the PTS tool.
>
> +PTS version: 5.0
> +
> * - different than PTS defaults
> # - not yet implemented/supported
>
> diff --git a/android/pics-opp.txt b/android/pics-opp.txt
> index c0f2ad6..cd4acce 100644
> --- a/android/pics-opp.txt
> +++ b/android/pics-opp.txt
> @@ -1,5 +1,7 @@
> OPP PICS for the PTS tool.
>
> +PTS version: 5.0
> +
> * - different than PTS defaults
> # - not yet implemented/supported
>
> diff --git a/android/pics-pan.txt b/android/pics-pan.txt
> index 7576d2d..16457bf 100644
> --- a/android/pics-pan.txt
> +++ b/android/pics-pan.txt
> @@ -1,5 +1,7 @@
> PAN PICS for the PTS tool.
>
> +PTS version: 5.0
> +
> * - different than PTS defaults
> # - not yet implemented/supported
>
> diff --git a/android/pics-pbap.txt b/android/pics-pbap.txt
> index 7b2d7d2..b6b6d8b 100644
> --- a/android/pics-pbap.txt
> +++ b/android/pics-pbap.txt
> @@ -1,5 +1,7 @@
> PBAP PICS for the PTS tool.
>
> +PTS version: 5.0
> +
> * - different than PTS defaults
> # - not yet implemented/supported
>
> @@ -12,8 +14,7 @@ Parameter Name Selected Description
> -------------------------------------------------------------------------------
> TSPC_PBAP_0_1 False Role: PBAP 1.0 (C.1)
> TSPC_PBAP_0_2 True (*) Role: PBAP 1.1 (C.1)
> -TSPC_PBAP_0_3 False Role: Reserve
> -TSPC_PBAP_0_4 False (*) Role: PBAP 1.2 (C.1)
> +TSPC_PBAP_0_3 False (*) Role: PBAP 1.2 (C.1)
> -------------------------------------------------------------------------------
> C.1: Mandatory to support one and only one major profile version.
> -------------------------------------------------------------------------------
>
Applied, thanks.
--
BR
Szymon Janc
^ permalink raw reply
* Re: [PATCH] android/pics: Update PICS to PTS 5.0 for DID
From: Szymon Janc @ 2014-01-08 13:19 UTC (permalink / raw)
To: Sebastian Chlad; +Cc: linux-bluetooth
In-Reply-To: <1389175277-28726-1-git-send-email-sebastianx.chlad@intel.com>
Hi Sebastian,
> Remove PICS settings which are not applicable in PTS
> ---
> android/pics-did.txt | 12 ++----------
> 1 file changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/android/pics-did.txt b/android/pics-did.txt
> index 8f92bc1..58cee41 100644
> --- a/android/pics-did.txt
> +++ b/android/pics-did.txt
> @@ -1,21 +1,13 @@
> DID PICS for the PTS tool.
>
> +PTS version: 5.0
> +
> * - different than PTS defaults
> # - not yet implemented/supported
>
> M - mandatory
> O - optional
>
> - Version
> --------------------------------------------------------------------------------
> -Parameter Name Selected Description
> --------------------------------------------------------------------------------
> -TSPC_DID_0_1 False Device ID 1.2 (C.1)
> -TSPC_DID_0_2 True Device ID 1.3 (C.1)
> --------------------------------------------------------------------------------
> -C.1: It is mandatory to support one of the profile versions.
> --------------------------------------------------------------------------------
> -
>
> SDP Requirements
> -------------------------------------------------------------------------------
>
Applied, thanks.
--
BR
Szymon Janc
^ permalink raw reply
* Re: [PATCH] android/pics: Update PICS to PTS 5.0 for GAP
From: Szymon Janc @ 2014-01-08 13:19 UTC (permalink / raw)
To: Sebastian Chlad; +Cc: linux-bluetooth
In-Reply-To: <1389174407-28486-1-git-send-email-sebastianx.chlad@intel.com>
Hi Sebastian,
> Add new PICS settings for the GAP profile in accordance with PTS 5.0
> ---
> android/pics-gap.txt | 44 +++++++++++++++++++++++++++++++++++++-------
> 1 file changed, 37 insertions(+), 7 deletions(-)
>
> diff --git a/android/pics-gap.txt b/android/pics-gap.txt
> index e8ab2ab..56a33d5 100644
> --- a/android/pics-gap.txt
> +++ b/android/pics-gap.txt
> @@ -1,5 +1,7 @@
> GAP PICS for the PTS tool.
>
> +PTS version: 5.0
> +
> * - different than PTS defaults
> # - not yet implemented/supported
>
> @@ -668,19 +670,33 @@ TSPC_GAP_41_1 True (#) Central BR/EDR/LE: Security Aspects (M)
> -------------------------------------------------------------------------------
>
>
> + Central Simultaneous BR/EDR and LE Transports
> +-------------------------------------------------------------------------------
> +Parameter Name Selected Description
> +-------------------------------------------------------------------------------
> +TSPC_GAP_42_1 False Simultaneous BR/EDR and LE Transports – BR/EDR
> + Slave to the same device (C.1)
> +TSPC_GAP_42_2 False Simultaneous BR/EDR and LE Transports – BR/EDR
> + Master to the same device (C.1)
> +-------------------------------------------------------------------------------
> +C.1: Optional if ((SUM ICS 31/14 (Core Spec Version 4.1) or SUM ICS 31/15
> + (Core Spec Version 4.1+HS)) is supported, otherwise Excluded.
> +-------------------------------------------------------------------------------
> +
> +
> Peripheral BR/EDR/LE Modes
> -------------------------------------------------------------------------------
> Parameter Name Selected Description
> -------------------------------------------------------------------------------
> -TSPC_GAP_42_1 False Peripheral BR/EDR/LE: Non-Discoverable Mode
> +TSPC_GAP_43_1 False Peripheral BR/EDR/LE: Non-Discoverable Mode
> (C.1)
> -TSPC_GAP_42_2 False Peripheral BR/EDR/LE: Discoverable Mode
> +TSPC_GAP_43_2 False Peripheral BR/EDR/LE: Discoverable Mode
> (C.2)
> -TSPC_GAP_42_3 False Peripheral BR/EDR/LE: Non-Connectable Mode
> +TSPC_GAP_43_3 False Peripheral BR/EDR/LE: Non-Connectable Mode
> (C.3)
> -TSPC_GAP_42_4 False (*) Peripheral BR/EDR/LE: Connectable Mode (M)
> -TSPC_GAP_42_5 False Peripheral BR/EDR/LE: Non-Bondable Mode (C.4)
> -TSPC_GAP_42_6 False Peripheral BR/EDR/LE: Bondable Mode (C.5)
> +TSPC_GAP_43_4 False (*) Peripheral BR/EDR/LE: Connectable Mode (M)
> +TSPC_GAP_43_5 False Peripheral BR/EDR/LE: Non-Bondable Mode (C.4)
> +TSPC_GAP_43_6 False Peripheral BR/EDR/LE: Bondable Mode (C.5)
> -------------------------------------------------------------------------------
> C.1: Mandatory if TSPC_GAP_1_1 is supported over BR/EDR, otherwise Excluded.
> C.2: Mandatory if (TSPC_GAP_1_2 or TSPC_GAP_1_3) is supported over BR/EDR,
> @@ -695,7 +711,21 @@ C.5: Mandatory if TSPC_GAP_1_7 is supported over BR/EDR, otherwise Excluded.
> -------------------------------------------------------------------------------
> Parameter Name Selected Description
> -------------------------------------------------------------------------------
> -TSPC_GAP_43_1 False (*) Peripheral BR/EDR/LE: Security Aspects (M)
> +TSPC_GAP_44_1 False (*) Peripheral BR/EDR/LE: Security Aspects (M)
> +-------------------------------------------------------------------------------
> +
> +
> + Peripheral Simultaneous BR/EDR and LE Transports
> +-------------------------------------------------------------------------------
> +Parameter Name Selected Description
> +-------------------------------------------------------------------------------
> +TSPC_GAP_45_1 False Simultaneous BR/EDR and LE Transports – BR/EDR
> + Slave to the same device (C.1)
> +TSPC_GAP_45_2 False Simultaneous BR/EDR and LE Transports – BR/EDR
> + Master to the same device (C.1)
> +-------------------------------------------------------------------------------
> +C.1: Optional if ((SUM ICS 31/14 (Core Spec Version 4.1) or SUM ICS 31/15
> +(Core Spec Version 4.1+HS)) is supported, otherwise Excluded.
> -------------------------------------------------------------------------------
>
>
>
Applied, thanks.
--
BR
Szymon Janc
^ permalink raw reply
* Re: [PATCH v3 1/3] android: Add wrapper function for get remote dev properties
From: Szymon Janc @ 2014-01-08 12:19 UTC (permalink / raw)
To: Lukasz Rymanowski; +Cc: linux-bluetooth, johan.hedberg
In-Reply-To: <1389104030-21314-1-git-send-email-lukasz.rymanowski@tieto.com>
Hi Łukasz,
> ---
> android/bluetooth.c | 23 ++++++++++++++---------
> 1 file changed, 14 insertions(+), 9 deletions(-)
>
> diff --git a/android/bluetooth.c b/android/bluetooth.c
> index 3cbf68d..f281fcf 100644
> --- a/android/bluetooth.c
> +++ b/android/bluetooth.c
> @@ -2673,6 +2673,19 @@ static uint8_t get_device_timestamp(struct device *dev)
> return HAL_STATUS_SUCCESS;
> }
>
> +static void get_remote_device_props(struct device *dev)
> +{
> + get_device_name(dev);
> + get_device_uuids(dev);
> + get_device_class(dev);
> + get_device_type(dev);
> + get_device_service_rec(dev);
> + get_device_friendly_name(dev);
> + get_device_rssi(dev);
> + get_device_version_info(dev);
> + get_device_timestamp(dev);
> +}
> +
> static void handle_get_remote_device_props_cmd(const void *buf, uint16_t len)
> {
> const struct hal_cmd_get_remote_device_props *cmd = buf;
> @@ -2688,15 +2701,7 @@ static void handle_get_remote_device_props_cmd(const void *buf, uint16_t len)
> goto failed;
> }
>
> - get_device_name(l->data);
> - get_device_uuids(l->data);
> - get_device_class(l->data);
> - get_device_type(l->data);
> - get_device_service_rec(l->data);
> - get_device_friendly_name(l->data);
> - get_device_rssi(l->data);
> - get_device_version_info(l->data);
> - get_device_timestamp(l->data);
> + get_remote_device_props(l->data);
>
> status = HAL_STATUS_SUCCESS;
>
>
Patches applied, thanks.
--
BR
Szymon Janc
^ permalink raw reply
* [PATCH_v4 4/4] android/pan: Remove connected PAN devices on profile unregister call
From: Ravi kumar Veeramally @ 2014-01-08 11:46 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1389181593-9683-1-git-send-email-ravikumar.veeramally@linux.intel.com>
---
android/pan.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/android/pan.c b/android/pan.c
index d5ae690..621dc62 100644
--- a/android/pan.c
+++ b/android/pan.c
@@ -759,10 +759,20 @@ bool bt_pan_register(const bdaddr_t *addr)
return true;
}
+static void pan_device_disconnected(gpointer data, gpointer user_data)
+{
+ struct pan_device *dev = data;
+
+ bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTED);
+}
+
void bt_pan_unregister(void)
{
DBG("");
+ g_slist_foreach(devices, pan_device_disconnected, NULL);
+ devices = NULL;
+
bnep_cleanup();
ipc_unregister(HAL_SERVICE_ID_PAN);
--
1.8.3.2
^ permalink raw reply related
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