diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2007-09-28 13:46:55 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2007-09-28 13:46:55 +0000 |
commit | 847dad179fe16ec395373e4b55d46dcd400c623a (patch) | |
tree | 139f0bdc92e1d7ea3be3f787ace5a7064f8e29b3 /audio/avdtp.c | |
parent | 11275793e04e21cb7e26d6a7d289f98005a3c478 (diff) |
Expose stream setup errors higher up in the call stack
Diffstat (limited to 'audio/avdtp.c')
-rw-r--r-- | audio/avdtp.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/audio/avdtp.c b/audio/avdtp.c index 7907763a..ee1bd06d 100644 --- a/audio/avdtp.c +++ b/audio/avdtp.c @@ -77,11 +77,6 @@ #define STREAM_TIMEOUT 20000 typedef enum { - AVDTP_ERROR_ERRNO, - AVDTP_ERROR_ERROR_CODE -} avdtp_error_type_t; - -typedef enum { AVDTP_SESSION_STATE_DISCONNECTED, AVDTP_SESSION_STATE_CONNECTING, AVDTP_SESSION_STATE_CONNECTED @@ -362,14 +357,6 @@ struct avdtp { DBusPendingCall *pending_auth; }; -struct avdtp_error { - avdtp_error_type_t type; - union { - uint8_t error_code; - int posix_errno; - } err; -}; - static uint8_t free_seid = 1; static GSList *local_seps = NULL; @@ -499,7 +486,7 @@ static void set_disconnect_timer(struct avdtp *session) disconnect_timeout, session); } -static void avdtp_error_init(struct avdtp_error *err, uint8_t type, int id) +void avdtp_error_init(struct avdtp_error *err, uint8_t type, int id) { err->type = type; switch (type) { @@ -698,10 +685,15 @@ static void avdtp_sep_set_state(struct avdtp *session, static void finalize_discovery(struct avdtp *session, int err) { + struct avdtp_error avdtp_err; + + avdtp_error_init(&avdtp_err, AVDTP_ERROR_ERRNO, -err); + if (!session->discov_cb) return; - session->discov_cb(session, session->seps, err, + session->discov_cb(session, session->seps, + err ? &avdtp_err : NULL, session->user_data); session->discov_cb = NULL; |