Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/3] android/socket: Make channel int32_t in IPC specification
From: Szymon Janc @ 2014-01-04 20:16 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

This match IPC type with type in socket HAL API. This allows to pass
data directly from HAL library and will allow to reduce logic in it.
---
 android/hal-msg.h | 20 ++++++++++----------
 android/socket.c  |  2 +-
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/android/hal-msg.h b/android/hal-msg.h
index c351501..bbbb99c 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -233,20 +233,20 @@ struct hal_cmd_le_test_mode {
 
 #define HAL_OP_SOCK_LISTEN		0x01
 struct hal_cmd_sock_listen {
-	uint8_t  type;
-	uint8_t  name[256];
-	uint8_t  uuid[16];
-	uint16_t channel;
-	uint8_t  flags;
+	uint8_t type;
+	uint8_t name[256];
+	uint8_t uuid[16];
+	int32_t channel;
+	uint8_t flags;
 } __attribute__((packed));
 
 #define HAL_OP_SOCK_CONNECT		0x02
 struct hal_cmd_sock_connect {
-	uint8_t  bdaddr[6];
-	uint8_t  type;
-	uint8_t  uuid[16];
-	uint16_t channel;
-	uint8_t  flags;
+	uint8_t bdaddr[6];
+	uint8_t type;
+	uint8_t uuid[16];
+	int32_t channel;
+	uint8_t flags;
 } __attribute__((packed));
 
 /* Bluetooth HID Host HAL API */
diff --git a/android/socket.c b/android/socket.c
index 11d64f8..f68fbf0 100644
--- a/android/socket.c
+++ b/android/socket.c
@@ -804,7 +804,7 @@ static void handle_listen(const void *buf, uint16_t len)
 
 	profile = get_profile_by_uuid(cmd->uuid);
 	if (!profile) {
-		if (!cmd->channel)
+		if (cmd->channel <= 0)
 			goto failed;
 
 		chan = cmd->channel;
-- 
1.8.5.2


^ permalink raw reply related

* Re: [PATCH 1/2] Bluetooth: Add quirk for disabling Delete Stored Link Key command
From: Johan Hedberg @ 2014-01-04 18:12 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth
In-Reply-To: <1388746956-9944-1-git-send-email-marcel@holtmann.org>

Hi Marcel,

On Fri, Jan 03, 2014, Marcel Holtmann wrote:
> Some controller pretend they support the Delete Stored Link Key command,
> but in reality they really don't support it.
> 
>   < HCI Command: Delete Stored Link Key (0x03|0x0012) plen 7
>       bdaddr 00:00:00:00:00:00 all 1
>   > HCI Event: Command Complete (0x0e) plen 4
>       Delete Stored Link Key (0x03|0x0012) ncmd 1
>       status 0x11 deleted 0
>       Error: Unsupported Feature or Parameter Value
> 
> Not correctly supporting this command causes the controller setup to
> fail and will make a device not work. However sending the command for
> controller that handle stored link keys is important. This quirk
> allows a driver to disable the command if it knows that this command
> handling is broken.
> 
> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
> ---
>  include/net/bluetooth/hci.h | 3 ++-
>  net/bluetooth/hci_core.c    | 7 ++++++-
>  2 files changed, 8 insertions(+), 2 deletions(-)

Both patches have been applied to the bluetooth-next tree. Thanks.

Johan

^ permalink raw reply

* [PATCH 2/2] rfcomm: move the device under its parent if already connected
From: Gianluca Anzolin @ 2014-01-04 16:30 UTC (permalink / raw)
  To: gustavo
  Cc: peter, marcel, linux-bluetooth, gregkh, jslaby, stable,
	Gianluca Anzolin
In-Reply-To: <1388853038-6917-1-git-send-email-gianluca@sottospazio.it>

This patch fixes a userspace regression introduced with the conversion
of the rfcomm tty code to a proper tty_port driver.

Currently the tty device is moved under the parent only when a
successful BT connection is established.

Unfortunately this doesn't take into account the situation in which the
BT connection is already there, i.e. when the rfcomm device is created
with the flag RFCOMM_REUSE_DLC: in this case the tty device is never
moved under its parent.

This causes a regression with ModemManager which checks the parent
device to determine if the tty is likely to be connected to a modem:
it finds a NULL parent and skip the AT probe sequence.

The patch fixes the regression by calling device_move() in the function
rfcomm_dev_carrier_raised().

Signed-off-by: Gianluca Anzolin <gianluca@sottospazio.it>
Reported-by: Beson Chow <blc+bluez@mail.vanade.com>
---
 net/bluetooth/rfcomm/tty.c | 47 ++++++++++++++++++++++++----------------------
 1 file changed, 25 insertions(+), 22 deletions(-)

diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index a535ef1..9e217d7 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -111,12 +111,34 @@ static int rfcomm_dev_activate(struct tty_port *port, struct tty_struct *tty)
 	return rfcomm_dlc_open(dev->dlc, &dev->src, &dev->dst, dev->channel);
 }
 
+static struct device *rfcomm_get_device(struct rfcomm_dev *dev)
+{
+	struct hci_dev *hdev;
+	struct hci_conn *conn;
+
+	hdev = hci_get_route(&dev->dst, &dev->src);
+	if (!hdev)
+		return NULL;
+
+	conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &dev->dst);
+
+	hci_dev_put(hdev);
+
+	return conn ? &conn->dev : NULL;
+}
+
 /* we block the open until the dlc->state becomes BT_CONNECTED */
 static int rfcomm_dev_carrier_raised(struct tty_port *port)
 {
 	struct rfcomm_dev *dev = container_of(port, struct rfcomm_dev, port);
 
-	return (dev->dlc->state == BT_CONNECTED);
+	if (dev->dlc->state == BT_CONNECTED) {
+		device_move(dev->tty_dev, rfcomm_get_device(dev),
+			    DPM_ORDER_DEV_AFTER_PARENT);
+		return 1;
+	}
+
+	return 0;
 }
 
 /* device-specific cleanup: close the dlc */
@@ -169,22 +191,6 @@ static struct rfcomm_dev *rfcomm_dev_get(int id)
 	return dev;
 }
 
-static struct device *rfcomm_get_device(struct rfcomm_dev *dev)
-{
-	struct hci_dev *hdev;
-	struct hci_conn *conn;
-
-	hdev = hci_get_route(&dev->dst, &dev->src);
-	if (!hdev)
-		return NULL;
-
-	conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &dev->dst);
-
-	hci_dev_put(hdev);
-
-	return conn ? &conn->dev : NULL;
-}
-
 static ssize_t show_address(struct device *tty_dev, struct device_attribute *attr, char *buf)
 {
 	struct rfcomm_dev *dev = dev_get_drvdata(tty_dev);
@@ -576,12 +582,9 @@ static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err)
 	BT_DBG("dlc %p dev %p err %d", dlc, dev, err);
 
 	dev->err = err;
-	if (dlc->state == BT_CONNECTED) {
-		device_move(dev->tty_dev, rfcomm_get_device(dev),
-			    DPM_ORDER_DEV_AFTER_PARENT);
-
+	if (dlc->state == BT_CONNECTED)
 		wake_up_interruptible(&dev->port.open_wait);
-	} else if (dlc->state == BT_CLOSED)
+	else if (dlc->state == BT_CLOSED)
 		tty_port_tty_hangup(&dev->port, false);
 }
 
-- 
1.8.5.2

^ permalink raw reply related

* [PATCH 1/2] rfcomm: release the port when the last user closes the tty
From: Gianluca Anzolin @ 2014-01-04 16:30 UTC (permalink / raw)
  To: gustavo
  Cc: peter, marcel, linux-bluetooth, gregkh, jslaby, stable,
	Gianluca Anzolin
In-Reply-To: <1388853038-6917-1-git-send-email-gianluca@sottospazio.it>

This patch fixes a userspace regression introduced by the commit
29cd718b.

If the rfcomm device was created with the flag RFCOMM_RELEASE_ONHUP the
user space expects that the tty_port is released as soon as the last
process closes the tty.

The current code attempts to release the port in the function
rfcomm_dev_state_change(). However it won't get a reference to the
relevant tty to send a HUP: at that point the tty is already destroyed
and therefore NULL.

This patch fixes the regression by taking over the tty refcount in the
tty install method(). This way the tty_port is automatically released as
soon as the tty is destroyed.

As a consequence the check for RFCOMM_RELEASE_ONHUP flag in the hangup()
method is now redundant. Instead we have to be careful with the reference
counting in the rfcomm_release_dev() function.

Signed-off-by: Gianluca Anzolin <gianluca@sottospazio.it>
Reported-by: Alexander Holler <holler@ahsoftware.de>
---
 net/bluetooth/rfcomm/tty.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index 84fcf9f..a535ef1 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -437,7 +437,8 @@ static int rfcomm_release_dev(void __user *arg)
 		tty_kref_put(tty);
 	}
 
