Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/3] hcidump: Distinct Control and Browsing AVCTP channels
@ 2013-01-31 15:33 Luiz Augusto von Dentz
  2013-01-31 15:33 ` [PATCH BlueZ 1/2 v2] thermometer: Fix crash while unregistering adapter Luiz Augusto von Dentz
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2013-01-31 15:33 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This prints the respective channel of the trafic
---
 tools/parser/avctp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/parser/avctp.c b/tools/parser/avctp.c
index 60a5f69..58b181d 100644
--- a/tools/parser/avctp.c
+++ b/tools/parser/avctp.c
@@ -60,7 +60,8 @@ void avctp_dump(int level, struct frame *frm, uint16_t psm)
 	hdr = get_u8(frm);
 	pid = get_u16(frm);
 
-	printf("AVCTP: %s %s: pt 0x%02x transaction %d pid 0x%04x \n",
+	printf("AVCTP %s: %s %s: pt 0x%02x transaction %d pid 0x%04x\n",
+				psm == 23 ? "Control" : "Browsing",
 				hdr & 0x02 ? "Response" : "Command",
 				pt2str(hdr), hdr & 0x0c, hdr >> 4, pid);
 
-- 
1.8.1


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

* [PATCH BlueZ 1/2 v2] thermometer: Fix crash while unregistering adapter
  2013-01-31 15:33 [PATCH BlueZ 1/3] hcidump: Distinct Control and Browsing AVCTP channels Luiz Augusto von Dentz
@ 2013-01-31 15:33 ` Luiz Augusto von Dentz
  2013-01-31 15:33 ` [PATCH BlueZ 1/2] tools: Use device Alias instead of Name Luiz Augusto von Dentz
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2013-01-31 15:33 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

Invalid read of size 8
   at 0x448200: g_attrib_unregister (gattrib.c:722)
   by 0x440476: destroy_thermometer (thermometer.c:167)
   by 0x40D849: remove_interface (object.c:656)
   by 0x40DAA9: g_dbus_unregister_interface (object.c:1413)
   by 0x3DF7A63C9C: g_slist_foreach (gslist.c:894)
   by 0x469656: device_remove (device.c:2200)
   by 0x45CDC1: adapter_remove (adapter.c:3884)
   by 0x45F146: index_removed (adapter.c:5442)
   by 0x46BC17: received_data (mgmt.c:252)
   by 0x3DF7A47A74: g_main_context_dispatch (gmain.c:2715)
   by 0x3DF7A47DA7: g_main_context_iterate.isra.24 (gmain.c:3290)
   by 0x3DF7A481A1: g_main_loop_run (gmain.c:3484)
 Address 0x40 is not stack'd, malloc'd or (recently) free'd
---
v2: Print a warning if invalid id is passed to g_attrib_unregister

 profiles/thermometer/thermometer.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/profiles/thermometer/thermometer.c b/profiles/thermometer/thermometer.c
index 0cf14e6..1b299e7 100644
--- a/profiles/thermometer/thermometer.c
+++ b/profiles/thermometer/thermometer.c
@@ -164,12 +164,12 @@ static void destroy_thermometer(gpointer user_data)
 	if (t->attioid > 0)
 		btd_device_remove_attio_callback(t->dev, t->attioid);
 
-	g_attrib_unregister(t->attrib, t->attio_measurement_id);
-	g_attrib_unregister(t->attrib, t->attio_intermediate_id);
-	g_attrib_unregister(t->attrib, t->attio_interval_id);
-
-	if (t->attrib != NULL)
+	if (t->attrib != NULL) {
+		g_attrib_unregister(t->attrib, t->attio_measurement_id);
+		g_attrib_unregister(t->attrib, t->attio_intermediate_id);
+		g_attrib_unregister(t->attrib, t->attio_interval_id);
 		g_attrib_unref(t->attrib);
+	}
 
 	btd_device_unref(t->dev);
 	g_free(t->svc_range);
-- 
1.8.1


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

* [PATCH BlueZ 1/2] tools: Use device Alias instead of Name
  2013-01-31 15:33 [PATCH BlueZ 1/3] hcidump: Distinct Control and Browsing AVCTP channels Luiz Augusto von Dentz
  2013-01-31 15:33 ` [PATCH BlueZ 1/2 v2] thermometer: Fix crash while unregistering adapter Luiz Augusto von Dentz
