linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Inga Stotland <ingas@codeaurora.org>
To: linux-bluetooth@vger.kernel.org
Cc: rshaffer@codeaurora.org, johan.hedberg@gmail.com,
	marcel@holtmann.org, Inga Stotland <ingas@codeaurora.org>
Subject: [PATCH 4/6] Fix in logic to write EIR when SDP records are changed.
Date: Sat, 31 Jul 2010 04:45:10 -0700	[thread overview]
Message-ID: <1280576713-1398-5-git-send-email-ingas@codeaurora.org> (raw)
In-Reply-To: <1280576713-1398-1-git-send-email-ingas@codeaurora.org>

Whenver SDP service record is added/deleted/modified check for whether 
class of device needs to be updated as well. If the update is 
needed, proceed as before and new EIR will be written subsequently. 
If the class of device is already present, just update EIR and return.
---
 src/adapter.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index 789a196..af60495 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -137,6 +137,8 @@ struct btd_adapter {
 	gint ref;
 };
 
+static void update_ext_inquiry_response(struct btd_adapter *adapter);
+
 static void adapter_set_pairable_timeout(struct btd_adapter *adapter,
 					guint interval);
 
@@ -216,11 +218,15 @@ static int adapter_set_service_classes(struct btd_adapter *adapter,
 	adapter->wanted_cod &= 0x00ffff;
 	adapter->wanted_cod |= (value << 16);
 
-	/* If we already have the CoD we want or the cache is enabled or an
-	 * existing CoD write is in progress just bail out */
-	if (adapter->current_cod == adapter->wanted_cod ||
-			adapter->cache_enable || adapter->pending_cod)
+	/* If the cache is enabled or an existing CoD write is in progress
+	 * just bail out */
+	if(adapter->cache_enable || adapter->pending_cod)
 		return 0;
+	/* If we already have the CoD we want, update EIR and return */
+	if (adapter->current_cod == adapter->wanted_cod) {
+		update_ext_inquiry_response(adapter);
+		return 0;
+	}
 
 	DBG("Changing service classes to 0x%06x", adapter->wanted_cod);
 
-- 
1.7.2

-- 
Inga Stotland
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

  parent reply	other threads:[~2010-07-31 11:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-31 11:45 [PATCH v5 0/6] Enhanced support for extended inquiry response Inga Stotland
2010-07-31 11:45 ` [PATCH 1/6] Spec constants for Extended Inquiry Response field types Inga Stotland
2010-07-31 11:45 ` [PATCH 2/6] Clean up code that generates extended inquiry response Inga Stotland
2010-08-03  8:12   ` Johan Hedberg
2010-08-03 15:37     ` ingas
2010-08-03 16:26       ` Johan Hedberg
2010-07-31 11:45 ` [PATCH 3/6] Support for adding UUID128 to " Inga Stotland
2010-08-03  8:18   ` Johan Hedberg
2010-07-31 11:45 ` Inga Stotland [this message]
2010-08-03  8:23   ` [PATCH 4/6] Fix in logic to write EIR when SDP records are changed Johan Hedberg
2010-07-31 11:45 ` [PATCH 5/6] Handle arrays in device properties dictionary Inga Stotland
2010-07-31 11:45 ` [PATCH 6/6] Support for generating dictionary value of service UUIDs Inga Stotland
2010-08-03  8:36   ` Johan Hedberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1280576713-1398-5-git-send-email-ingas@codeaurora.org \
    --to=ingas@codeaurora.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=rshaffer@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).