All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] handsfree-audio: Log when agent (un)register
@ 2013-04-12 22:29 =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita
  2013-04-16 22:32 ` =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita
  0 siblings, 1 reply; 3+ messages in thread
From: =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita @ 2013-04-12 22:29 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1559 bytes --]

This commit logs on debug level when a Handsfree Audio Agent registers
or unregisters itself and the CODECs that are enabled.
---
 src/handsfree-audio.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
index 3b0814f..411632e 100644
--- a/src/handsfree-audio.c
+++ b/src/handsfree-audio.c
@@ -663,6 +663,7 @@ static DBusMessage *am_agent_register(DBusConnection *conn,
 	DBusMessageIter iter, array;
 	int length, i;
 	gboolean has_cvsd = FALSE;
+	gboolean has_msbc = FALSE;
 
 	if (agent)
 		return __ofono_error_in_use(msg);
@@ -688,6 +689,8 @@ static DBusMessage *am_agent_register(DBusConnection *conn,
 		} else if (codecs[i] != HFP_CODEC_MSBC)
 			return __ofono_error_invalid_args(msg);
 
+		has_msbc = TRUE;
+
 		if (defer_setup)
 			has_wideband = TRUE;
 	}
@@ -703,6 +706,12 @@ static DBusMessage *am_agent_register(DBusConnection *conn,
 	agent->watch = g_dbus_add_disconnect_watch(conn, sender,
 						agent_disconnect, NULL, NULL);
 
+	DBG("Agent %s registered with the CODECs:%s%s", sender,
+		has_cvsd ? " CVSD" : "", has_msbc ? " mSBC" : "");
+
+        if (has_msbc && !has_wideband)
+		DBG("mSBC disabled due to lack of SCO defer setup support");
+
 	return dbus_message_new_method_return(msg);
 }
 
@@ -731,6 +740,8 @@ static DBusMessage *am_agent_unregister(DBusConnection *conn,
 	agent_free(agent);
 	agent = NULL;
 
+	DBG("Agent %s unregistered", sender);
+
 	return dbus_message_new_method_return(msg);
 }
 
-- 
1.7.11.7


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

* Re: [PATCH] handsfree-audio: Log when agent (un)register
  2013-04-16 22:32 ` =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita
@ 2013-04-16 19:22   ` Denis Kenzior
  0 siblings, 0 replies; 3+ messages in thread
From: Denis Kenzior @ 2013-04-16 19:22 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 368 bytes --]

Hi João Paulo,

On 04/16/2013 05:32 PM, João Paulo Rechi Vita wrote:
> This commit logs on debug level when a Handsfree Audio Agent registers
> or unregisters itself and the CODECs that are enabled.
> ---
>   src/handsfree-audio.c | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
>

Patch has been applied, thanks.

Regards,
-Denis


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

* [PATCH] handsfree-audio: Log when agent (un)register
  2013-04-12 22:29 [PATCH] handsfree-audio: Log when agent (un)register =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita
@ 2013-04-16 22:32 ` =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita
  2013-04-16 19:22   ` Denis Kenzior
  0 siblings, 1 reply; 3+ messages in thread
From: =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita @ 2013-04-16 22:32 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1159 bytes --]

This commit logs on debug level when a Handsfree Audio Agent registers
or unregisters itself and the CODECs that are enabled.
---
 src/handsfree-audio.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
index c24e787..dc37853 100644
--- a/src/handsfree-audio.c
+++ b/src/handsfree-audio.c
@@ -674,10 +674,16 @@ static DBusMessage *am_agent_register(DBusConnection *conn,
 			return __ofono_error_invalid_args(msg);
 	}
 
+	DBG("Agent %s registered with the CODECs:%s%s", sender,
+		has_cvsd ? " CVSD" : "", has_msbc ? " mSBC" : "");
+
 	if (has_msbc && defer_setup == 1)
 		has_wideband = TRUE;
-	else
+	else {
 		has_wideband = FALSE;
+		DBG("Wideband speech disabled: %s", has_msbc ?
+			"no SCO defer setup support" : "no mSBC support");
+	}
 
 	if (has_cvsd == FALSE) {
 		ofono_error("CVSD codec is mandatory");
@@ -718,6 +724,8 @@ static DBusMessage *am_agent_unregister(DBusConnection *conn,
 	agent_free(agent);
 	agent = NULL;
 
+	DBG("Agent %s unregistered", sender);
+
 	return dbus_message_new_method_return(msg);
 }
 
-- 
1.7.11.7


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

end of thread, other threads:[~2013-04-16 22:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-12 22:29 [PATCH] handsfree-audio: Log when agent (un)register =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita
2013-04-16 22:32 ` =?unknown-8bit?q?Jo=C3=A3o?= Paulo Rechi Vita
2013-04-16 19:22   ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.