@ 2013-01-31 15:33 ` Luiz Augusto von Dentz
  2013-01-31 15:33 ` [PATCH BlueZ 2/2 v2] attrib: Don't attempt to unregister event id 0 Luiz Augusto von Dentz
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2013-01-31 15:33 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

User may have set a different Name using Alias, Alias should always
be set.
---
 tools/mpris-player.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/mpris-player.c b/tools/mpris-player.c
index aafa142..b82b5df 100644
--- a/tools/mpris-player.c
+++ b/tools/mpris-player.c
@@ -1422,7 +1422,7 @@ static void register_player(GDBusProxy *proxy)
 	if (device == NULL)
 		return;
 
-	if (!g_dbus_proxy_get_property(device, "Name", &iter))
+	if (!g_dbus_proxy_get_property(device, "Alias", &iter))
 		return;
 
 	dbus_message_iter_get_basic(&iter, &name);
-- 
1.8.1


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

* [PATCH BlueZ 2/2 v2] attrib: Don't attempt to unregister event id 0
  2013-01-31 15:33 [PATCH BlueZ 1/3] hcidump: Distinct Control and Browsing AVCTP channels Luiz Augusto von Dentz
  2013-01-31 15:33 ` [PATCH BlueZ 1/2 v2] thermometer: Fix crash while unregistering adapter Luiz Augusto von Dentz
  2013-01-31 15:33 ` [PATCH BlueZ 1/2] tools: Use device Alias instead of Name Luiz Augusto von Dentz
@ 2013-01-31 15:33 ` Luiz Augusto von Dentz
  2013-01-31 15:33 ` [PATCH BlueZ 2/3] hcidump: Fix parsing of GetCurrentPlayerApplicationSettingValue Luiz Augusto von Dentz
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2013-01-31 15:33 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

Id 0 is considered invalid so the code should not even try to lookup for
it in the event list instead print a warning and return FALSE
immediatelly.
---
 attrib/gattrib.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/attrib/gattrib.c b/attrib/gattrib.c
index 58f19d0..01c19f9 100644
--- a/attrib/gattrib.c
+++ b/attrib/gattrib.c
@@ -719,6 +719,11 @@ gboolean g_attrib_unregister(GAttrib *attrib, guint id)
 	struct event *evt;
 	GSList *l;
 
+	if (id == 0) {
+		warn("%s: invalid id", __FUNCTION__);
+		return FALSE;
+	}
+
 	l = g_slist_find_custom(attrib->events, GUINT_TO_POINTER(id),
 							event_cmp_by_id);
 	if (l == NULL)
-- 
1.8.1


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

* [PATCH BlueZ 2/3] hcidump: Fix parsing of GetCurrentPlayerApplicationSettingValue
  2013-01-31 15:33 [PATCH BlueZ 1/3] hcidump: Distinct Control and Browsing AVCTP channels Luiz Augusto von Dentz
                   ` (2 preceding siblings ...)
  2013-01-31 15:33 ` [PATCH BlueZ 2/2 v2] attrib: Don't attempt to unregister event id 0 Luiz Augusto von Dentz
@ 2013-01-31 15:33 ` Luiz Augusto von Dentz
  2013-01-31 15:33 ` [PATCH BlueZ 2/2] tools: Fix mpris-player creating busname starting with digit Luiz Augusto von Dentz
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2013-01-31 15:33 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

---
 tools/parser/avrcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/parser/avrcp.c b/tools/parser/avrcp.c