-	if (!test_and_set_bit(RFCOMM_TTY_RELEASED, &dev->flags))
+	if (!test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags) &&
+	    !test_and_set_bit(RFCOMM_TTY_RELEASED, &dev->flags))
 		tty_port_put(&dev->port);
 
 	tty_port_put(&dev->port);
@@ -670,10 +671,20 @@ static int rfcomm_tty_install(struct tty_driver *driver, struct tty_struct *tty)
 
 	/* install the tty_port */
 	err = tty_port_install(&dev->port, driver, tty);
-	if (err)
+	if (err) {
 		rfcomm_tty_cleanup(tty);
+		return err;
+	}
 
-	return err;
+	/* take over the tty_port reference if the port was created with the
+	 * flag RFCOMM_RELEASE_ONHUP. This will force the release of the port
+	 * when the last process closes the tty. The behaviour is expected by
+	 * userspace.
+	 */
+	if (test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags))
+		tty_port_put(&dev->port);
+
+	return 0;
 }
 
 static int rfcomm_tty_open(struct tty_struct *tty, struct file *filp)
@@ -1010,10 +1021,6 @@ static void rfcomm_tty_hangup(struct tty_struct *tty)
 	BT_DBG("tty %p dev %p", tty, dev);
 
 	tty_port_hangup(&dev->port);
-
-	if (test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags) &&
-	    !test_and_set_bit(RFCOMM_TTY_RELEASED, &dev->flags))
-		tty_port_put(&dev->port);
 }
 
 static int rfcomm_tty_tiocmget(struct tty_struct *tty)
-- 
1.8.5.2

^ permalink raw reply related

* [PATCH 0/2] Regression fixes for rfcomm/tty.c
From: Gianluca Anzolin @ 2014-01-04 16:30 UTC (permalink / raw)
  To: gustavo
  Cc: peter, marcel, linux-bluetooth, gregkh, jslaby, stable,
	Gianluca Anzolin

The following two patches fix a couple of regressions introduced with
the rfcomm tty_port conversion.

The first patch restores the expected behaviour of the rfcomm port when
it's created with the flag RFCOMM_RELEASE_ONHUP.

The second patch fixes a bug that affect userspace (ModemManager) when
the port is created with the flag RFCOMM_REUSE_DLC.

Gianluca Anzolin (2):
  rfcomm: release the port when the last user closes the tty
  rfcomm: move the device under its parent if already connected

 net/bluetooth/rfcomm/tty.c | 68 ++++++++++++++++++++++++++--------------------
 1 file changed, 39 insertions(+), 29 deletions(-)

-- 
1.8.5.2

^ permalink raw reply

* Re: [REGRESSION] rfcomm (userland) broken by commit 29cd718b
From: Benson Chow @ 2014-01-04  4:32 UTC (permalink / raw)
  To: Gianluca Anzolin; +Cc: linux-bluetooth
In-Reply-To: <20131228084421.GA27196@sottospazio.it>

Gianluca,

This patch looks like it did it, from a quick check, everything looks like 
it's working as well as what it was before the 3.8 patch.

Thanks a bunch!

-Benson

On Sat, 28 Dec 2013, Gianluca Anzolin wrote:

> Date: Sat, 28 Dec 2013 09:44:21 +0100
> From: Gianluca Anzolin <gianluca@sottospazio.it>
> To: Benson Chow <blc+bluez@mail.vanade.com>
> Cc: linux-bluetooth@vger.kernel.org
> Subject: Re: [REGRESSION] rfcomm (userland) broken by commit 29cd718b
> 
> On Fri, Dec 27, 2013 at 04:01:27PM -0700, Benson Chow wrote:
>> First off, thanks for the fix to stop rfcomm from taking down the
>> machine. However, I have noted that blueman and
>> networkmanager/modemmanager no longer recognize the /dev/rfcomm0
>> device as a valid dialup device.  This seems to be a
>> kernel-userspace interface regression as I can boot into 3.6.11 and
>> it would work just fine.
>>
>> When I saw this thread, I agree there appears to be some
>> kernel-userspace changes that broke something, but the recent patch
>> still did not seem to let modemmanger detect the bluetooth device as
>> it did pre linux-3.12.
>>
>> Blueman reports "connection failed: modem manager did not support
>> the connection" implying there's still some userspace differences
>> from the old behavior.
>>
>> I do notice I can run a terminal emulator on /dev/rfcomm0 and able
>> to run modem AT-commands which means that I can communicate with the
>> phone through bluetooth, so that part is working.  Plus, tearing up
>> that connection no longer results in a crash like before linux-3.8.
>>
>> Any other information I could get from my system to help debug
>> what's going on here?  Or perhaps modem-manager will need to be
>> updated to work with the new behavior?
>>
>> Thanks,
>> -Benson
>
> Thank you for the report.
>
> Could you try the attached patch on top of the last rfc3.patch and see if it
> works?
>
> Regards,
> Gianluca
>

WARNING: All HTML emails get auto deleted.  DO NOT SEND HTML MAIL.
WARNING: Emails with large typo counts/spelling errors will also be deleted.

^ permalink raw reply

* [PATCH BlueZ 12/12] android/system-emulator: Remove useless "static" qualifier
From: Anderson Lizardo @ 2014-01-04  1:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo
In-Reply-To: <1388800528-10699-1-git-send-email-anderson.lizardo@openbossa.org>

The value of SYSTEM_SOCKET_PATH is just copied to another memory
location using memcpy() (on the same function), therefore the static
qualifier is unnecessary.
---
 android/system-emulator.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/android/system-emulator.c b/android/system-emulator.c
index 2dc9ad8..f1c6622 100644
--- a/android/system-emulator.c
+++ b/android/system-emulator.c
@@ -185,8 +185,7 @@ static void signal_callback(int signum, void *user_data)
 
 int main(int argc, char *argv[])
 {
-	static const char SYSTEM_SOCKET_PATH[] = "\0android_system";
-
+	const char SYSTEM_SOCKET_PATH[] = "\0android_system";
 	sigset_t mask;
 	struct sockaddr_un addr;
 	int fd;
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH BlueZ 11/12] android/client: Fix uninitialized "sock_fd" variable
From: Anderson Lizardo @ 2014-01-04  1:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo
In-Reply-To: <1388800528-10699-1-git-send-email-anderson.lizardo@openbossa.org>

If EXEC() macro is called with the first pointer argument NULL, sock_fd
will not be initialized. Given that the NULL check is not fatal, it is a
good idea to initialize the variable to -1 so the code has defined
behavior on this situation.

Detected by clang:

android/client/if-sock.c:251:7: error: variable 'sock_fd' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
---
 android/client/if-sock.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/android/client/if-sock.c b/android/client/if-sock.c
index 050bc96..4c1af82 100644
--- a/android/client/if-sock.c
+++ b/android/client/if-sock.c
@@ -207,7 +207,7 @@ static void listen_p(int argc, const char **argv)
 	const char *service_name;
 	bt_uuid_t service_uuid;
 	int channel;
-	int sock_fd;
+	int sock_fd = -1;
 	int flags;
 
 	RETURN_IF_NULL(if_sock);
@@ -281,7 +281,7 @@ static void connect_p(int argc, const char **argv)
 	btsock_type_t type;
 	bt_uuid_t uuid;
 	int channel;
-	int sock_fd;
+	int sock_fd = -1;
 	int flags;
 
 	/* Address */
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH BlueZ 10/12] android/client: Use memcpy() for getting CMSG_DATA()
From: Anderson Lizardo @ 2014-01-04  1:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo
In-Reply-To: <1388800528-10699-1-git-send-email-anderson.lizardo@openbossa.org>

This is how it is done in all other places in BlueZ. Also drop
unnecessary "descs" local variable.

Fixes clang error:

android/client/if-sock.c:164:11: error: cast from 'unsigned char *' to
'int *' increases required alignment from 1 to 4 [-Werror,-Wcast-align]
---
 android/client/if-sock.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/android/client/if-sock.c b/android/client/if-sock.c
index 5394a5d..050bc96 100644
--- a/android/client/if-sock.c
+++ b/android/client/if-sock.c
@@ -154,21 +154,19 @@ static void read_accepted(int fd)
 
 	for (cmsgptr = CMSG_FIRSTHDR(&msg);
 		cmsgptr != NULL; cmsgptr = CMSG_NXTHDR(&msg, cmsgptr)) {
-		int *descs;
 		int count;
 
 		if (cmsgptr->cmsg_level != SOL_SOCKET ||
 			cmsgptr->cmsg_type != SCM_RIGHTS)
 			continue;
 
-		descs = (int *) CMSG_DATA(cmsgptr);
+		memcpy(&accepted_fd, CMSG_DATA(cmsgptr), sizeof(accepted_fd));
 		count = ((cmsgptr->cmsg_len - CMSG_LEN(0)) / sizeof(int));
 
 		if (count != 1)
 			haltest_error("Failed to accept descriptors count=%d\n",
 									count);
 
-		accepted_fd = descs[0];
 		break;
 	}
 
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH BlueZ 09/12] android/client: Remove duplicate "const" specifier
From: Anderson Lizardo @ 2014-01-04  1:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo
In-Reply-To: <1388800528-10699-1-git-send-email-anderson.lizardo@openbossa.org>

