linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] android/client: Fix missing new line character
@ 2015-04-29  9:15 Grzegorz Kolodziejczyk
  2015-04-29  9:15 ` [PATCH 2/4] android/gatt: Remove redundant comment line Grzegorz Kolodziejczyk
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Grzegorz Kolodziejczyk @ 2015-04-29  9:15 UTC (permalink / raw)
  To: linux-bluetooth

New line character is missing for haltest_info. Without this logs are
distorted after receiving configure mtu callback log.
---
 android/client/if-gatt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/android/client/if-gatt.c b/android/client/if-gatt.c
index 70287fc..e66cc20 100644
--- a/android/client/if-gatt.c
+++ b/android/client/if-gatt.c
@@ -679,7 +679,7 @@ static void gattc_listen_cb(int status, int client_if)
 /* Callback invoked when the MTU for a given connection changes */
 static void gattc_configure_mtu_cb(int conn_id, int status, int mtu)
 {
-	haltest_info("%s: conn_id=%d, status=%d, mtu=%d", __func__, conn_id,
+	haltest_info("%s: conn_id=%d, status=%d, mtu=%d\n", __func__, conn_id,
 								status, mtu);
 }
 
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] android/gatt: Remove redundant comment line
  2015-04-29  9:15 [PATCH 1/4] android/client: Fix missing new line character Grzegorz Kolodziejczyk
@ 2015-04-29  9:15 ` Grzegorz Kolodziejczyk
  2015-04-29  9:15 ` [PATCH 3/4] android/gatt: Send notify mtu change for BR/EDR success conn Grzegorz Kolodziejczyk
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Grzegorz Kolodziejczyk @ 2015-04-29  9:15 UTC (permalink / raw)
  To: linux-bluetooth

This patch removes redundant line from multiple line comment.
---
 android/gatt.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/android/gatt.c b/android/gatt.c
index 4da959f..656abfc 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -1642,7 +1642,6 @@ reply:
 			/*
 			 * There is no ongoing bonding, lets search for primary
 			 * services
-			 *
 			 */
 			search_dev_for_srvc(conn, NULL);
 	}
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] android/gatt: Send notify mtu change for BR/EDR success conn
  2015-04-29  9:15 [PATCH 1/4] android/client: Fix missing new line character Grzegorz Kolodziejczyk
  2015-04-29  9:15 ` [PATCH 2/4] android/gatt: Remove redundant comment line Grzegorz Kolodziejczyk
@ 2015-04-29  9:15 ` Grzegorz Kolodziejczyk
  2015-04-29  9:15 ` [PATCH 4/4] android/gatt: Fix updating mtu for no registered app Grzegorz Kolodziejczyk
  2015-05-08 13:03 ` [PATCH 1/4] android/client: Fix missing new line character Szymon Janc
  3 siblings, 0 replies; 5+ messages in thread
From: Grzegorz Kolodziejczyk @ 2015-04-29  9:15 UTC (permalink / raw)
  To: linux-bluetooth

This patch fixes sending mtu change notification for BR/EDR gatt
connections. For unsuccessful connection, notify mtu change shouldn't be
sent. This avoid sending bogus mtu values as notify mtu change.
---
 android/gatt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/android/gatt.c b/android/gatt.c
index 656abfc..04f89af 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -1652,7 +1652,7 @@ reply:
 									&data);
 
 	/* For BR/EDR notify about MTU since it is not negotiable*/
-	if (cid != ATT_CID)
+	if (cid != ATT_CID && status == GATT_SUCCESS)
 		queue_foreach(app_connections, notify_mtu_change, dev);
 
 	device_unref(dev);
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] android/gatt: Fix updating mtu for no registered app
  2015-04-29  9:15 [PATCH 1/4] android/client: Fix missing new line character Grzegorz Kolodziejczyk
  2015-04-29  9:15 ` [PATCH 2/4] android/gatt: Remove redundant comment line Grzegorz Kolodziejczyk
  2015-04-29  9:15 ` [PATCH 3/4] android/gatt: Send notify mtu change for BR/EDR success conn Grzegorz Kolodziejczyk
@ 2015-04-29  9:15 ` Grzegorz Kolodziejczyk
  2015-05-08 13:03 ` [PATCH 1/4] android/client: Fix missing new line character Szymon Janc
  3 siblings, 0 replies; 5+ messages in thread
From: Grzegorz Kolodziejczyk @ 2015-04-29  9:15 UTC (permalink / raw)
  To: linux-bluetooth

Gatt shouldn't notify about updating mtu if no apps are registered.
Without this patch, while connecting crash can occur.
---
 android/gatt.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/android/gatt.c b/android/gatt.c
index 04f89af..157b89d 100644
--- a/android/gatt.c
+++ b/android/gatt.c
@@ -978,6 +978,11 @@ static void notify_mtu_change(void *data, void *user_data)
 	if (conn->device != device)
 		return;
 
+	if (!conn->app) {
+		error("gatt: can't notify mtu - no app registered for conn");
+		return;
+	}
+
 	switch (conn->app->type) {
 	case GATT_CLIENT:
 		notify_client_mtu_change(conn, true);
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/4] android/client: Fix missing new line character
  2015-04-29  9:15 [PATCH 1/4] android/client: Fix missing new line character Grzegorz Kolodziejczyk
                   ` (2 preceding siblings ...)
  2015-04-29  9:15 ` [PATCH 4/4] android/gatt: Fix updating mtu for no registered app Grzegorz Kolodziejczyk
@ 2015-05-08 13:03 ` Szymon Janc
  3 siblings, 0 replies; 5+ messages in thread
From: Szymon Janc @ 2015-05-08 13:03 UTC (permalink / raw)
  To: Grzegorz Kolodziejczyk; +Cc: linux-bluetooth

Hi Grzegorz,

On Wednesday 29 of April 2015 11:15:50 Grzegorz Kolodziejczyk wrote:
> New line character is missing for haltest_info. Without this logs are
> distorted after receiving configure mtu callback log.
> ---
>  android/client/if-gatt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/android/client/if-gatt.c b/android/client/if-gatt.c
> index 70287fc..e66cc20 100644
> --- a/android/client/if-gatt.c
> +++ b/android/client/if-gatt.c
> @@ -679,7 +679,7 @@ static void gattc_listen_cb(int status, int client_if)
>  /* Callback invoked when the MTU for a given connection changes */
>  static void gattc_configure_mtu_cb(int conn_id, int status, int mtu)
>  {
> -	haltest_info("%s: conn_id=%d, status=%d, mtu=%d", __func__, conn_id,
> +	haltest_info("%s: conn_id=%d, status=%d, mtu=%d\n", __func__, conn_id,
>  								status, mtu);
>  }

All patches applied, thanks.

-- 
BR
Szymon Janc

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-05-08 13:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-29  9:15 [PATCH 1/4] android/client: Fix missing new line character Grzegorz Kolodziejczyk
2015-04-29  9:15 ` [PATCH 2/4] android/gatt: Remove redundant comment line Grzegorz Kolodziejczyk
2015-04-29  9:15 ` [PATCH 3/4] android/gatt: Send notify mtu change for BR/EDR success conn Grzegorz Kolodziejczyk
2015-04-29  9:15 ` [PATCH 4/4] android/gatt: Fix updating mtu for no registered app Grzegorz Kolodziejczyk
2015-05-08 13:03 ` [PATCH 1/4] android/client: Fix missing new line character Szymon Janc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).