index 1d4a319..1029287 100644
--- a/tools/parser/avrcp.c
+++ b/tools/parser/avrcp.c
@@ -618,7 +618,7 @@ static void avrcp_get_current_player_value_dump(int level, struct frame *frm,
 
 	p_indent(level, frm);
 
-	if (len < 2) {
+	if (len < 1) {
 		printf("PDU Malformed\n");
 		raw_dump(level, frm);
 		return;
-- 
1.8.1


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

* [PATCH BlueZ 2/2] tools: Fix mpris-player creating busname starting with digit
  2013-01-31 15:33 [PATCH BlueZ 1/3] hcidump: Distinct Control and Browsing AVCTP channels Luiz Augusto von Dentz
                   ` (3 preceding siblings ...)
  2013-01-31 15:33 ` [PATCH BlueZ 2/3] hcidump: Fix parsing of GetCurrentPlayerApplicationSettingValue Luiz Augusto von Dentz
@ 2013-01-31 15:33 ` Luiz Augusto von Dentz
  2013-01-31 15:33 ` [PATCH BlueZ 3/3] hcidump: Fix parsing of SetBrowsedPlayer Luiz Augusto von Dentz
  2013-01-31 22:07 ` [PATCH BlueZ 1/3] hcidump: Distinct Control and Browsing AVCTP channels Vinicius Costa Gomes
  6 siblings, 0 replies; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2013-01-31 15:33 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

D-Bus does not allow a bus name starting with digits after . so the code
now prefix with bt_ if the device name starts with a digit.
---
 tools/mpris-player.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/mpris-player.c b/tools/mpris-player.c
index b82b5df..4dbde90 100644
--- a/tools/mpris-player.c
+++ b/tools/mpris-player.c
@@ -1381,7 +1381,11 @@ static const GDBusPropertyTable mpris_properties[] = {
 
 static char *mpris_busname(char *name)
 {
-	return g_strconcat(MPRIS_BUS_NAME,
+	if (g_ascii_isdigit(name[0]))
+		return g_strconcat(MPRIS_BUS_NAME, "bt_",
+				g_strcanon(name, A_Z a_z _0_9, '_'), NULL);
+	else
+		return g_strconcat(MPRIS_BUS_NAME,
 				g_strcanon(name, A_Z a_z _0_9, '_'), NULL);
 }
 
-- 
1.8.1


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

* [PATCH BlueZ 3/3] hcidump: Fix parsing of SetBrowsedPlayer
  2013-01-31 15:33 [PATCH BlueZ 1/3] hcidump: Distinct Control and Browsing AVCTP channels Luiz Augusto von Dentz
                   ` (4 preceding siblings ...)
  2013-01-31 15:33 ` [PATCH BlueZ 2/2] tools: Fix mpris-player creating busname starting with digit Luiz Augusto von Dentz
@ 2013-01-31 15:33 ` Luiz Augusto von Dentz
  2013-01-31 22:07 ` [PATCH BlueZ 1/3] hcidump: Distinct Control and Browsing AVCTP channels Vinicius Costa Gomes
  6 siblings, 0 replies; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2013-01-31 15:33 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

---
 tools/parser/avrcp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/parser/avrcp.c b/tools/parser/avrcp.c
index 1029287..4d88b41 100644
--- a/tools/parser/avrcp.c
+++ b/tools/parser/avrcp.c
@@ -1294,7 +1294,7 @@ static void avrcp_set_browsed_player_dump(int level, struct frame *frm,
 	}
 
 	id = get_u16(frm);
-	printf("PlayerID: 0x%04x (%u)", id, id);
+	printf("PlayerID: 0x%04x (%u)\n", id, id);
 	return;
 
 response:
@@ -1313,12 +1313,12 @@ response:
 	p_indent(level, frm);
 
 	uids = get_u16(frm);
-	printf("UIDCounter: 0x%04x (%u)", uids, uids);
+	printf("UIDCounter: 0x%04x (%u)\n", uids, uids);
 
 	p_indent(level, frm);
 
 	items = get_u32(frm);
-	printf("Number of Items: 0x%04x (%u)", items, items);
+	printf("Number of Items: 0x%04x (%u)\n", items, items);
 
 	p_indent(level, frm);
 
@@ -1328,7 +1328,7 @@ response:
 	p_indent(level, frm);
 
 	folders = get_u8(frm);
-	printf("Folder Depth: 0x%02x (%u)", folders, folders);
+	printf("Folder Depth: 0x%02x (%u)\n", folders, folders);
 
 	for (; folders > 0; folders--) {
 		uint16_t len;
-- 
1.8.1


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

* Re: [PATCH BlueZ 1/3] hcidump: Distinct Control and Browsing AVCTP channels
  2013-01-31 15:33 [PATCH BlueZ 1/3] hcidump: Distinct Control and Browsing AVCTP channels Luiz Augusto von Dentz
                   ` (5 preceding siblings ...)
  2013-01-31 15:33 ` [PATCH BlueZ 3/3] hcidump: Fix parsing of SetBrowsedPlayer Luiz Augusto von Dentz
@ 2013-01-31 22:07 ` Vinicius Costa Gomes
  2013-01-31 23:03   ` Luiz Augusto von Dentz
  6 siblings, 1 reply; 9+ messages in thread
From: Vinicius Costa Gomes @ 2013-01-31 22:07 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

On 09:33 Thu 31 Jan, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> This prints the respective channel of the trafic

These (three?) series got all mixed in the list.

Could you send them again?


Cheers,
-- 
Vinicius

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

* Re: [PATCH BlueZ 1/3] hcidump: Distinct Control and Browsing AVCTP channels
  2013-01-31 22:07 ` [PATCH BlueZ 1/3] hcidump: Distinct Control and Browsing AVCTP channels Vinicius Costa Gomes
@ 2013-01-31 23:03   ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 9+ messages in thread
From: Luiz Augusto von Dentz @ 2013-01-31 23:03 UTC (permalink / raw)
  To: Vinicius Costa Gomes; +Cc: linux-bluetooth@vger.kernel.org

Hi Vinicius,

On Thu, Jan 31, 2013 at 4:07 PM, Vinicius Costa Gomes
<vinicius.gomes@openbossa.org> wrote:
> Hi Luiz,
>
> On 09:33 Thu 31 Jan, Luiz Augusto von Dentz wrote:
>> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>>
>> This prints the respective channel of the trafic
>
> These (three?) series got all mixed in the list.
>
> Could you send them again?
>
>
> Cheers,
> --
> Vinicius

They are applied already, sorry for the mess.

--
Luiz Augusto von Dentz

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

end of thread, other threads:[~2013-01-31 23:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-31 15:33 [PATCH BlueZ 1/3] hcidump: Distinct Control and Browsing AVCTP channels Luiz Augusto von Dentz
2013-01-31 15:33 ` [PATCH BlueZ 1/2 v2] thermometer: Fix crash while unregistering adapter Luiz Augusto von Dentz
2013-01-31 15:33 ` [PATCH BlueZ 1/2] tools: Use device Alias instead of Name Luiz Augusto von Dentz
2013-01-31 15:33 ` [PATCH BlueZ 2/2 v2] attrib: Don't attempt to unregister event id 0 Luiz Augusto von Dentz
2013-01-31 15:33 ` [PATCH BlueZ 2/3] hcidump: Fix parsing of GetCurrentPlayerApplicationSettingValue Luiz Augusto von Dentz
2013-01-31 15:33 ` [PATCH BlueZ 2/2] tools: Fix mpris-player creating busname starting with digit Luiz Augusto von Dentz
2013-01-31 15:33 ` [PATCH BlueZ 3/3] hcidump: Fix parsing of SetBrowsedPlayer Luiz Augusto von Dentz
2013-01-31 22:07 ` [PATCH BlueZ 1/3] hcidump: Distinct Control and Browsing AVCTP channels Vinicius Costa Gomes
2013-01-31 23:03   ` Luiz Augusto von Dentz

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