avrcp_register_notification(session,
AVRCP_EVENT_VOLUME_CHANGED);
- audio_controller_connected(session->dev->btd_dev, 0);
+ control_remote_connected(session->dev->control, 0);
}
static void session_ct_init_browsing(struct avrcp *session)
if (session->version >= 0x0104)
session->supported_events = (1 << AVRCP_EVENT_VOLUME_CHANGED);
- audio_target_connected(session->dev->btd_dev, 0);
+ control_target_connected(session->dev->control, 0);
player = create_ct_player(session, 0);
if (player == NULL)
player->sessions = g_slist_remove(player->sessions, session);
if (session->control_id == 0)
- audio_controller_connected(session->dev->btd_dev, -EIO);
-
- audio_controller_disconnected(session->dev->btd_dev, 0);
+ control_remote_connected(session->dev->control, -EIO);
+ else
+ control_remote_disconnected(session->dev->control, 0);
session_destroy(session);
}
g_slist_free_full(session->players, player_destroy);
if (session->control_id == 0)
- audio_target_connected(session->dev->btd_dev, -EIO);
-
- audio_target_disconnected(session->dev->btd_dev, 0);
+ control_target_connected(session->dev->control, -EIO);
+ else
+ control_target_disconnected(session->dev->control, 0);
session_destroy(session);
}
unsigned int avctp_id;
};
+void control_target_connected(struct control *control, int err)
+{
+ struct btd_device *device = btd_service_get_device(control->target);
+ struct btd_profile *profile = btd_service_get_profile(control->target);
+
+ device_profile_connected(device, profile, err);
+}
+
+void control_target_disconnected(struct control *control, int err)
+{
+ struct btd_device *device = btd_service_get_device(control->target);
+ struct btd_profile *profile = btd_service_get_profile(control->target);
+
+ device_profile_disconnected(device, profile, err);
+}
+
+void control_remote_connected(struct control *control, int err)
+{
+ struct btd_device *device = btd_service_get_device(control->remote);
+ struct btd_profile *profile = btd_service_get_profile(control->remote);
+
+ device_profile_connected(device, profile, err);
+}
+
+void control_remote_disconnected(struct control *control, int err)
+{
+ struct btd_device *device = btd_service_get_device(control->remote);
+ struct btd_profile *profile = btd_service_get_profile(control->remote);
+
+ device_profile_disconnected(device, profile, err);
+}
+
static void state_changed(struct audio_device *dev, avctp_state_t old_state,
avctp_state_t new_state)
{
int control_connect(struct audio_device *dev);
int control_disconnect(struct audio_device *dev);
+
+void control_target_connected(struct control *control, int err);
+void control_target_disconnected(struct control *control, int err);
+void control_remote_connected(struct control *control, int err);
+void control_remote_disconnected(struct control *control, int err);
device_profile_disconnected(dev, &a2dp_source_profile, err);
}
-void audio_target_connected(struct btd_device *dev, int err)
-{
- device_profile_connected(dev, &avrcp_target_profile, err);
-}
-
-void audio_target_disconnected(struct btd_device *dev, int err)
-{
- device_profile_disconnected(dev, &avrcp_target_profile, err);
-}
-
-void audio_controller_connected(struct btd_device *dev, int err)
-{
- device_profile_connected(dev, &avrcp_remote_profile, err);
-}
-
-void audio_controller_disconnected(struct btd_device *dev, int err)
-{
- device_profile_disconnected(dev, &avrcp_remote_profile, err);
-}
-
int audio_manager_init(GKeyFile *conf)
{
if (conf)
void audio_sink_disconnected(struct btd_device *dev, int err);
void audio_source_connected(struct btd_device *dev, int err);
void audio_source_disconnected(struct btd_device *dev, int err);
-void audio_target_connected(struct btd_device *dev, int err);
-void audio_target_disconnected(struct btd_device *dev, int err);
-void audio_controller_connected(struct btd_device *dev, int err);
-void audio_controller_disconnected(struct btd_device *dev, int err);
int audio_manager_init(GKeyFile *config);
void audio_manager_exit(void);