From dd610a12694a42aeb67417c95d87384f2eef8e70 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 25 Aug 2006 22:22:01 +0000 Subject: Add sdp_set_notify function --- src/sdp.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src') diff --git a/src/sdp.c b/src/sdp.c index f535ad48..5bbc8ec8 100644 --- a/src/sdp.c +++ b/src/sdp.c @@ -3085,6 +3085,34 @@ sdp_session_t *sdp_create(int sk, uint32_t flags) return session; } +/* + * Set the callback function to called when the transaction finishes + * + * INPUT: + * sdp_session_t *session + * Current sdp session to be handled + * sdp_callback_t *cb + * callback to be called when the transaction finishes + * void *udata + * user data passed to callback + * RETURN: + * 0 - Success + * -1 - Failure + */ +int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata) +{ + struct sdp_transaction *t; + + if (!session || !session->priv) + return -1; + + t = session->priv; + t->cb = func; + t->udata = udata; + + return 0; +} + /* * This is a service search request combined with the service * attribute request. First a service class match is done and -- cgit