handsfree-audio: Add debug logging
authorJoão Paulo Rechi Vita <jprvita@openbossa.org>
Tue, 16 Apr 2013 22:32:21 +0000 (19:32 -0300)
committerDenis Kenzior <denkenz@gmail.com>
Tue, 16 Apr 2013 19:20:40 +0000 (14:20 -0500)
Print debug messages when Handsfree Audio Agent registers or unregisters
itself.

src/handsfree-audio.c

index c24e78762c060cd29c76816daec41256e9541642..dc378534ca9de984daeae4f6905a3904a5f47373 100644 (file)
@@ -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);
 }