mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-25 21:24:16 +08:00
Add sdp_set_notify function
This commit is contained in:
parent
8be090b298
commit
dd610a1269
@ -114,8 +114,9 @@ uint16_t sdp_gen_tid(sdp_session_t *session);
|
||||
/*
|
||||
* SDP transaction: functions for asynchronous search.
|
||||
*/
|
||||
typedef void sdp_callback_t(uint8_t type, sdp_list_t *rsp, void *udata, int err);
|
||||
typedef void sdp_callback_t(uint8_t type, uint16_t status, uint8_t *rsp, size_t *size, void *udata);
|
||||
sdp_session_t *sdp_create(int sk, uint32_t flags);
|
||||
int sdp_set_notify(sdp_session_t *session, sdp_callback_t *func, void *udata);
|
||||
|
||||
/*
|
||||
* find all devices in the piconet
|
||||
|
28
src/sdp.c
28
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
|
||||
|
Loading…
Reference in New Issue
Block a user