* [PATCH 2/2] Bluetooth: Increment Management interface revision
From: Johan Hedberg @ 2013-01-26 22:33 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1359239630-3579-1-git-send-email-johan.hedberg@gmail.com>
From: Johan Hedberg <johan.hedberg@intel.com>
The fixing of several mgmt issues, such as the correct handling of 32
and 128 bit UUIDs means that it is now safe for user space to send such
commands. However, user space needs a way to detect that it is safe, so
increment the mgmt revision so that it can be checked against.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
net/bluetooth/mgmt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index f6ef8ff..8e69d89 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -35,7 +35,7 @@
bool enable_hs;
#define MGMT_VERSION 1
-#define MGMT_REVISION 2
+#define MGMT_REVISION 3
static const u16 mgmt_commands[] = {
MGMT_OP_READ_INDEX_LIST,
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH BlueZ] avctp: Handle Vol Up/Down operations
From: Luiz Augusto von Dentz @ 2013-01-26 23:05 UTC (permalink / raw)
To: João Paulo Rechi Vita; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <1359136498-18725-1-git-send-email-jprvita@openbossa.org>
Hi Joao,
On Fri, Jan 25, 2013 at 7:54 PM, João Paulo Rechi Vita
<jprvita@openbossa.org> wrote:
> The AVRCP spec mandates to support 'volume up' and 'volume down'
> operations when claiming support for Category 2 TG.
> ---
> profiles/audio/avctp.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c
> index d2dce3e..28c414d 100644
> --- a/profiles/audio/avctp.c
> +++ b/profiles/audio/avctp.c
> @@ -213,6 +213,8 @@ static struct {
> uint8_t avc;
> uint16_t uinput;
> } key_map[] = {
> + { "VOLUME UP", AVC_VOLUME_UP, KEY_VOLUMEUP},
> + { "VOLUME DOWN", AVC_VOLUME_DOWN, KEY_VOLUMEDOWN},
> { "PLAY", AVC_PLAY, KEY_PLAYCD },
> { "STOP", AVC_STOP, KEY_STOPCD },
> { "PAUSE", AVC_PAUSE, KEY_PAUSECD },
> --
> 1.7.11.7
>
Applied, thanks.
--
Luiz Augusto von Dentz
^ permalink raw reply
* Re: [PATCH 3/9 v4] Bluetooth: Keep track of UUID type upon addition
From: Marcel Holtmann @ 2013-01-27 3:14 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth
In-Reply-To: <1359239495-3444-4-git-send-email-johan.hedberg@gmail.com>
Hi Johan,
> The primary purpose of the UUIDs is to enable generation of EIR and AD
> data. In these data formats the UUIDs are split into separate fields
> based on whether they're 16, 32 or 128 bit UUIDs. To make the generation
> of these data fields simpler this patch adds a type member to the
> bt_uuid struct and assigns a value to it as soon as the UUID is added to
> the kernel. This way the type doesn't need to be calculated each time
> the UUID list is later iterated.
>
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
> include/net/bluetooth/hci_core.h | 1 +
> net/bluetooth/mgmt.c | 48 ++++++++++++++++++--------------------
> 2 files changed, 24 insertions(+), 25 deletions(-)
>
> diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
> index bcf8ffe..90cf75a 100644
> --- a/include/net/bluetooth/hci_core.h
> +++ b/include/net/bluetooth/hci_core.h
> @@ -86,6 +86,7 @@ struct bdaddr_list {
> struct bt_uuid {
> struct list_head list;
> u8 uuid[16];
> + u8 size;
> u8 svc_hint;
> };
seems you just went for the size approach. Fine with me as well.
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Regards
Marcel
^ permalink raw reply
* Re: [PATCH 1/2] Bluetooth: Fix link security setting when powering on
From: Marcel Holtmann @ 2013-01-27 3:15 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth
In-Reply-To: <1359239630-3579-1-git-send-email-johan.hedberg@gmail.com>
Hi Johan,
> If a controller is powered on while the HCI_AUTO_OFF flag is set the
> link security setting (HCI_LINK_SECURITY) might not be in sync with the
> actual state of the controller (HCI_AUTH). This patch fixes the issue by
> checking for inequality between the intended and actual settings and
> sends a HCI_Write_Auth_Enable command if necessary.
>
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
> net/bluetooth/mgmt.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
> index fbc8edf..f6ef8ff 100644
> --- a/net/bluetooth/mgmt.c
> +++ b/net/bluetooth/mgmt.c
> @@ -3096,6 +3096,13 @@ int mgmt_powered(struct hci_dev *hdev, u8 powered)
> sizeof(cp), &cp);
> }
>
> + if (test_bit(HCI_LINK_SECURITY, &hdev->dev_flags) !=
> + test_bit(HCI_AUTH, &hdev->flags)) {
> + u8 val = test_bit(HCI_LINK_SECURITY, &hdev->dev_flags);
> + hci_send_cmd(hdev, HCI_OP_WRITE_AUTH_ENABLE,
> + sizeof(val), &val);
> + }
why not actually just test for the value and store its result, then
compare and then use the value. Testing HCI_LINK_SECURITY twice seems a
bit too much.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH] Bluetooth: btmrvl_sdio: look for sd8688 firmware in alternate place
From: Lubomir Rintel @ 2013-01-27 11:21 UTC (permalink / raw)
To: Ben Hutchings
Cc: Marcel Holtmann, David Woodhouse, Bing Zhao,
libertas-dev@lists.infradead.org, linux-bluetooth@vger.kernel.org,
Gustavo Padovan, Johan Hedberg, linux-kernel@vger.kernel.org
In-Reply-To: <1358730733.24121.228.camel@deadeye.wl.decadent.org.uk>
On Mon, 2013-01-21 at 01:12 +0000, Ben Hutchings wrote:
> On Fri, 2013-01-18 at 08:33 +0100, Lubomir Rintel wrote:
> > On Tue, 2013-01-08 at 22:35 -0800, Marcel Holtmann wrote:
> > > Hi Lubomir,
> > >
> > > > > > > linux-firmware ships the sd8688* firmware images that are shared with
> > > > > > > libertas_sdio WiFi driver under libertas/. libertas_sdio looks in both places
> > > > > > > and so should we.
> > > > > > >
> > > > > > > Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
> > > > > > > ---
> > > > > > > drivers/bluetooth/btmrvl_sdio.c | 24 ++++++++++++++++++++++--
> > > > > > > drivers/bluetooth/btmrvl_sdio.h | 6 ++++--
> > > > > > > 2 files changed, 26 insertions(+), 4 deletions(-)
> > > > > >
> > > > > > NAK from me on this one. I do not want the driver to check two
> > > > > > locations. That is what userspace can work around.
> > > > > >
> > > > > > If we want to unify the location between the WiFi driver and the
> > > > > > Bluetooth driver, I am fine with that, but seriously, just pick one over
> > > > > > the other. I do not care which one.
> > > > >
> > > > > The unified location is mrvl/ directory.
> > > > >
> > > > > We can probably move SD8688 firmware & helper binaries to mrvl/ and have both drivers grab the images there?
> > > >
> > > > That would break existing setups, wouldn't it?
> > > >
> > > > I was under impression (commit 3d32a58b) that we care about
> > > > compatibility here. Do we?
> > >
> > > that is what symlinks are for.
> >
> > David, Ben: please pull the following branch then:
> > git pull git://github.com/lkundrak/linux-firmware.git sd8688-move
> >
> > Thank you!
>
> The symlinks are broken, and you didn't update WHENCE.
Oops, sorry for that. Fixed now, please pull:
git pull git://github.com/lkundrak/linux-firmware.git sd8688-move
Thank you!
^ permalink raw reply
* [PATCH 1/2 v2] Bluetooth: Fix link security setting when powering on
From: Johan Hedberg @ 2013-01-27 14:32 UTC (permalink / raw)
To: linux-bluetooth
From: Johan Hedberg <johan.hedberg@intel.com>
If a controller is powered on while the HCI_AUTO_OFF flag is set the
link security setting (HCI_LINK_SECURITY) might not be in sync with the
actual state of the controller (HCI_AUTH). This patch fixes the issue by
checking for inequality between the intended and actual settings and
sends a HCI_Write_Auth_Enable command if necessary.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
net/bluetooth/mgmt.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index fbc8edf..ae7585d 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -3073,6 +3073,8 @@ int mgmt_powered(struct hci_dev *hdev, u8 powered)
mgmt_pending_foreach(MGMT_OP_SET_POWERED, hdev, settings_rsp, &match);
if (powered) {
+ u8 link_sec;
+
if (test_bit(HCI_SSP_ENABLED, &hdev->dev_flags) &&
!lmp_host_ssp_capable(hdev)) {
u8 ssp = 1;
@@ -3096,6 +3098,11 @@ int mgmt_powered(struct hci_dev *hdev, u8 powered)
sizeof(cp), &cp);
}
+ link_sec = test_bit(HCI_LINK_SECURITY, &hdev->dev_flags);
+ if (link_sec != test_bit(HCI_AUTH, &hdev->flags))
+ hci_send_cmd(hdev, HCI_OP_WRITE_AUTH_ENABLE,
+ sizeof(link_sec), &link_sec);
+
if (lmp_bredr_capable(hdev)) {
set_bredr_scan(hdev);
update_class(hdev);
--
1.7.10.4
^ permalink raw reply related
* [PATCH 2/2 v2] Bluetooth: Increment Management interface revision
From: Johan Hedberg @ 2013-01-27 14:32 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1359297121-9022-1-git-send-email-johan.hedberg@gmail.com>
From: Johan Hedberg <johan.hedberg@intel.com>
This patch increments the management interface revision due to the
various fixes, improvements and other changes that have gone in lately.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
net/bluetooth/mgmt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index ae7585d..3bd4c41 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -35,7 +35,7 @@
bool enable_hs;
#define MGMT_VERSION 1
-#define MGMT_REVISION 2
+#define MGMT_REVISION 3
static const u16 mgmt_commands[] = {
MGMT_OP_READ_INDEX_LIST,
--
1.7.10.4
^ permalink raw reply related
* Re: [PATCH 1/2 v2] Bluetooth: Fix link security setting when powering on
From: Marcel Holtmann @ 2013-01-27 14:36 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth
In-Reply-To: <1359297121-9022-1-git-send-email-johan.hedberg@gmail.com>
Hi Johan,
> If a controller is powered on while the HCI_AUTO_OFF flag is set the
> link security setting (HCI_LINK_SECURITY) might not be in sync with the
> actual state of the controller (HCI_AUTH). This patch fixes the issue by
> checking for inequality between the intended and actual settings and
> sends a HCI_Write_Auth_Enable command if necessary.
>
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
> net/bluetooth/mgmt.c | 7 +++++++
> 1 file changed, 7 insertions(+)
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Regards
Marcel
^ permalink raw reply
* Re: [PATCH 2/2 v2] Bluetooth: Increment Management interface revision
From: Marcel Holtmann @ 2013-01-27 14:37 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth
In-Reply-To: <1359297121-9022-2-git-send-email-johan.hedberg@gmail.com>
Hi Johan,
> This patch increments the management interface revision due to the
> various fixes, improvements and other changes that have gone in lately.
>
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
> net/bluetooth/mgmt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Regards
Marcel
^ permalink raw reply
* [PATCH BlueZ] AVRCP: Fix not handling commands while browsing is connecting
From: Luiz Augusto von Dentz @ 2013-01-27 21:03 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
With introdution of browsing channel the .init callback is called when
browsing channel connection completes, but in the meantime the remote
device can send commands over control channel.
To fix this a new callback .connect is introduced to register the PDU
handlers as soon as the control connection completes leaving .init with
only command initialization.
---
profiles/audio/avrcp.c | 59 ++++++++++++++++++++++++++++++++------------------
1 file changed, 38 insertions(+), 21 deletions(-)
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 4965b0c..8c92968 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -192,6 +192,7 @@ struct avrcp {
int features;
bool initialized;
+ void (*connect) (struct avrcp *session);
void (*init) (struct avrcp *session);
void (*destroy) (struct avrcp *sesion);
@@ -2165,6 +2166,28 @@ static struct avrcp *find_session(GSList *list, struct audio_device *dev)
return NULL;
}
+static void session_tg_connect(struct avrcp *session)
+{
+ if (session->control_id > 0)
+ return;
+
+ session->control_handlers = tg_control_handlers;
+ session->supported_events = (1 << AVRCP_EVENT_STATUS_CHANGED) |
+ (1 << AVRCP_EVENT_TRACK_CHANGED) |
+ (1 << AVRCP_EVENT_TRACK_REACHED_START) |
+ (1 << AVRCP_EVENT_TRACK_REACHED_END) |
+ (1 << AVRCP_EVENT_SETTINGS_CHANGED);
+
+ session->control_id = avctp_register_pdu_handler(session->conn,
+ AVC_OP_VENDORDEP,
+ handle_vendordep_pdu,
+ session);
+ session->browsing_id = avctp_register_browsing_pdu_handler(
+ session->conn,
+ handle_browsing_pdu,
+ session);
+}
+
static void session_tg_init(struct avrcp *session)
{
struct avrcp_server *server = session->server;
@@ -2180,25 +2203,25 @@ static void session_tg_init(struct avrcp *session)
player->sessions = g_slist_prepend(player->sessions, session);
}
- session->control_handlers = tg_control_handlers;
- session->supported_events = (1 << AVRCP_EVENT_STATUS_CHANGED) |
- (1 << AVRCP_EVENT_TRACK_CHANGED) |
- (1 << AVRCP_EVENT_TRACK_REACHED_START) |
- (1 << AVRCP_EVENT_TRACK_REACHED_END) |
- (1 << AVRCP_EVENT_SETTINGS_CHANGED);
-
if (session->version >= 0x0104)
avrcp_register_notification(session,
AVRCP_EVENT_VOLUME_CHANGED);
+}
+
+static void session_ct_connect(struct avrcp *session)
+{
+ if (session->control_id > 0)
+ return;
+ session->control_handlers = ct_control_handlers;
session->control_id = avctp_register_pdu_handler(session->conn,
AVC_OP_VENDORDEP,
handle_vendordep_pdu,
session);
- session->browsing_id = avctp_register_browsing_pdu_handler(
- session->conn,
- handle_browsing_pdu,
- session);
+ if (session->version < 0x0103)
+ return;
+
+ session->supported_events = (1 << AVRCP_EVENT_VOLUME_CHANGED);
}
static void session_ct_init(struct avrcp *session)
@@ -2207,20 +2230,10 @@ static void session_ct_init(struct avrcp *session)
struct media_player *mp;
const char *path;
- session->control_handlers = ct_control_handlers;
-
- if (session->version >= 0x0104)
- session->supported_events = (1 << AVRCP_EVENT_VOLUME_CHANGED);
-
DBG("%p version 0x%04x", session, session->version);
session->initialized = true;
- session->control_id = avctp_register_pdu_handler(session->conn,
- AVC_OP_VENDORDEP,
- handle_vendordep_pdu,
- session);
-
player = g_new0(struct avrcp_player, 1);
player->sessions = g_slist_prepend(player->sessions, session);
session->player = player;
@@ -2316,10 +2329,12 @@ static struct avrcp *session_create(struct avrcp_server *server,
session->target = FALSE;
if (session->target) {
+ session->connect = session_tg_connect;
session->init = session_tg_init;
session->destroy = session_tg_destroy;
rec = btd_device_get_record(dev->btd_dev, AVRCP_REMOTE_UUID);
} else {
+ session->connect = session_ct_connect;
session->init = session_ct_init;
session->destroy = session_ct_destroy;
rec = btd_device_get_record(dev->btd_dev, AVRCP_TARGET_UUID);
@@ -2371,6 +2386,8 @@ static void state_changed(struct audio_device *dev, avctp_state_t old_state,
if (session == NULL || session->initialized)
break;
+ session->connect(session);
+
/* Initialize session if browsing cannot be used */
if (session->version <= 0x0103 ||
old_state == AVCTP_STATE_BROWSING_CONNECTING ||
--
1.8.1
^ permalink raw reply related
* [PATCH BlueZ] AVRCP: Fix not handling commands while browsing is connecting
From: Luiz Augusto von Dentz @ 2013-01-27 22:37 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
With introdution of browsing channel the .init callback is called when
browsing channel connection completes, but in the meantime the remote
device can send commands over control channel.
To fix this the init callaback of control and browsing channel are now
separated into .init_control and .init_browsing so the handler can be
register as soon the respective channel connection completes.
---
v2: Separate control and browsing inits and use handler id to track if channel
has been initialized or not.
profiles/audio/avrcp.c | 73 +++++++++++++++++++++++++++++---------------------
1 file changed, 42 insertions(+), 31 deletions(-)
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 4965b0c..6b61664 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -190,9 +190,9 @@ struct avrcp {
gboolean target;
uint16_t version;
int features;
- bool initialized;
- void (*init) (struct avrcp *session);
+ void (*init_control) (struct avrcp *session);
+ void (*init_browsing) (struct avrcp *session);
void (*destroy) (struct avrcp *sesion);
const struct control_pdu_handler *control_handlers;
@@ -2165,14 +2165,23 @@ static struct avrcp *find_session(GSList *list, struct audio_device *dev)
return NULL;
}
-static void session_tg_init(struct avrcp *session)
+static void session_tg_init_browsing(struct avrcp *session)
+{
+ session->browsing_id = avctp_register_browsing_pdu_handler(
+ session->conn,
+ handle_browsing_pdu,
+ session);
+}
+
+static void session_tg_init_control(struct avrcp *session)
{
struct avrcp_server *server = session->server;
struct avrcp_player *player;
- DBG("%p version 0x%04x", session, session->version);
+ if (session->version < 0x0103)
+ return;
- session->initialized = true;
+ DBG("%p version 0x%04x", session, session->version);
player = g_slist_nth_data(server->players, 0);
if (player != NULL) {
@@ -2180,6 +2189,10 @@ static void session_tg_init(struct avrcp *session)
player->sessions = g_slist_prepend(player->sessions, session);
}
+ session->control_id = avctp_register_pdu_handler(session->conn,
+ AVC_OP_VENDORDEP,
+ handle_vendordep_pdu,
+ session);
session->control_handlers = tg_control_handlers;
session->supported_events = (1 << AVRCP_EVENT_STATUS_CHANGED) |
(1 << AVRCP_EVENT_TRACK_CHANGED) |
@@ -2190,36 +2203,31 @@ static void session_tg_init(struct avrcp *session)
if (session->version >= 0x0104)
avrcp_register_notification(session,
AVRCP_EVENT_VOLUME_CHANGED);
+}
- session->control_id = avctp_register_pdu_handler(session->conn,
- AVC_OP_VENDORDEP,
- handle_vendordep_pdu,
- session);
+static void session_ct_init_browsing(struct avrcp *session)
+{
session->browsing_id = avctp_register_browsing_pdu_handler(
session->conn,
handle_browsing_pdu,
session);
}
-static void session_ct_init(struct avrcp *session)
+static void session_ct_init_control(struct avrcp *session)
{
struct avrcp_player *player;
struct media_player *mp;
const char *path;
- session->control_handlers = ct_control_handlers;
-
- if (session->version >= 0x0104)
- session->supported_events = (1 << AVRCP_EVENT_VOLUME_CHANGED);
-
DBG("%p version 0x%04x", session, session->version);
- session->initialized = true;
-
session->control_id = avctp_register_pdu_handler(session->conn,
AVC_OP_VENDORDEP,
handle_vendordep_pdu,
session);
+ session->control_handlers = ct_control_handlers;
+ if (session->version >= 0x0104)
+ session->supported_events = (1 << AVRCP_EVENT_VOLUME_CHANGED);
player = g_new0(struct avrcp_player, 1);
player->sessions = g_slist_prepend(player->sessions, session);
@@ -2316,11 +2324,13 @@ static struct avrcp *session_create(struct avrcp_server *server,
session->target = FALSE;
if (session->target) {
- session->init = session_tg_init;
+ session->init_control = session_tg_init_control;
+ session->init_browsing = session_tg_init_browsing;
session->destroy = session_tg_destroy;
rec = btd_device_get_record(dev->btd_dev, AVRCP_REMOTE_UUID);
} else {
- session->init = session_ct_init;
+ session->init_control = session_ct_init_control;
+ session->init_browsing = session_ct_init_browsing;
session->destroy = session_ct_destroy;
rec = btd_device_get_record(dev->btd_dev, AVRCP_TARGET_UUID);
}
@@ -2368,26 +2378,27 @@ static void state_changed(struct audio_device *dev, avctp_state_t old_state,
break;
case AVCTP_STATE_CONNECTED:
- if (session == NULL || session->initialized)
+ if (session == NULL)
break;
- /* Initialize session if browsing cannot be used */
- if (session->version <= 0x0103 ||
- old_state == AVCTP_STATE_BROWSING_CONNECTING ||
- !(session->features & AVRCP_FEATURE_BROWSING)) {
- session->init(session);
- break;
- }
+ if (session->browsing_id > 0)
+ session->browsing_id = 0;
+
+ if (session->control_id > 0)
+ return;
+
+ session->init_control(session);
- if (avctp_connect_browsing(session->conn) != 0)
- session->init(session);
+ if (session->version >= 0x0104 &&
+ session->features & AVRCP_FEATURE_BROWSING)
+ avctp_connect_browsing(session->conn);
break;
case AVCTP_STATE_BROWSING_CONNECTED:
- if (session == NULL || session->initialized)
+ if (session == NULL || session->browsing_id > 0)
break;
- session->init(session);
+ session->init_browsing(session);
break;
default:
return;
--
1.8.1
^ permalink raw reply related
* [PATCH BlueZ 1/3 v3] AVRCP: Fix not handling commands while browsing is connecting
From: Luiz Augusto von Dentz @ 2013-01-27 23:52 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
With introdution of browsing channel the .init callback is called when
browsing channel connection completes, but in the meantime the remote
device can send commands over control channel.
To fix this the init callaback of control and browsing channel are now
separated into .init_control and .init_browsing so the handler can be
register as soon the respective channel connection completes.
---
v2: Separate control and browsing inits and use handler id to track if channel
has been initialized or not.
v3: Adds patches 2 and 3
profiles/audio/avrcp.c | 73 +++++++++++++++++++++++++++++---------------------
1 file changed, 42 insertions(+), 31 deletions(-)
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 4965b0c..6b61664 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -190,9 +190,9 @@ struct avrcp {
gboolean target;
uint16_t version;
int features;
- bool initialized;
- void (*init) (struct avrcp *session);
+ void (*init_control) (struct avrcp *session);
+ void (*init_browsing) (struct avrcp *session);
void (*destroy) (struct avrcp *sesion);
const struct control_pdu_handler *control_handlers;
@@ -2165,14 +2165,23 @@ static struct avrcp *find_session(GSList *list, struct audio_device *dev)
return NULL;
}
-static void session_tg_init(struct avrcp *session)
+static void session_tg_init_browsing(struct avrcp *session)
+{
+ session->browsing_id = avctp_register_browsing_pdu_handler(
+ session->conn,
+ handle_browsing_pdu,
+ session);
+}
+
+static void session_tg_init_control(struct avrcp *session)
{
struct avrcp_server *server = session->server;
struct avrcp_player *player;
- DBG("%p version 0x%04x", session, session->version);
+ if (session->version < 0x0103)
+ return;
- session->initialized = true;
+ DBG("%p version 0x%04x", session, session->version);
player = g_slist_nth_data(server->players, 0);
if (player != NULL) {
@@ -2180,6 +2189,10 @@ static void session_tg_init(struct avrcp *session)
player->sessions = g_slist_prepend(player->sessions, session);
}
+ session->control_id = avctp_register_pdu_handler(session->conn,
+ AVC_OP_VENDORDEP,
+ handle_vendordep_pdu,
+ session);
session->control_handlers = tg_control_handlers;
session->supported_events = (1 << AVRCP_EVENT_STATUS_CHANGED) |
(1 << AVRCP_EVENT_TRACK_CHANGED) |
@@ -2190,36 +2203,31 @@ static void session_tg_init(struct avrcp *session)
if (session->version >= 0x0104)
avrcp_register_notification(session,
AVRCP_EVENT_VOLUME_CHANGED);
+}
- session->control_id = avctp_register_pdu_handler(session->conn,
- AVC_OP_VENDORDEP,
- handle_vendordep_pdu,
- session);
+static void session_ct_init_browsing(struct avrcp *session)
+{
session->browsing_id = avctp_register_browsing_pdu_handler(
session->conn,
handle_browsing_pdu,
session);
}
-static void session_ct_init(struct avrcp *session)
+static void session_ct_init_control(struct avrcp *session)
{
struct avrcp_player *player;
struct media_player *mp;
const char *path;
- session->control_handlers = ct_control_handlers;
-
- if (session->version >= 0x0104)
- session->supported_events = (1 << AVRCP_EVENT_VOLUME_CHANGED);
-
DBG("%p version 0x%04x", session, session->version);
- session->initialized = true;
-
session->control_id = avctp_register_pdu_handler(session->conn,
AVC_OP_VENDORDEP,
handle_vendordep_pdu,
session);
+ session->control_handlers = ct_control_handlers;
+ if (session->version >= 0x0104)
+ session->supported_events = (1 << AVRCP_EVENT_VOLUME_CHANGED);
player = g_new0(struct avrcp_player, 1);
player->sessions = g_slist_prepend(player->sessions, session);
@@ -2316,11 +2324,13 @@ static struct avrcp *session_create(struct avrcp_server *server,
session->target = FALSE;
if (session->target) {
- session->init = session_tg_init;
+ session->init_control = session_tg_init_control;
+ session->init_browsing = session_tg_init_browsing;
session->destroy = session_tg_destroy;
rec = btd_device_get_record(dev->btd_dev, AVRCP_REMOTE_UUID);
} else {
- session->init = session_ct_init;
+ session->init_control = session_ct_init_control;
+ session->init_browsing = session_ct_init_browsing;
session->destroy = session_ct_destroy;
rec = btd_device_get_record(dev->btd_dev, AVRCP_TARGET_UUID);
}
@@ -2368,26 +2378,27 @@ static void state_changed(struct audio_device *dev, avctp_state_t old_state,
break;
case AVCTP_STATE_CONNECTED:
- if (session == NULL || session->initialized)
+ if (session == NULL)
break;
- /* Initialize session if browsing cannot be used */
- if (session->version <= 0x0103 ||
- old_state == AVCTP_STATE_BROWSING_CONNECTING ||
- !(session->features & AVRCP_FEATURE_BROWSING)) {
- session->init(session);
- break;
- }
+ if (session->browsing_id > 0)
+ session->browsing_id = 0;
+
+ if (session->control_id > 0)
+ return;
+
+ session->init_control(session);
- if (avctp_connect_browsing(session->conn) != 0)
- session->init(session);
+ if (session->version >= 0x0104 &&
+ session->features & AVRCP_FEATURE_BROWSING)
+ avctp_connect_browsing(session->conn);
break;
case AVCTP_STATE_BROWSING_CONNECTED:
- if (session == NULL || session->initialized)
+ if (session == NULL || session->browsing_id > 0)
break;
- session->init(session);
+ session->init_browsing(session);
break;
default:
return;
--
1.8.1
^ permalink raw reply related
* [PATCH BlueZ 2/3 v3] AVCTP: Fix not destroying browsing channel if disconnected
From: Luiz Augusto von Dentz @ 2013-01-27 23:52 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1359330736-9190-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
If the browsing channel is disconnected it should be destroyed
immediatelly and set to NULL otherwise it will point to invalid channel.
---
profiles/audio/avctp.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c
index 6ad2b66..6cac718 100644
--- a/profiles/audio/avctp.c
+++ b/profiles/audio/avctp.c
@@ -485,6 +485,10 @@ static void avctp_set_state(struct avctp *session, avctp_state_t new_state)
break;
case AVCTP_STATE_CONNECTED:
DBG("AVCTP Connected");
+ if (session->browsing) {
+ avctp_channel_destroy(session->browsing);
+ session->browsing = NULL;
+ }
break;
case AVCTP_STATE_BROWSING_CONNECTING:
DBG("AVCTP Browsing Connecting");
--
1.8.1
^ permalink raw reply related
* [PATCH BlueZ 3/3 v3] AVCTP: Add destroy callback to avctp_register_browsing_pdu_handler
From: Luiz Augusto von Dentz @ 2013-01-27 23:52 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1359330736-9190-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds a destroy callback which is called when the PDU handler is
destroyed.
---
profiles/audio/avctp.c | 44 +++++++++++++++++++++++++++++++++++++-------
profiles/audio/avctp.h | 3 ++-
profiles/audio/avrcp.c | 21 ++++++++++++---------
3 files changed, 51 insertions(+), 17 deletions(-)
diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c
index 6cac718..41e2f46 100644
--- a/profiles/audio/avctp.c
+++ b/profiles/audio/avctp.c
@@ -168,6 +168,7 @@ struct avctp_channel {
GQueue *queue;
GSList *processed;
guint process_id;
+ GDestroyNotify destroy;
};
struct key_pressed {
@@ -206,6 +207,7 @@ struct avctp_browsing_pdu_handler {
avctp_browsing_pdu_cb cb;
void *user_data;
unsigned int id;
+ GDestroyNotify destroy;
};
static struct {
@@ -406,6 +408,9 @@ static void avctp_channel_destroy(struct avctp_channel *chan)
if (chan->process_id > 0)
g_source_remove(chan->process_id);
+ if (chan->destroy)
+ chan->destroy(chan);
+
g_free(chan->buffer);
g_queue_foreach(chan->queue, pending_destroy, NULL);
g_queue_free(chan->queue);
@@ -985,7 +990,8 @@ static void init_uinput(struct avctp *session)
}
static struct avctp_channel *avctp_channel_create(struct avctp *session,
- GIOChannel *io)
+ GIOChannel *io,
+ GDestroyNotify destroy)
{
struct avctp_channel *chan;
@@ -993,10 +999,30 @@ static struct avctp_channel *avctp_channel_create(struct avctp *session,
chan->session = session;
chan->io = g_io_channel_ref(io);
chan->queue = g_queue_new();
+ chan->destroy = destroy;
return chan;
}
+static void handler_free(void *data)
+{
+ struct avctp_browsing_pdu_handler *handler = data;
+
+ if (handler->destroy)
+ handler->destroy(handler->user_data);
+
+ g_free(data);
+}
+
+static void avctp_destroy_browsing(void *data)
+{
+ struct avctp_channel *chan = data;
+
+ g_slist_free_full(chan->handlers, handler_free);
+
+ chan->handlers = NULL;
+}
+
static void avctp_connect_browsing_cb(GIOChannel *chan, GError *err,
gpointer data)
{
@@ -1026,7 +1052,8 @@ static void avctp_connect_browsing_cb(GIOChannel *chan, GError *err,
DBG("AVCTP Browsing: connected to %s", address);
if (session->browsing == NULL)
- session->browsing = avctp_channel_create(session, chan);
+ session->browsing = avctp_channel_create(session, chan,
+ avctp_destroy_browsing);
session->browsing->imtu = imtu;
session->browsing->omtu = omtu;
@@ -1075,7 +1102,7 @@ static void avctp_connect_cb(GIOChannel *chan, GError *err, gpointer data)
DBG("AVCTP: connected to %s", address);
if (session->control == NULL)
- session->control = avctp_channel_create(session, chan);
+ session->control = avctp_channel_create(session, chan, NULL);
session->control->imtu = imtu;
session->control->omtu = omtu;
@@ -1189,7 +1216,7 @@ static void avctp_control_confirm(struct avctp *session, GIOChannel *chan,
}
avctp_set_state(session, AVCTP_STATE_CONNECTING);
- session->control = avctp_channel_create(session, chan);
+ session->control = avctp_channel_create(session, chan, NULL);
src = adapter_get_address(device_get_adapter(dev->btd_dev));
dst = device_get_address(dev->btd_dev);
@@ -1666,7 +1693,8 @@ unsigned int avctp_register_pdu_handler(struct avctp *session, uint8_t opcode,
unsigned int avctp_register_browsing_pdu_handler(struct avctp *session,
avctp_browsing_pdu_cb cb,
- void *user_data)
+ void *user_data,
+ GDestroyNotify destroy)
{
struct avctp_channel *browsing = session->browsing;
struct avctp_browsing_pdu_handler *handler;
@@ -1682,6 +1710,7 @@ unsigned int avctp_register_browsing_pdu_handler(struct avctp *session,
handler->cb = cb;
handler->user_data = user_data;
handler->id = ++id;
+ handler->destroy = destroy;
browsing->handlers = g_slist_append(browsing->handlers, handler);
@@ -1787,7 +1816,7 @@ struct avctp *avctp_connect(struct audio_device *device)
return NULL;
}
- session->control = avctp_channel_create(session, io);
+ session->control = avctp_channel_create(session, io, NULL);
g_io_channel_unref(io);
return session;
@@ -1821,7 +1850,8 @@ int avctp_connect_browsing(struct avctp *session)
return -EIO;
}
- session->browsing = avctp_channel_create(session, io);
+ session->browsing = avctp_channel_create(session, io,
+ avctp_destroy_browsing);
g_io_channel_unref(io);
return 0;
diff --git a/profiles/audio/avctp.h b/profiles/audio/avctp.h
index 6cbda92..411b093 100644
--- a/profiles/audio/avctp.h
+++ b/profiles/audio/avctp.h
@@ -110,7 +110,8 @@ gboolean avctp_unregister_pdu_handler(unsigned int id);
unsigned int avctp_register_browsing_pdu_handler(struct avctp *session,
avctp_browsing_pdu_cb cb,
- void *user_data);
+ void *user_data,
+ GDestroyNotify destroy);
gboolean avctp_unregister_browsing_pdu_handler(unsigned int id);
int avctp_send_passthrough(struct avctp *session, uint8_t op);
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 6b61664..f83c3db 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -2165,12 +2165,20 @@ static struct avrcp *find_session(GSList *list, struct audio_device *dev)
return NULL;
}
+static void destroy_browsing(void *data)
+{
+ struct avrcp *session = data;
+
+ session->browsing_id = 0;
+}
+
static void session_tg_init_browsing(struct avrcp *session)
{
session->browsing_id = avctp_register_browsing_pdu_handler(
session->conn,
handle_browsing_pdu,
- session);
+ session,
+ destroy_browsing);
}
static void session_tg_init_control(struct avrcp *session)
@@ -2210,7 +2218,8 @@ static void session_ct_init_browsing(struct avrcp *session)
session->browsing_id = avctp_register_browsing_pdu_handler(
session->conn,
handle_browsing_pdu,
- session);
+ session,
+ destroy_browsing);
}
static void session_ct_init_control(struct avrcp *session)
@@ -2378,15 +2387,9 @@ static void state_changed(struct audio_device *dev, avctp_state_t old_state,
break;
case AVCTP_STATE_CONNECTED:
- if (session == NULL)
+ if (session == NULL || session->control_id > 0)
break;
- if (session->browsing_id > 0)
- session->browsing_id = 0;
-
- if (session->control_id > 0)
- return;
-
session->init_control(session);
if (session->version >= 0x0104 &&
--
1.8.1
^ permalink raw reply related
* Re: [PATCH BlueZ 1/3 v3] AVRCP: Fix not handling commands while browsing is connecting
From: Johan Hedberg @ 2013-01-28 0:00 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
In-Reply-To: <1359330736-9190-1-git-send-email-luiz.dentz@gmail.com>
Hi Luiz,
On Sun, Jan 27, 2013, Luiz Augusto von Dentz wrote:
> With introdution of browsing channel the .init callback is called when
> browsing channel connection completes, but in the meantime the remote
> device can send commands over control channel.
>
> To fix this the init callaback of control and browsing channel are now
> separated into .init_control and .init_browsing so the handler can be
> register as soon the respective channel connection completes.
> ---
> v2: Separate control and browsing inits and use handler id to track if channel
> has been initialized or not.
> v3: Adds patches 2 and 3
>
> profiles/audio/avrcp.c | 73 +++++++++++++++++++++++++++++---------------------
> 1 file changed, 42 insertions(+), 31 deletions(-)
All three patches have been applied. Thanks.
Johan
^ permalink raw reply
* Re: [PATCH BlueZ] media: Fix custom property registration for multiple adapters
From: Johan Hedberg @ 2013-01-28 0:03 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
In-Reply-To: <1358775253-29202-1-git-send-email-luiz.dentz@gmail.com>
Hi Luiz,
On Mon, Jan 21, 2013, Luiz Augusto von Dentz wrote:
> The function btd_profile_add_custom_prop register a custom property for
> an UUID which is valid for every adapter so its user_data cannot be tied
> to a single adapter.
>
> To fix this now NULL is passed as user_data and the callbacks checks if
> the adapter passed has been registered and if there is an endpoint for
> the UUID requested.
> ---
> profiles/audio/media.c | 27 +++++++++++++++++++++++----
> 1 file changed, 23 insertions(+), 4 deletions(-)
Applied. Thanks.
Johan
^ permalink raw reply
* Re: What is involved in supporting SCO packets in HCI_RAW mode?
From: Eponymous - @ 2013-01-28 9:45 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: linux-bluetooth
In-Reply-To: <1359170626.16748.4.camel@aeonflux>
Thanks for getting back to me so quickly Marcel.
Yes that sounds logical. I think it sounds like we are wanting connect
using USB another way in this case rather than trying to re-engineer
BlueZ to work in a way which it wasn't intended.
Cheers.
On Sat, Jan 26, 2013 at 3:23 AM, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi,
>
>> After the patch was added to btusb.c to allow ACL packets to be
>> sent/received in HCI_RAW mode I was wondering what would be involved
>> in allowing raw SCO packets to be sent/received?
>>
>> This would be a useful feature for someone like me who works with
>> Bluetooth firmware at this level on a daily basis.
>>
>> However, I can understand there may be some limitations.
>>
>> Is this something that can be realistically done?
>
> I do not see a way to do this properly. The main problem here is the USB
> transport. It requires special settings and active URBs.
>
> Once you switch it to HCI_RAW mode, the Bluetooth host stack does no
> command/event tracking and with that no connection tracking anymore.
> This means it can not inform the driver about any changes. And for USB
> it is required to change its alternate setting based on the number of
> connections and start ISOC URBs. Having ISOC URBs submitted all the time
> is not feasible either since that consumes way too much power.
>
> For other transports like UART, the SCO packets in HCI_RAW mode should
> still work.
>
> Regards
>
> Marcel
>
>
^ permalink raw reply
* LE auto connect
From: Damjan Cvetko @ 2013-01-28 12:09 UTC (permalink / raw)
To: linux-bluetooth@vger.kernel.org
I checked out latest code, and found that LE auto connection does not work at all. Dug a bit in the code to see there is no relevant implementation (related to connect_list).
Here a few lines that make it work.
Best
Damjan
diff --git a/profiles/heartrate/heartrate.c b/profiles/heartrate/heartrate.c
index 5c56d3f..1788d4f 100644
--- a/profiles/heartrate/heartrate.c
+++ b/profiles/heartrate/heartrate.c
@@ -801,6 +801,8 @@ static int heartrate_device_register(struct btd_device *device,
hr->attioid = btd_device_add_attio_callback(device, attio_connected_cb,
attio_disconnected_cb, hr);
+ device_set_auto_connect(device, TRUE);
+
return 0;
}
diff --git a/src/adapter.c b/src/adapter.c
index 43a9a3a..20667c8 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -4071,6 +4071,12 @@ static void update_found_devices(struct btd_adapter *adapter,
done:
if (device_is_le(dev) && g_slist_find(adapter->connect_list, dev)) {
+ if (!device_is_connected(dev)) {
+ err = device_connect_le(dev);
+ if (err < 0) {
+ DBG("LE auto connection failed %s (%d)", strerror(-err), -err);
+ }
+ }
}
}
^ permalink raw reply related
* Re: [PATCH 1/2] Bluetooth: Fix L2CAP socket shutdown for LE connections
From: Andre Guedes @ 2013-01-28 18:17 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: linux-bluetooth
In-Reply-To: <1359170902.16748.6.camel@aeonflux>
Hi Marcel,
On Sat, Jan 26, 2013 at 12:28 AM, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Andre,
>
>> During the L2CAP socket shutdown, the LE connection is not terminated
>> as expected. This bug can be reproduced using l2test tool. Once the
>> LE connection is established, kill l2test and the LE connection will
>> not terminate.
>>
>> This patch fixes hci_conn_disconnect function so it is able to
>> terminate LE connections.
>>
>> Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
>> ---
>> net/bluetooth/hci_conn.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
>> index 25bfce0..0492949 100644
>> --- a/net/bluetooth/hci_conn.c
>> +++ b/net/bluetooth/hci_conn.c
>> @@ -250,6 +250,7 @@ static void hci_conn_disconnect(struct hci_conn *conn)
>>
>> switch (conn->type) {
>> case ACL_LINK:
>> + case LE_LINK:
>> hci_acl_disconn(conn, reason);
>> break;
>> case AMP_LINK:
>
> I am wondering if we are not missing SCO_LINK here either.
Yes, we have the same problem with SCO socket shutdown.
I'll fix it and add the patch to this patchset.
Regards,
Andre
^ permalink raw reply
* Re: LE auto connect
From: Johan Hedberg @ 2013-01-28 18:23 UTC (permalink / raw)
To: Damjan Cvetko; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <CEE0DF8E7B2727428D202DA3F3FBC4DD8C753ABB@PULWAR.mtk.lan>
Hi Damjan,
On Mon, Jan 28, 2013, Damjan Cvetko wrote:
> I checked out latest code, and found that LE auto connection does not
> work at all. Dug a bit in the code to see there is no relevant
> implementation (related to connect_list).
>
> Here a few lines that make it work.
Thanks. I pushed a cleaned up version of the adapter.c changes since
that needs to be in a separate patch anyway. Could you create a proper
git patch (git format-patch & git send-email) from the first part of the
patch and resend it?
Johan
^ permalink raw reply
* Re: [PATCH 9/9 v4] Bluetooth: Add support for 128-bit UUIDs in EIR data
From: Gustavo Padovan @ 2013-01-28 18:28 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth
In-Reply-To: <1359239495-3444-10-git-send-email-johan.hedberg@gmail.com>
Hi Johan,
* Johan Hedberg <johan.hedberg@gmail.com> [2013-01-27 00:31:35 +0200]:
> From: Johan Hedberg <johan.hedberg@intel.com>
>
> This patch adds the necessary code for encoding a list of 128-bit UUIDs
> into the EIR data.
>
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> Acked-by: Marcel Holtmann <marcel@holtmann.org>
> ---
> net/bluetooth/mgmt.c | 34 ++++++++++++++++++++++++++++++++++
> 1 file changed, 34 insertions(+)
All 9 patches have been applied. Thanks.
Gustavo
^ permalink raw reply
* Re: [PATCH 2/2 v2] Bluetooth: Increment Management interface revision
From: Gustavo Padovan @ 2013-01-28 18:33 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth
In-Reply-To: <1359297121-9022-2-git-send-email-johan.hedberg@gmail.com>
Hi Johan,
* Johan Hedberg <johan.hedberg@gmail.com> [2013-01-27 08:32:01 -0600]:
> From: Johan Hedberg <johan.hedberg@intel.com>
>
> This patch increments the management interface revision due to the
> various fixes, improvements and other changes that have gone in lately.
>
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
> net/bluetooth/mgmt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Both patches have been applied to bluetooth-next. Thanks.
Gustavo
^ permalink raw reply
* [PATCH BlueZ] media: Fix not finding endpoints with different case UUIDs
From: Vinicius Costa Gomes @ 2013-01-28 19:27 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Vinicius Costa Gomes
When multiple Endpoints are registered with different case UUIDs,
the only UUIDs found were those with matching case.
---
profiles/audio/media.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index 0ae9932..59fc840 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -170,7 +170,7 @@ static struct media_endpoint *media_adapter_find_endpoint(
if (path && g_strcmp0(endpoint->path, path) != 0)
continue;
- if (uuid && g_strcmp0(endpoint->uuid, uuid) != 0)
+ if (uuid && strcasecmp(endpoint->uuid, uuid) != 0)
continue;
return endpoint;
@@ -692,7 +692,7 @@ static bool endpoint_properties_get(const char *uuid,
for (l = adapter->endpoints; l; l = l->next) {
struct media_endpoint *endpoint = l->data;
- if (g_strcmp0(endpoint->uuid, uuid) != 0)
+ if (strcasecmp(endpoint->uuid, uuid) != 0)
continue;
append_endpoint(endpoint, &dict);
--
1.8.1.1
^ permalink raw reply related
* Re: [PATCH BlueZ] media: Fix not finding endpoints with different case UUIDs
From: Luiz Augusto von Dentz @ 2013-01-28 20:20 UTC (permalink / raw)
To: Vinicius Costa Gomes; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <1359401256-14512-1-git-send-email-vinicius.gomes@openbossa.org>
Hi Vinicius,
On Mon, Jan 28, 2013 at 1:27 PM, Vinicius Costa Gomes
<vinicius.gomes@openbossa.org> wrote:
> When multiple Endpoints are registered with different case UUIDs,
> the only UUIDs found were those with matching case.
> ---
> profiles/audio/media.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/profiles/audio/media.c b/profiles/audio/media.c
> index 0ae9932..59fc840 100644
> --- a/profiles/audio/media.c
> +++ b/profiles/audio/media.c
> @@ -170,7 +170,7 @@ static struct media_endpoint *media_adapter_find_endpoint(
> if (path && g_strcmp0(endpoint->path, path) != 0)
> continue;
>
> - if (uuid && g_strcmp0(endpoint->uuid, uuid) != 0)
> + if (uuid && strcasecmp(endpoint->uuid, uuid) != 0)
> continue;
>
> return endpoint;
> @@ -692,7 +692,7 @@ static bool endpoint_properties_get(const char *uuid,
> for (l = adapter->endpoints; l; l = l->next) {
> struct media_endpoint *endpoint = l->data;
>
> - if (g_strcmp0(endpoint->uuid, uuid) != 0)
> + if (strcasecmp(endpoint->uuid, uuid) != 0)
> continue;
>
> append_endpoint(endpoint, &dict);
> --
> 1.8.1.1
Applied, thanks
--
Luiz Augusto von Dentz
^ permalink raw reply
* [PATCH] Add heartrate monitoring LE device to auto connect list.
From: Damjan Cvetko @ 2013-01-28 21:27 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Damjan Cvetko
---
profiles/heartrate/heartrate.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/profiles/heartrate/heartrate.c b/profiles/heartrate/heartrate.c
index 5c56d3f..1788d4f 100644
--- a/profiles/heartrate/heartrate.c
+++ b/profiles/heartrate/heartrate.c
@@ -801,6 +801,8 @@ static int heartrate_device_register(struct btd_device *device,
hr->attioid = btd_device_add_attio_callback(device, attio_connected_cb,
attio_disconnected_cb, hr);
+ device_set_auto_connect(device, TRUE);
+
return 0;
}
--
1.7.10.4
^ 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