Fixes clang errors like:

android/client/if-hh.c:181:39: error: duplicate 'const' declaration
specifier [-Werror,-Wduplicate-decl-specifier]
---
 android/client/if-hh.c  | 16 ++++++++--------
 android/client/if-pan.c |  8 ++++----
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/android/client/if-hh.c b/android/client/if-hh.c
index b8ebc8e..56eb698 100644
--- a/android/client/if-hh.c
+++ b/android/client/if-hh.c
@@ -178,7 +178,7 @@ static void init_p(int argc, const char **argv)
 
 /* connect */
 
-static void connect_c(int argc, const const char **argv, enum_func *enum_func,
+static void connect_c(int argc, const char **argv, enum_func *enum_func,
 								void **user)
 {
 	if (argc == 3) {
@@ -243,8 +243,8 @@ static void set_info_p(int argc, const char **argv)
 
 /* get_protocol */
 
-static void get_protocol_c(int argc, const const char **argv,
-					enum_func *enum_func, void **user)
+static void get_protocol_c(int argc, const char **argv, enum_func *enum_func,
+								void **user)
 {
 	if (argc == 3) {
 		*user = connected_device_addr;
@@ -296,8 +296,8 @@ static void set_protocol_p(int argc, const char **argv)
 
 /* get_report */
 
-static void get_report_c(int argc, const const char **argv,
-					enum_func *enum_func, void **user)
+static void get_report_c(int argc, const char **argv, enum_func *enum_func,
+								void **user)
 {
 	if (argc == 3) {
 		*user = connected_device_addr;
@@ -341,8 +341,8 @@ static void get_report_p(int argc, const char **argv)
 
 /* set_report */
 
-static void set_report_c(int argc, const const char **argv,
-					enum_func *enum_func, void **user)
+static void set_report_c(int argc, const char **argv, enum_func *enum_func,
+								void **user)
 {
 	if (argc == 3) {
 		*user = connected_device_addr;
@@ -377,7 +377,7 @@ static void set_report_p(int argc, const char **argv)
 
 /* send_data */
 
-static void send_data_c(int argc, const const char **argv, enum_func *enum_func,
+static void send_data_c(int argc, const char **argv, enum_func *enum_func,
 								void **user)
 {
 	if (argc == 3) {
diff --git a/android/client/if-pan.c b/android/client/if-pan.c
index a11f2a3..bdb36cc 100644
--- a/android/client/if-pan.c
+++ b/android/client/if-pan.c
@@ -80,7 +80,7 @@ static void init_p(int argc, const char **argv)
 
 /* enable */
 
-static void enable_c(int argc, const const char **argv, enum_func *enum_func,
+static void enable_c(int argc, const char **argv, enum_func *enum_func,
 								void **user)
 {
 	if (argc == 3) {
@@ -121,7 +121,7 @@ static void get_local_role_p(int argc, const char **argv)
 
 /* connect */
 
-static void connect_c(int argc, const const char **argv, enum_func *enum_func,
+static void connect_c(int argc, const char **argv, enum_func *enum_func,
 								void **user)
 {
 	if (argc == 3) {
@@ -165,8 +165,8 @@ static void connect_p(int argc, const char **argv)
 
 /* disconnect */
 
-static void disconnect_c(int argc, const const char **argv,
-					enum_func *enum_func, void **user)
+static void disconnect_c(int argc, const char **argv, enum_func *enum_func,
+								void **user)
 {
 	if (argc == 3) {
 		*user = last_used_addr;
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH BlueZ 08/12] android/client: Fix incorrect usage of bt_state_t2str()
From: Anderson Lizardo @ 2014-01-04  1:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo
In-Reply-To: <1388800528-10699-1-git-send-email-anderson.lizardo@openbossa.org>

Fixes clang error:

android/client/if-bt.c:313:54: error: implicit conversion from
enumeration type 'bt_status_t' to different enumeration type
'bt_state_t' [-Werror,-Wenum-conversion]
---
 android/client/if-bt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/android/client/if-bt.c b/android/client/if-bt.c
index 10b79f1..6771df4 100644
--- a/android/client/if-bt.c
+++ b/android/client/if-bt.c
@@ -310,7 +310,7 @@ static void dut_mode_recv_cb(uint16_t opcode, uint8_t *buf, uint8_t len)
 #if PLATFORM_SDK_VERSION > 17
 static void le_test_mode_cb(bt_status_t status, uint16_t num_packets)
 {
-	haltest_info("%s %s %d\n", __func__, bt_state_t2str(status),
+	haltest_info("%s %s %d\n", __func__, bt_status_t2str(status),
 								num_packets);
 }
 #endif
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH BlueZ 07/12] tools: Fix possible uninitialized variable in obexctl
From: Anderson Lizardo @ 2014-01-04  1:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo
In-Reply-To: <1388800528-10699-1-git-send-email-anderson.lizardo@openbossa.org>

On set_default_session(), if g_dbus_proxy_get_property() returns FALSE,
desc will be uninitialized. Given that this function already checks for
NULL proxy internally, it is enough to check whether it fails (and if
so, set a default prompt without destination).

Fixes this clang error:

tools/obexctl.c:439:6: error: variable 'desc' is used uninitialized
whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
---
 tools/obexctl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tools/obexctl.c b/tools/obexctl.c
index 2e38298..f0d5438 100644
--- a/tools/obexctl.c
+++ b/tools/obexctl.c
@@ -431,14 +431,12 @@ static void set_default_session(GDBusProxy *proxy)
 
 	default_session = proxy;
 
-	if (proxy == NULL) {
+	if (!g_dbus_proxy_get_property(proxy, "Destination", &iter)) {
 		desc = g_strdup(PROMPT_ON);
 		goto done;
 	}
 
-	if (g_dbus_proxy_get_property(proxy, "Destination", &iter))
-		dbus_message_iter_get_basic(&iter, &desc);
-
+	dbus_message_iter_get_basic(&iter, &desc);
 	desc = g_strdup_printf(COLOR_BLUE "[%s]" COLOR_OFF "# ", desc);
 
 done:
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH BlueZ 06/12] tools: Fix unaligned memory access on smp-tester
From: Anderson Lizardo @ 2014-01-04  1:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo
In-Reply-To: <1388800528-10699-1-git-send-email-anderson.lizardo@openbossa.org>

Fixes clang errors like:

tools/smp-tester.c:263:11: error: cast from 'uint8_t *' (aka 'unsigned
char *') to 'u128 *' increases required alignment from 1 to 8
[-Werror,-Wcast-align]
---
 tools/smp-tester.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/tools/smp-tester.c b/tools/smp-tester.c
index 685d379..20429a9 100644
--- a/tools/smp-tester.c
+++ b/tools/smp-tester.c
@@ -233,10 +233,16 @@ typedef struct {
 	uint64_t a, b;
 } u128;
 
-static inline void u128_xor(u128 *r, const u128 *p, const u128 *q)
+static inline void u128_xor(void *r, const void *p, const void *q)
 {
-	r->a = p->a ^ q->a;
-	r->b = p->b ^ q->b;
+	const u128 pp = bt_get_unaligned((const u128 *) p);
+	const u128 qq = bt_get_unaligned((const u128 *) q);
+	u128 rr;
+
+	rr.a = pp.a ^ qq.a;
+	rr.b = pp.b ^ qq.b;
+
+	bt_put_unaligned(rr, (u128 *) r);
 }
 
 static int smp_c1(uint8_t r[16], uint8_t res[16])
@@ -260,7 +266,7 @@ static int smp_c1(uint8_t r[16], uint8_t res[16])
 	baswap((bdaddr_t *) (p2 + 10), (bdaddr_t *) data->ra);
 
 	/* res = r XOR p1 */
-	u128_xor((u128 *) res, (u128 *) r, (u128 *) p1);
+	u128_xor(res, r, p1);
 
 	/* res = e(k, res) */
 	err = smp_e(data->smp_tk, res, res);
@@ -268,7 +274,7 @@ static int smp_c1(uint8_t r[16], uint8_t res[16])
 		return err;
 
 	/* res = res XOR p2 */
-	u128_xor((u128 *) res, (u128 *) res, (u128 *) p2);
+	u128_xor(res, res, p2);
 
 	/* res = e(k, res) */
 	return smp_e(data->smp_tk, res, res);
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH BlueZ 05/12] core: Fix sscanf() format specification
From: Anderson Lizardo @ 2014-01-04  1:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo
In-Reply-To: <1388800528-10699-1-git-send-email-anderson.lizardo@openbossa.org>

Also change the type of the "handle" variable so it is compatible with
the "%hu" specification used for sprintf() on the same function.

Fixes clang error:

src/adapter.c:3550:24: error: format specifies type 'unsigned short' but
the argument has type 'int' [-Werror,-Wformat]
---
 src/adapter.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index 9480103..230f3ce 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -3515,16 +3515,16 @@ static void convert_ccc_entry(char *key, char *value, void *user_data)
 	char *src_addr = user_data;
 	char dst_addr[18];
 	char type = BDADDR_BREDR;
-	int handle, ret;
+	uint16_t handle;
+	int ret, err;
 	char filename[PATH_MAX + 1];
 	GKeyFile *key_file;
 	struct stat st;
-	int err;
 	char group[6];
 	char *data;
 	gsize length = 0;
 
-	ret = sscanf(key, "%17s#%hhu#%04X", dst_addr, &type, &handle);
+	ret = sscanf(key, "%17s#%hhu#%04hX", dst_addr, &type, &handle);
 	if (ret < 3)
 		return;
 
@@ -3565,16 +3565,16 @@ static void convert_gatt_entry(char *key, char *value, void *user_data)
 	char *src_addr = user_data;
 	char dst_addr[18];
 	char type = BDADDR_BREDR;
-	int handle, ret;
+	uint16_t handle;
+	int ret, err;
 	char filename[PATH_MAX + 1];
 	GKeyFile *key_file;
 	struct stat st;
-	int err;
 	char group[6];
 	char *data;
 	gsize length = 0;
 
-	ret = sscanf(key, "%17s#%hhu#%04X", dst_addr, &type, &handle);
+	ret = sscanf(key, "%17s#%hhu#%04hX", dst_addr, &type, &handle);
 	if (ret < 3)
 		return;
 
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH BlueZ 04/12] attrib: Fix sprintf() format specification
From: Anderson Lizardo @ 2014-01-04  1:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo
In-Reply-To: <1388800528-10699-1-git-send-email-anderson.lizardo@openbossa.org>

Fixes clang error:

src/attrib-server.c:916:26: error: format specifies type 'unsigned char'
but the argument has type 'uint16_t' (aka 'unsigned short')
[-Werror,-Wformat]
---
 src/attrib-server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/attrib-server.c b/src/attrib-server.c
index a6f1066..a7ee55d 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -913,7 +913,7 @@ static uint16_t write_value(struct gatt_channel *channel, uint16_t handle,
 		g_key_file_load_from_file(key_file, filename, 0, NULL);
 
 		sprintf(group, "%hu", handle);
-		sprintf(value, "%hhX", cccval);
+		sprintf(value, "%hX", cccval);
 		g_key_file_set_string(key_file, group, "Value", value);
 
 		data = g_key_file_to_data(key_file, &length, NULL);
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH BlueZ 03/12] health: Fix struct mcap_csp "csp_req" field type
From: Anderson Lizardo @ 2014-01-04  1:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo
In-Reply-To: <1388800528-10699-1-git-send-email-anderson.lizardo@openbossa.org>

The values to which this field is set have nothing to do with MCAPCtrl.

Fixes clang error:

profiles/health/mcap_sync.c:767:24: error: comparison of constant 17
with expression of type 'MCAPCtrl' is always true
[-Werror,-Wtautological-constant-out-of-range-compare]
---
 profiles/health/mcap_sync.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/profiles/health/mcap_sync.c b/profiles/health/mcap_sync.c
index 0d9f17d..7c35e4a 100644
--- a/profiles/health/mcap_sync.c
+++ b/profiles/health/mcap_sync.c
@@ -55,7 +55,7 @@ struct mcap_csp {
 	guint		remote_caps;	/* CSP-Slave: remote master got caps */
 	guint		rem_req_acc;	/* CSP-Slave: accuracy required by master */
 	guint		ind_expected;	/* CSP-Master: indication expected */
-	MCAPCtrl	csp_req;	/* CSP-Master: Request control flag */
+	uint8_t		csp_req;	/* CSP-Master: Request control flag */
 	guint		ind_timer;	/* CSP-Slave: indication timer */
 	guint		set_timer;	/* CSP-Slave: delayed set timer */
 	void		*set_data;	/* CSP-Slave: delayed set data */
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH BlueZ 02/12] avrcp: Remove unnecessary "if (...)"
From: Anderson Lizardo @ 2014-01-04  1:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo
In-Reply-To: <1388800528-10699-1-git-send-email-anderson.lizardo@openbossa.org>

There is already a "if (type != 0x03 && type != 0x02)" check earlier on
the code, so a plain "if (...) else ..." is enough.

Fixes clang error:

profiles/audio/avrcp.c:2211:12: error: variable 'item' is used
uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
---
 profiles/audio/avrcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 2eb2ad6..8d4309a 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -2208,7 +2208,7 @@ static gboolean avrcp_list_items_rsp(struct avctp *conn, uint8_t *operands,
 
 		if (type == 0x03)
 			item = parse_media_element(session, &operands[i], len);
-		else if (type == 0x02)
+		else
 			item = parse_media_folder(session, &operands[i], len);
 
 		if (item) {
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH BlueZ 01/12] tools: Fix strncat() usage in hciconfig/hcitool
From: Anderson Lizardo @ 2014-01-04  1:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo
In-Reply-To: <1388800528-10699-1-git-send-email-anderson.lizardo@openbossa.org>

According to strncat() manpage:

"If src contains n or more characters, strncat() writes n+1 characters
to dest (n from src plus the terminating null byte).  Therefore, the
size of dest must be at least strlen(dest)+n+1"

While the current usage of strncat() cannot cause an overflow, if a
bigger string is added to the switch()'s without increasing the static
buffer, it would overflow by one byte due to the incorrect size
calculation.

Fixes clang errors like:

tools/hciconfig.c:827:33: error: the value of the size argument in
'strncat' is too large, might lead to a buffer overflow
[-Werror,-Wstrncat-size]
---
 tools/hciconfig.c | 21 ++++++++++++++-------
 tools/hcitool.c   | 23 +++++++++++++++--------
 2 files changed, 29 insertions(+), 15 deletions(-)

diff --git a/tools/hciconfig.c b/tools/hciconfig.c
index fe45167..6c7f8ed 100644
--- a/tools/hciconfig.c
+++ b/tools/hciconfig.c
@@ -824,25 +824,32 @@ static char *get_minor_device_name(int major, int minor)
 		case 0:
 			break;
 		case 1:
-			strncat(cls_str, "Joystick", sizeof(cls_str) - strlen(cls_str));
+			strncat(cls_str, "Joystick",
+					sizeof(cls_str) - strlen(cls_str) - 1);
 			break;
 		case 2:
-			strncat(cls_str, "Gamepad", sizeof(cls_str) - strlen(cls_str));
+			strncat(cls_str, "Gamepad",
+					sizeof(cls_str) - strlen(cls_str) - 1);
 			break;
 		case 3:
-			strncat(cls_str, "Remote control", sizeof(cls_str) - strlen(cls_str));
+			strncat(cls_str, "Remote control",
+					sizeof(cls_str) - strlen(cls_str) - 1);
 			break;
 		case 4:
-			strncat(cls_str, "Sensing device", sizeof(cls_str) - strlen(cls_str));
+			strncat(cls_str, "Sensing device",
+					sizeof(cls_str) - strlen(cls_str) - 1);
 			break;
 		case 5:
-			strncat(cls_str, "Digitizer tablet", sizeof(cls_str) - strlen(cls_str));
+			strncat(cls_str, "Digitizer tablet",
+					sizeof(cls_str) - strlen(cls_str) - 1);
 			break;
 		case 6:
-			strncat(cls_str, "Card reader", sizeof(cls_str) - strlen(cls_str));
+			strncat(cls_str, "Card reader",
+					sizeof(cls_str) - strlen(cls_str) - 1);
 			break;
 		default:
-			strncat(cls_str, "(reserved)", sizeof(cls_str) - strlen(cls_str));
+			strncat(cls_str, "(reserved)",
+					sizeof(cls_str) - strlen(cls_str) - 1);
 			break;
 		}
 		if (strlen(cls_str) > 0)
diff --git a/tools/hcitool.c b/tools/hcitool.c
index f2e4fa4..d85ece1 100644
--- a/tools/hcitool.c
+++ b/tools/hcitool.c
@@ -336,25 +336,32 @@ static char *get_minor_device_name(int major, int minor)
 		case 0:
 			break;
 		case 1:
-			strncat(cls_str, "Joystick", sizeof(cls_str) - strlen(cls_str));
+			strncat(cls_str, "Joystick",
+					sizeof(cls_str) - strlen(cls_str) - 1);
 			break;
 		case 2:
-			strncat(cls_str, "Gamepad", sizeof(cls_str) - strlen(cls_str));
+			strncat(cls_str, "Gamepad",
+					sizeof(cls_str) - strlen(cls_str) - 1);
 			break;
 		case 3:
-			strncat(cls_str, "Remote control", sizeof(cls_str) - strlen(cls_str));
+			strncat(cls_str, "Remote control",
+					sizeof(cls_str) - strlen(cls_str) - 1);
 			break;
 		case 4:
-			strncat(cls_str, "Sensing device", sizeof(cls_str) - strlen(cls_str));
+			strncat(cls_str, "Sensing device",
+					sizeof(cls_str) - strlen(cls_str) - 1);
 			break;
 		case 5:
-			strncat(cls_str, "Digitizer tablet", sizeof(cls_str) - strlen(cls_str));
-		break;
+			strncat(cls_str, "Digitizer tablet",
+					sizeof(cls_str) - strlen(cls_str) - 1);
+			break;
 		case 6:
-			strncat(cls_str, "Card reader", sizeof(cls_str) - strlen(cls_str));
+			strncat(cls_str, "Card reader",
+					sizeof(cls_str) - strlen(cls_str) - 1);
 			break;
 		default:
-			strncat(cls_str, "(reserved)", sizeof(cls_str) - strlen(cls_str));
+			strncat(cls_str, "(reserved)",
+					sizeof(cls_str) - strlen(cls_str) - 1);
 			break;
 		}
 		if (strlen(cls_str) > 0)
-- 
1.8.3.2


^ permalink raw reply related

* [PATCH BlueZ 00/12] Fixes detected by clang
From: Anderson Lizardo @ 2014-01-04  1:55 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo

Hi,

The patches on this set (except for the last patch) fix issues detected while
building BlueZ with clang. Note that these fixes were only compile tested (I
did run "make check" but it obviously does not cover code touched by these
patches). For strncat/sprintf/sscanf related patches, I did some tests with
sample code to make sure the changes worked as expected.

The last patch is a fix that I think should be inoffensive (unless there is
some clever hack going on there that I could not see.)

BTW, I've been experimenting with Travis CI for automatically running
build/unit tests for commits made on my personal development tree:
https://travis-ci.org/lizardo/bluez-devel. Enabling builds with clang (along
with gcc) was a one-line change to the configuration file. I plan in near
future to also run functional tests (right now it just runs "make check" and
"make distcheck")

Best Regards,
Anderson Lizardo

Anderson Lizardo (12):
  tools: Fix strncat() usage in hciconfig/hcitool
  avrcp: Remove unnecessary "if (...)"
  health: Fix struct mcap_csp "csp_req" field type
  attrib: Fix sprintf() format specification
  core: Fix sscanf() format specification
  tools: Fix unaligned memory access on smp-tester
  tools: Fix possible uninitialized variable in obexctl
  android/client: Fix incorrect usage of bt_state_t2str()
  android/client: Remove duplicate "const" specifier
  android/client: Use memcpy() for getting CMSG_DATA()
  android/client: Fix uninitialized "sock_fd" variable
  android/system-emulator: Remove useless "static" qualifier

 android/client/if-bt.c      |  2 +-
 android/client/if-hh.c      | 16 ++++++++--------
 android/client/if-pan.c     |  8 ++++----
 android/client/if-sock.c    |  8 +++-----
 android/system-emulator.c   |  3 +--
 profiles/audio/avrcp.c      |  2 +-
 profiles/health/mcap_sync.c |  2 +-
 src/adapter.c               | 12 ++++++------
 src/attrib-server.c         |  2 +-
 tools/hciconfig.c           | 21 ++++++++++++++-------
 tools/hcitool.c             | 23 +++++++++++++++--------
 tools/obexctl.c             |  6 ++----
 tools/smp-tester.c          | 16 +++++++++++-----
 13 files changed, 68 insertions(+), 53 deletions(-)

-- 
1.8.3.2


^ permalink raw reply

* Re: [PATCHv2] btdev: Return Command Status for Authentication Requested
From: Marcel Holtmann @ 2014-01-03 18:35 UTC (permalink / raw)
  To: Johan Hedberg
  Cc: Andrei Emeltchenko, linux-bluetooth@vger.kernel.org development
In-Reply-To: <20140103140046.GA12036@x220.p-661hnu-f1>

Hi Johan,

>> Add support for "Authentication Requested" command
>> ---
>> emulator/btdev.c | 7 +++++++
>> 1 file changed, 7 insertions(+)
>> 
>> diff --git a/emulator/btdev.c b/emulator/btdev.c
>> index 93361cd..0349f8a 100644
>> --- a/emulator/btdev.c
>> +++ b/emulator/btdev.c
>> @@ -269,6 +269,7 @@ static void set_bredr_commands(struct btdev *btdev)
>> 	btdev->commands[0]  |= 0x80;	/* Cancel Create Connection */
>> 	btdev->commands[1]  |= 0x01;	/* Accept Connection Request */
>> 	btdev->commands[1]  |= 0x02;	/* Reject Connection Request */
>> +	btdev->commands[1]  |= 0x80;	/* Authentication Requested */
>> 	btdev->commands[2]  |= 0x08;	/* Remote Name Request */
>> 	btdev->commands[2]  |= 0x10;	/* Cancel Remote Name Request */
>> 	btdev->commands[2]  |= 0x20;	/* Read Remote Supported Features */
>> @@ -1202,6 +1203,12 @@ static void default_cmd(struct btdev *btdev, uint16_t opcode,
>> 		cmd_status(btdev, BT_HCI_ERR_SUCCESS, opcode);
>> 		break;
>> 
>> +	case BT_HCI_CMD_AUTH_REQUESTED:
>> +		if (btdev->type == BTDEV_TYPE_LE)
>> +			goto unsupported;
>> +		cmd_status(btdev, BT_HCI_ERR_SUCCESS, opcode);
>> +		break;
>> +
>> 	case BT_HCI_CMD_REMOTE_NAME_REQUEST:
>> 		if (btdev->type == BTDEV_TYPE_LE)
>> 			goto unsupported;
> 
> I'd rather wait with this one until you've got a full set of patches
> that also implement the link key request event and the rest of the
> pairing procedure (if the link key request is followed by a negative
> link key reply).

since we do not install btvirt, I am fine if we even have incomplete functionality in it. However in this case we need to track if pairing is active. And also timeout the pairing. Otherwise everything will be blocked after one attempt.

So at minimum we need to store the current auth request state + start a timeout to make it timeout and send the auth failed event.

Regards

Marcel


^ permalink raw reply

* Re: [PATCH 2/3] btmon: Fix memory leak
From: Marcel Holtmann @ 2014-01-03 18:30 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth@vger.kernel.org development
In-Reply-To: <1388753686-29400-2-git-send-email-Andrei.Emeltchenko.news@gmail.com>

Hi Andrei,

> Dynamic memory stored in company allocated through function
> hwdb_get_company shall be freed.
> ---
> monitor/packet.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/monitor/packet.c b/monitor/packet.c
> index c991d04..b271cae 100644
> --- a/monitor/packet.c
> +++ b/monitor/packet.c
> @@ -408,18 +408,20 @@ static void print_addr(const char *label, const uint8_t *addr,
> 		if (!hwdb_get_company(addr, &company))
> 			company = NULL;
> 
> -		if (company)
> +		if (company) {
> 			print_field("%s: %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X"
> 					" (%s)", label, addr[5], addr[4],
> 							addr[3], addr[2],
> 							addr[1], addr[0],
> 							company);
> -		else
> +			free(company);

good catch. I totally forgot about the fact that the memory is allocated.

> +		} else {
> 			print_field("%s: %2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X"
> 					" (OUI %2.2X-%2.2X-%2.2X)", label,
> 						addr[5], addr[4], addr[3],
> 						addr[2], addr[1], addr[0],
> 						addr[5], addr[4], addr[3]);
> +		}
> 		break;

In userspace we do not require the else statement to be enclose by { } if the if part is as well. We usually don’t.

Regards

Marcel


^ permalink raw reply

* A problem with "rfcomm bind" and wvdial
From: Andrey Vihrov @ 2014-01-03 18:24 UTC (permalink / raw)
  To: linux-bluetooth


[-- Attachment #1.1: Type: text/plain, Size: 1643 bytes --]

Hello,

I'm writing to this mailing list because I was told on IRC that it's the
best place to discuss Linux Bluetooth problems, and I want to report
one.

I have a Nokia N70 phone which I use as a modem through Bluetooth. Up
until recently (~half a year ago), my workflow to establish a connection
was to

a) Call "rfcomm bind /dev/rfcomm0 <addr> <channel>" at system start (in
the past I also used /etc/bluetooth/rfcomm.conf, but that stopped
working at some point)
b) Run wvdial, which will open /dev/rfcomm0 as a modem/serial port

Now, however, when I run wvdial, I get

  Cannot open /dev/rfcomm0: Transport endpoint is not connected

I have found empirically that if I use "rfcomm connect" instead of
"rfcomm bind", and then run wvdial, then it works fine. Thus, it would
seem that the connection is not established automatically when an
application opens /dev/rfcomm0.

I have reproduced this on Arch Linux with BlueZ 5.13 and the
linux-bluetooth kernel. I'm also attaching logs of bluetoothd, btmon and
hcidump at the moment when wvdial is run.

Regarding the btmon log, I've observed that wvdial reports the
"Transport endpoint is not connected" error nearly at the same time as
the first

> HCI Event: Command Status (0x0f) plen 4                                                                                                                        [hci0] 3.436738
      Create Connection (0x01|0x0005) ncmd 1
        Status: Success (0x00)

is printed, and the rest of the log is printed when wvdial has already
exited.

Thanks in advance,

-- 
Andrey Vihrov <andrey.vihrov@gmail.com>


[-- Attachment #1.2: bluetoothd --]
[-- Type: text/plain, Size: 11783 bytes --]

bluetoothd[4444]: Bluetooth daemon 5.13
bluetoothd[4444]: src/main.c:parse_config() parsing main.conf
bluetoothd[4444]: src/main.c:parse_config() discovto=0
bluetoothd[4444]: src/main.c:parse_config() pairto=0
bluetoothd[4444]: src/main.c:parse_config() Key file does not have key 'AutoConnectTimeout'
bluetoothd[4444]: src/main.c:parse_config() name=%h
bluetoothd[4444]: src/main.c:parse_config() Key file does not have key 'Class'
bluetoothd[4444]: src/main.c:parse_config() Key file does not have key 'DeviceID'
bluetoothd[4444]: src/main.c:parse_config() Key file does not have key 'ReverseServiceDiscovery'
bluetoothd[4444]: src/adapter.c:adapter_init() sending read version command
bluetoothd[4444]: Starting SDP server
bluetoothd[4444]: src/sdpd-service.c:register_device_id() Adding device id record for 0002:1d6b:0246:050d
bluetoothd[4444]: src/plugin.c:plugin_init() Loading builtin plugins
bluetoothd[4444]: src/plugin.c:add_plugin() Loading hostname plugin
bluetoothd[4444]: src/plugin.c:add_plugin() Loading wiimote plugin
bluetoothd[4444]: src/plugin.c:add_plugin() Loading autopair plugin
bluetoothd[4444]: src/plugin.c:add_plugin() Loading policy plugin
bluetoothd[4444]: src/plugin.c:add_plugin() Loading a2dp plugin
bluetoothd[4444]: src/plugin.c:add_plugin() Loading avrcp plugin
bluetoothd[4444]: src/plugin.c:add_plugin() Loading network plugin
bluetoothd[4444]: src/plugin.c:add_plugin() Loading input plugin
bluetoothd[4444]: src/plugin.c:add_plugin() Loading hog plugin
bluetoothd[4444]: src/plugin.c:add_plugin() Loading gatt plugin
bluetoothd[4444]: src/plugin.c:add_plugin() Loading scanparam plugin
bluetoothd[4444]: src/plugin.c:add_plugin() Loading deviceinfo plugin
bluetoothd[4444]: src/plugin.c:plugin_init() Loading plugins /usr/lib/bluetooth/plugins
bluetoothd[4444]: profiles/input/suspend-dummy.c:suspend_init() 
bluetoothd[4444]: profiles/input/suspend-dummy.c:suspend_init() Created suspend-dummy FIFO on /tmp/hogsuspend
bluetoothd[4444]: profiles/network/manager.c:read_config() Config options: Security=true
bluetoothd[4444]: plugins/hostname.c:read_dmi_fallback() chassis: laptop
bluetoothd[4444]: plugins/hostname.c:read_dmi_fallback() major: 0x01 minor: 0x03
bluetoothd[4444]: src/main.c:main() Entering main loop
bluetoothd[4444]: plugins/hostname.c:property_changed() static hostname: tenshi
bluetoothd[4444]: plugins/hostname.c:property_changed() pretty hostname: 
bluetoothd[4444]: plugins/hostname.c:property_changed() chassis: laptop
bluetoothd[4444]: Bluetooth management interface 1.4 initialized
bluetoothd[4444]: src/adapter.c:read_version_complete() sending read supported commands command
bluetoothd[4444]: src/adapter.c:read_version_complete() sending read index list command
bluetoothd[4444]: src/rfkill.c:rfkill_event() RFKILL event idx 0 type 2 op 0 soft 0 hard 0
bluetoothd[4444]: src/adapter.c:read_commands_complete() Number of commands: 42
bluetoothd[4444]: src/adapter.c:read_commands_complete() Number of events: 21
bluetoothd[4444]: src/adapter.c:read_index_list_complete() Number of controllers: 1
bluetoothd[4444]: src/adapter.c:read_index_list_complete() Found index 0
bluetoothd[4444]: src/adapter.c:index_added() index 0
bluetoothd[4444]: src/adapter.c:btd_adapter_new() System name: %h
bluetoothd[4444]: src/adapter.c:btd_adapter_new() Major class: 0
bluetoothd[4444]: src/adapter.c:btd_adapter_new() Minor class: 0
bluetoothd[4444]: src/adapter.c:btd_adapter_new() Modalias: usb:v1D6Bp0246d050D
bluetoothd[4444]: src/adapter.c:btd_adapter_new() Discoverable timeout: 0 seconds
bluetoothd[4444]: src/adapter.c:btd_adapter_new() Pairable timeout: 0 seconds
bluetoothd[4444]: src/adapter.c:index_added() sending read info command for index 0
bluetoothd[4444]: src/adapter.c:read_info_complete() index 0 status 0x00
bluetoothd[4444]: src/adapter.c:clear_uuids() sending clear uuids command for index 0
bluetoothd[4444]: src/attrib-server.c:btd_adapter_gatt_server_start() Start GATT server in hci0
bluetoothd[4444]: src/attrib-server.c:attrib_db_add_new() handle=0x0001
bluetoothd[4444]: src/attrib-server.c:attrib_db_add_new() handle=0x0004
bluetoothd[4444]: src/attrib-server.c:attrib_db_add_new() handle=0x0006
bluetoothd[4444]: src/attrib-server.c:attrib_db_add_new() handle=0x0007
bluetoothd[4444]: src/attrib-server.c:attrib_db_add_new() handle=0x0008
bluetoothd[4444]: src/adapter.c:adapter_service_add() /org/bluez/hci0
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10001
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000007-0000-1000-8000-00805f9
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001800-0000-1000-8000-00805f9
bluetoothd[4444]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[4444]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[4444]: src/attrib-server.c:attrib_db_add_new() handle=0x0010
bluetoothd[4444]: src/adapter.c:adapter_service_add() /org/bluez/hci0
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10002
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000007-0000-1000-8000-00805f9
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001801-0000-1000-8000-00805f9
bluetoothd[4444]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[4444]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[4444]: profiles/audio/a2dp.c:media_server_probe() path /org/bluez/hci0
bluetoothd[4444]: plugins/hostname.c:hostname_probe() 
bluetoothd[4444]: plugins/hostname.c:update_name() name: tenshi
bluetoothd[4444]: src/adapter.c:adapter_set_name() name: tenshi
bluetoothd[4444]: src/adapter.c:adapter_set_name() alias: tenshi
bluetoothd[4444]: src/adapter.c:set_name() sending set local name command for index 0
bluetoothd[4444]: plugins/hostname.c:update_class() major: 0x01 minor: 0x03
bluetoothd[4444]: src/adapter.c:btd_adapter_set_class() class: major 1 minor 3
bluetoothd[4444]: src/adapter.c:set_dev_class() sending set device class command for index 0
bluetoothd[4444]: profiles/network/manager.c:panu_server_probe() path /org/bluez/hci0
bluetoothd[4444]: profiles/network/server.c:server_register() Registered interface org.bluez.NetworkServer1 on path /org/bluez/hci0
bluetoothd[4444]: profiles/network/manager.c:gn_server_probe() path /org/bluez/hci0
bluetoothd[4444]: profiles/network/manager.c:nap_server_probe() path /org/bluez/hci0
bluetoothd[4444]: profiles/audio/avrcp.c:avrcp_controller_server_probe() path /org/bluez/hci0
bluetoothd[4444]: src/adapter.c:adapter_service_add() /org/bluez/hci0
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10003
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000017-0000-1000-8000-00805f9
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000110e-0000-1000-8000-00805f9
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000110f-0000-1000-8000-00805f9
bluetoothd[4444]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[4444]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[4444]: profiles/audio/avrcp.c:avrcp_target_server_probe() path /org/bluez/hci0
bluetoothd[4444]: src/adapter.c:adapter_service_add() /org/bluez/hci0
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10004
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000017-0000-1000-8000-00805f9
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000110c-0000-1000-8000-00805f9
bluetoothd[4444]: src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000110e-0000-1000-8000-00805f9
bluetoothd[4444]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[4444]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[4444]: profiles/audio/a2dp.c:a2dp_sink_server_probe() path /org/bluez/hci0
bluetoothd[4444]: profiles/audio/a2dp.c:a2dp_source_server_probe() path /org/bluez/hci0
bluetoothd[4444]: src/adapter.c:btd_adapter_unblock_address() hci0 00:00:00:00:00:00
bluetoothd[4444]: src/device.c:device_create_from_storage() address 00:1B:33:57:E1:03
bluetoothd[4444]: src/device.c:device_new() address 00:1B:33:57:E1:03
bluetoothd[4444]: src/device.c:device_new() Creating device /org/bluez/hci0/dev_00_1B_33_57_E1_03
bluetoothd[4444]: src/device.c:device_probe_profiles() Probing profiles for device 00:1B:33:57:E1:03
bluetoothd[4444]: src/device.c:device_set_bonded() bonded 1
bluetoothd[4444]: src/adapter.c:load_link_keys() hci0 keys 1 debug_keys 0
bluetoothd[4444]: src/adapter.c:adapter_service_insert() /org/bluez/hci0
bluetoothd[4444]: src/adapter.c:add_uuid() sending add uuid command for index 0
bluetoothd[4444]: src/adapter.c:set_did() hci0 source 2 vendor 1d6b product 246 version 50d
bluetoothd[4444]: src/adapter.c:adapter_register() Adapter /org/bluez/hci0 registered
bluetoothd[4444]: src/adapter.c:set_dev_class() sending set device class command for index 0
bluetoothd[4444]: src/adapter.c:set_name() sending set local name command for index 0
bluetoothd[4444]: src/adapter.c:set_mode() sending set mode command for index 0
bluetoothd[4444]: src/adapter.c:set_mode() sending set mode command for index 0
bluetoothd[4444]: src/adapter.c:set_discoverable() sending set mode command for index 0
bluetoothd[4444]: src/adapter.c:load_link_keys_complete() link keys loaded for hci0
bluetoothd[4444]: src/adapter.c:property_set_mode() sending Set Powered command for index 0
bluetoothd[4444]: src/adapter.c:dev_class_changed_callback() Class: 0x00010c
bluetoothd[4444]: src/attrib-server.c:attrib_db_update() handle=0x0008
bluetoothd[4444]: src/adapter.c:property_set_mode_complete() Success (0x00)
bluetoothd[4444]: src/adapter.c:new_settings_callback() Settings: 0x0000009b
bluetoothd[4444]: src/adapter.c:settings_changed() Changed settings: 0x00000001
bluetoothd[4444]: src/adapter.c:adapter_start() adapter /org/bluez/hci0 has been enabled
bluetoothd[4444]: src/adapter.c:connected_callback() hci0 device 00:1B:33:57:E1:03 connected eir_len 8
bluetoothd[4444]: src/adapter.c:dev_disconnected() Device 00:1B:33:57:E1:03 disconnected, reason 2
bluetoothd[4444]: src/adapter.c:adapter_remove_connection() 
bluetoothd[4444]: src/adapter.c:bonding_attempt_complete() hci0 bdaddr 00:1B:33:57:E1:03 type 0 status 0xe
bluetoothd[4444]: src/device.c:device_bonding_complete() bonding (nil) status 0x0e
bluetoothd[4444]: src/device.c:device_bonding_failed() status 14
bluetoothd[4444]: src/adapter.c:resume_discovery() 

[-- Attachment #1.3: btmon --]
[-- Type: text/plain, Size: 11197 bytes --]

Bluetooth monitor ver 5.13
= New Index: 00:1F:E2:D9:95:A4 (BR/EDR,USB,hci0)                                                                                                                 [hci0] 0.040271
< HCI Command: Create Connection (0x01|0x0005) plen 13                                                                                                           [hci0] 3.434535
        Address: 00:1B:33:57:E1:03 (Nokia Danmark A/S)
        Packet type: 0xcc18
        Page scan repetition mode: R2 (0x02)
        Page scan mode: Mandatory (0x00)
        Clock offset: 0x0000
        Role switch: Allow slave (0x01)
> HCI Event: Command Status (0x0f) plen 4                                                                                                                        [hci0] 3.436738
      Create Connection (0x01|0x0005) ncmd 1
        Status: Success (0x00)
> HCI Event: Connect Complete (0x03) plen 11                                                                                                                     [hci0] 6.455010
        Status: Success (0x00)
        Handle: 11
        Address: 00:1B:33:57:E1:03 (Nokia Danmark A/S)
        Link type: ACL (0x01)
        Encryption: Disabled (0x00)
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2                                                                                               [hci0] 6.455259
        Handle: 11
> HCI Event: Read Remote Supported Features (0x0b) plen 11                                                                                                       [hci0] 6.456931
        Status: Success (0x00)
        Handle: 11
        Features: 0xbf 0xee 0x0f 0x46 0x98 0x19 0x00 0x00
          3 slot packets
          5 slot packets
          Encryption
          Slot offset
          Timing accuracy
          Role switch
          Sniff mode
          Power control requests
          Channel quality driven data rate (CQDDR)
          SCO link
          HV3 packets
          u-law log synchronous data
          A-law log synchronous data
          CVSD synchronous data
          Paging parameter negotiation
          Power control
          Transparent synchronous data
          Enhanced Data Rate ACL 2 Mbps mode
          Enhanced Data Rate ACL 3 Mbps mode
          RSSI with inquiry results
          AFH capable slave
          AFH classification slave
          3-slot Enhanced Data Rate ACL packets
          5-slot Enhanced Data Rate ACL packets
          AFH capable master
          AFH classification master
< ACL Data TX: Handle 11 flags 0x02 dlen 10                                                                                                                      [hci0] 6.457022
      L2CAP: Information Request (0x0a) ident 1 len 2
        Type: Extended features supported (0x0002)
> HCI Event: Command Status (0x0f) plen 4                                                                                                                        [hci0] 6.458891
      Read Remote Supported Features (0x01|0x001b) ncmd 1
        Status: Success (0x00)
< HCI Command: Remote Name Request (0x01|0x0019) plen 10                                                                                                         [hci0] 6.458911
        Address: 00:1B:33:57:E1:03 (Nokia Danmark A/S)
        Page scan repetition mode: R2 (0x02)
        Page scan mode: Mandatory (0x00)
        Clock offset: 0x0000
> HCI Event: Command Status (0x0f) plen 4                                                                                                                        [hci0] 6.459915
      Remote Name Request (0x01|0x0019) ncmd 1
        Status: Success (0x00)
> HCI Event: Page Scan Repetition Mode Change (0x20) plen 7                                                                                                      [hci0] 6.475926
        Address: 00:1B:33:57:E1:03 (Nokia Danmark A/S)
        Page scan repetition mode: R1 (0x01)
> HCI Event: Max Slots Change (0x1b) plen 3                                                                                                                      [hci0] 6.477917
        Handle: 11
        Max slots: 5
> HCI Event: Remote Name Req Complete (0x07) plen 255                                                                                                            [hci0] 6.534004
        Status: Success (0x00)
        Address: 00:1B:33:57:E1:03 (Nokia Danmark A/S)
        Name: Mokona
@ Device Connected: 00:1B:33:57:E1:03 (0) flags 0x0000
        07 09 4d 6f 6b 6f 6e 61                          ..Mokona        
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                           [hci0] 6.685951
        Num handles: 1
        Handle: 11
        Count: 1
> ACL Data RX: Handle 11 flags 0x02 dlen 16                                                                                                                      [hci0] 6.689951
      L2CAP: Information Response (0x0b) ident 1 len 8
        Type: Extended features supported (0x0002)
        Result: Success (0x0000)
        Features: 0x00000003
          Flow control mode
          Retransmission mode
< ACL Data TX: Handle 11 flags 0x02 dlen 12                                                                                                                      [hci0] 6.690033
      L2CAP: Connection Request (0x02) ident 2 len 4
        PSM: 3 (0x0003)
        Source CID: 64
> ACL Data RX: Handle 11 flags 0x02 dlen 10                                                                                                                      [hci0] 6.698952
      L2CAP: Information Request (0x0a) ident 1 len 2
        Type: Extended features supported (0x0002)
< ACL Data TX: Handle 11 flags 0x02 dlen 16                                                                                                                      [hci0] 6.699033
      L2CAP: Information Response (0x0b) ident 1 len 8
        Type: Extended features supported (0x0002)
        Result: Success (0x0000)
        Features: 0x000002b8
          Enhanced Retransmission Mode
          Streaming Mode
          FCS Option
          Fixed Channels
          Unicast Connectionless Data Reception
> ACL Data RX: Handle 11 flags 0x02 dlen 16                                                                                                                      [hci0] 6.700917
      L2CAP: Connection Response (0x03) ident 2 len 8
        Destination CID: 64
        Source CID: 64
        Result: Connection successful (0x0000)
        Status: No further information available (0x0000)
< ACL Data TX: Handle 11 flags 0x02 dlen 16                                                                                                                      [hci0] 6.700987
      L2CAP: Configure Request (0x04) ident 3 len 8
        Destination CID: 64
        Flags: 0x0000
        Option: Maximum Transmission Unit (0x01)
          MTU: 1013
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                           [hci0] 6.702942
        Num handles: 1
        Handle: 11
        Count: 2
> ACL Data RX: Handle 11 flags 0x02 dlen 12                                                                                                                      [hci0] 6.707953
      L2CAP: Configure Request (0x04) ident 2 len 4
        Destination CID: 64
        Flags: 0x0000
< ACL Data TX: Handle 11 flags 0x02 dlen 18                                                                                                                      [hci0] 6.708040
      L2CAP: Configure Response (0x05) ident 2 len 10
        Source CID: 64
        Flags: 0x0000
        Result: Success (0x0000)
        Option: Maximum Transmission Unit (0x01)
          MTU: 672
> ACL Data RX: Handle 11 flags 0x02 dlen 18                                                                                                                      [hci0] 6.708953
      L2CAP: Configure Response (0x05) ident 3 len 10
        Source CID: 64
        Flags: 0x0000
        Result: Success (0x0000)
        Option: Maximum Transmission Unit (0x01)
          MTU: 672
< ACL Data TX: Handle 11 flags 0x02 dlen 8                                                                                                                       [hci0] 6.709118
      Channel: 64 len 4 [PSM 3 mode 0] {chan 0}
        03 3f 01 1c                                      .?..            
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                           [hci0] 6.712024
        Num handles: 1
        Handle: 11
        Count: 2
> ACL Data RX: Handle 11 flags 0x02 dlen 8                                                                                                                       [hci0] 6.715916
      Channel: 64 len 4 [PSM 3 mode 0] {chan 0}
        03 73 01 d7                                      .s..            
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                           [hci0] 6.936047
        Num handles: 1
        Handle: 11
        Count: 1
> ACL Data RX: Handle 11 flags 0x02 dlen 12                                                                                                                      [hci0] 8.730078
      L2CAP: Disconnection Request (0x06) ident 3 len 4
        Destination CID: 64
        Source CID: 64
< ACL Data TX: Handle 11 flags 0x02 dlen 12                                                                                                                      [hci0] 8.730170
      L2CAP: Disconnection Response (0x07) ident 3 len 4
        Destination CID: 64
        Source CID: 64
> HCI Event: Number of Completed Packets (0x13) plen 5                                                                                                           [hci0] 8.936081
        Num handles: 1
        Handle: 11
        Count: 1
< HCI Command: Disconnect (0x01|0x0006) plen 3                                                                                                                  [hci0] 10.732120
        Handle: 11
        Reason: Remote User Terminated Connection (0x13)
> HCI Event: Command Status (0x0f) plen 4                                                                                                                       [hci0] 10.735276
      Disconnect (0x01|0x0006) ncmd 1
        Status: Success (0x00)
> HCI Event: Disconnect Complete (0x05) plen 4                                                                                                                  [hci0] 10.898262
        Status: Success (0x00)
        Handle: 11
        Reason: Connection Terminated By Local Host (0x16)
@ Device Disconnected: 00:1B:33:57:E1:03 (0) reason 2

[-- Attachment #1.4: hcidump --]
[-- Type: text/plain, Size: 3809 bytes --]

HCI sniffer - Bluetooth packet analyzer ver 5.13
device: hci0 snap_len: 1500 filter: 0xffffffffffffffff
< HCI Command: Create Connection (0x01|0x0005) plen 13
    bdaddr 00:1B:33:*:*:* ptype 0xcc18 rswitch 0x01 clkoffset 0x0000
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 
> HCI Event: Command Status (0x0f) plen 4
    Create Connection (0x01|0x0005) status 0x00 ncmd 1
> HCI Event: Connect Complete (0x03) plen 11
    status 0x00 handle 11 bdaddr 00:1B:33:*:*:* type ACL encrypt 0x00
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
    handle 11
> HCI Event: Read Remote Supported Features (0x0b) plen 11
    status 0x00 handle 11
    Features: 0xbf 0xee 0x0f 0x46 0x98 0x19 0x00 0x00
< ACL data: handle 11 flags 0x02 dlen 10
    L2CAP(s): Info req: type 2
> HCI Event: Command Status (0x0f) plen 4
    Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 1
< HCI Command: Remote Name Request (0x01|0x0019) plen 10
    bdaddr 00:1B:33:*:*:* mode 2 clkoffset 0x0000
> HCI Event: Command Status (0x0f) plen 4
    Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
> HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
    bdaddr 00:1B:33:*:*:* mode 1
> HCI Event: Max Slots Change (0x1b) plen 3
    handle 11 slots 5
> HCI Event: Remote Name Req Complete (0x07) plen 255
    status 0x00 bdaddr 00:1B:33:*:*:* name 'Mokona'
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 1
> ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
      Extended feature mask 0x0003
        Flow control mode
        Retransmission mode
< ACL data: handle 11 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 3 scid 0x0040
> ACL data: handle 11 flags 0x02 dlen 10
    L2CAP(s): Info req: type 2
< ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Info rsp: type 2 result 0
      Extended feature mask 0x02b8
        Enhanced Retransmission mode
        Streaming mode
        FCS Option
        Fixed Channels
        Unicast Connectless Data Reception
> ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0
      Connection successful
< ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
      MTU 1013 
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
> ACL data: handle 11 flags 0x02 dlen 12
    L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 0
< ACL data: handle 11 flags 0x02 dlen 18
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
      MTU 672 
> ACL data: handle 11 flags 0x02 dlen 18
    L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 4
      MTU 672 
< ACL data: handle 11 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): SABM: cr 1 dlci 0 pf 1 ilen 0 fcs 0x1c 
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 2
> ACL data: handle 11 flags 0x02 dlen 8
    L2CAP(d): cid 0x0040 len 4 [psm 3]
      RFCOMM(s): UA: cr 1 dlci 0 pf 1 ilen 0 fcs 0xd7 
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 1
> ACL data: handle 11 flags 0x02 dlen 12
    L2CAP(s): Disconn req: dcid 0x0040 scid 0x0040
< ACL data: handle 11 flags 0x02 dlen 12
    L2CAP(s): Disconn rsp: dcid 0x0040 scid 0x0040
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 11 packets 1
< HCI Command: Disconnect (0x01|0x0006) plen 3
    handle 11 reason 0x13
    Reason: Remote User Terminated Connection
> HCI Event: Command Status (0x0f) plen 4
    Disconnect (0x01|0x0006) status 0x00 ncmd 1
> HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 11 reason 0x16
    Reason: Connection Terminated by Local Host

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply

* Re: [PATCHv2] btdev: Return Command Status for Authentication Requested
From: Johan Hedberg @ 2014-01-03 14:00 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth
In-Reply-To: <1388756754-30760-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

Hi Andrei,

On Fri, Jan 03, 2014, Andrei Emeltchenko wrote:
> Add support for "Authentication Requested" command
> ---
>  emulator/btdev.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/emulator/btdev.c b/emulator/btdev.c
> index 93361cd..0349f8a 100644
> --- a/emulator/btdev.c
> +++ b/emulator/btdev.c
> @@ -269,6 +269,7 @@ static void set_bredr_commands(struct btdev *btdev)
>  	btdev->commands[0]  |= 0x80;	/* Cancel Create Connection */
>  	btdev->commands[1]  |= 0x01;	/* Accept Connection Request */
>  	btdev->commands[1]  |= 0x02;	/* Reject Connection Request */
> +	btdev->commands[1]  |= 0x80;	/* Authentication Requested */
>  	btdev->commands[2]  |= 0x08;	/* Remote Name Request */
>  	btdev->commands[2]  |= 0x10;	/* Cancel Remote Name Request */
>  	btdev->commands[2]  |= 0x20;	/* Read Remote Supported Features */
> @@ -1202,6 +1203,12 @@ static void default_cmd(struct btdev *btdev, uint16_t opcode,
>  		cmd_status(btdev, BT_HCI_ERR_SUCCESS, opcode);
>  		break;
>  
> +	case BT_HCI_CMD_AUTH_REQUESTED:
> +		if (btdev->type == BTDEV_TYPE_LE)
> +			goto unsupported;
> +		cmd_status(btdev, BT_HCI_ERR_SUCCESS, opcode);
> +		break;
> +
>  	case BT_HCI_CMD_REMOTE_NAME_REQUEST:
>  		if (btdev->type == BTDEV_TYPE_LE)
>  			goto unsupported;

I'd rather wait with this one until you've got a full set of patches
that also implement the link key request event and the rest of the
pairing procedure (if the link key request is followed by a negative
link key reply).

Johan

^ permalink raw reply

* Re: [PATCH 1/3] btinfo: Add missing socket close() on exit
From: Johan Hedberg @ 2014-01-03 13:53 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth
In-Reply-To: <1388753686-29400-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

Hi Andrei,

On Fri, Jan 03, 2014, Andrei Emeltchenko wrote:
> ---
>  tools/btinfo.c | 2 ++
>  1 file changed, 2 insertions(+)

All three patches have been applied. Thanks.

Johan

^ permalink raw reply

* Re: [PATCH] android/tester: Fix NULL dereference in socket setup
From: Johan Hedberg @ 2014-01-03 13:48 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth
In-Reply-To: <1388744774-17418-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

Hi Andrei,

On Fri, Jan 03, 2014, Andrei Emeltchenko wrote:
> Add return statement to avoid NULL dereference in socket setup.
> ---
>  android/android-tester.c | 2 ++
>  1 file changed, 2 insertions(+)

Applied. Thanks.

Johan

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox