OSDN Git Service

audio/control: Enable initiate connection to CT role
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 9 Jul 2013 11:46:03 +0000 (14:46 +0300)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 12 Jul 2013 12:05:50 +0000 (15:05 +0300)
Since the policy uses service API to initiate the connections this needs
to be enabled for both CT and TG roles.

profiles/audio/control.c
profiles/audio/manager.c

index 35f1c35..912ca73 100644 (file)
@@ -108,9 +108,6 @@ int control_connect(struct btd_service *service)
        if (control->session)
                return -EALREADY;
 
-       if (!control->target)
-               return -ENOTSUP;
-
        control->session = avctp_connect(control->dev);
        if (!control->session)
                return -EIO;
index cb40583..b7522e1 100644 (file)
@@ -167,7 +167,7 @@ static int a2dp_sink_disconnect(struct btd_service *service)
        return sink_disconnect(service, FALSE);
 }
 
-static int avrcp_target_connect(struct btd_service *service)
+static int avrcp_control_connect(struct btd_service *service)
 {
        struct btd_device *dev = btd_service_get_device(service);
        const char *path = device_get_path(dev);
@@ -177,7 +177,7 @@ static int avrcp_target_connect(struct btd_service *service)
        return control_connect(service);
 }
 
-static int avrcp_target_disconnect(struct btd_service *service)
+static int avrcp_control_disconnect(struct btd_service *service)
 {
        struct btd_device *dev = btd_service_get_device(service);
        const char *path = device_get_path(dev);
@@ -304,8 +304,8 @@ static struct btd_profile avrcp_target_profile = {
        .device_probe   = avrcp_target_probe,
        .device_remove  = avrcp_target_remove,
 
-       .connect        = avrcp_target_connect,
-       .disconnect     = avrcp_target_disconnect,
+       .connect        = avrcp_control_connect,
+       .disconnect     = avrcp_control_disconnect,
 
        .adapter_probe  = avrcp_target_server_probe,
        .adapter_remove = avrcp_target_server_remove,
@@ -318,6 +318,9 @@ static struct btd_profile avrcp_remote_profile = {
        .device_probe   = avrcp_remote_probe,
        .device_remove  = avrcp_remote_remove,
 
+       .connect        = avrcp_control_connect,
+       .disconnect     = avrcp_control_disconnect,
+
        .adapter_probe  = avrcp_remote_server_probe,
        .adapter_remove = avrcp_remote_server_remove,
 };