static void stream_setup_complete(struct avdtp *session, struct a2dp_sep *sep, struct avdtp_stream *stream, struct avdtp_error *err, void *user_data) { struct source *source = user_data; source->connect_id = 0; if (stream) { DBG("Stream successfully created"); audio_source_connected(source->dev->btd_dev, 0); return; } avdtp_unref(source->session); source->session = NULL; if (avdtp_error_category(err) == AVDTP_ERRNO && avdtp_error_posix_errno(err) != EHOSTDOWN) { DBG("connect:connect XCASE detected"); source->retry_id = g_timeout_add_seconds(STREAM_SETUP_RETRY_TIMER, stream_setup_retry, source); } else { DBG("Stream setup failed : %s", avdtp_strerror(err)); audio_source_connected(source->dev->btd_dev, -EIO); } }
static void stream_setup_complete(struct avdtp *session, struct a2dp_sep *sep, struct avdtp_stream *stream, struct avdtp_error *err, void *user_data) { struct sink *sink = user_data; struct pending_request *pending; pending = sink->connect; if (stream) { DBusMessage *reply; sink->connect = NULL; reply = dbus_message_new_method_return(pending->msg); dbus_connection_send(pending->conn, reply, NULL); dbus_message_unref(reply); pending_request_free(pending); debug("Stream successfully created"); } else { avdtp_unref(sink->session); sink->session = NULL; if (avdtp_error_type(err) == AVDTP_ERROR_ERRNO && avdtp_error_posix_errno(err) != EHOSTDOWN) { debug("connect:connect XCASE detected"); g_timeout_add(STREAM_SETUP_RETRY_TIMER, stream_setup_retry, sink); } else { sink->connect = NULL; error_failed(pending->conn, pending->msg, "Stream setup failed"); pending_request_free(pending); debug("Stream setup failed : %s", avdtp_strerror(err)); } } }
static void stream_setup_complete(struct avdtp *session, struct a2dp_sep *sep, struct avdtp_stream *stream, struct avdtp_error *err, void *user_data) { struct sink *sink = user_data; struct pending_request *pending; pending = sink->connect; pending->id = 0; if (stream) { DBG("Stream successfully created"); if (pending->msg) { DBusMessage *reply; reply = dbus_message_new_method_return(pending->msg); g_dbus_send_message(pending->conn, reply); } sink->connect = NULL; pending_request_free(sink->dev, pending); return; } avdtp_unref(sink->session); sink->session = NULL; if (avdtp_error_category(err) == AVDTP_ERRNO && avdtp_error_posix_errno(err) != EHOSTDOWN) { DBG("connect:connect XCASE detected"); sink->retry_id = g_timeout_add_seconds(STREAM_SETUP_RETRY_TIMER, stream_setup_retry, sink); } else { if (pending->msg) error_failed(pending->conn, pending->msg, "Stream setup failed"); sink->connect = NULL; pending_request_free(sink->dev, pending); DBG("Stream setup failed : %s", avdtp_strerror(err)); } }