From 8f6ea7c3d24dc21f120b6d29fc975936b4d4f3b7 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 17 Aug 2006 21:59:25 +0000 Subject: Add additional private data field --- include/sdp.h | 23 ----------------------- include/sdp_lib.h | 38 ++++++++++++++++++++++++++------------ 2 files changed, 26 insertions(+), 35 deletions(-) (limited to 'include') diff --git a/include/sdp.h b/include/sdp.h index 200a6b0e..f6af1261 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -373,18 +373,6 @@ extern "C" { #define SDP_SVC_REMOVE_REQ 0x79 #define SDP_SVC_REMOVE_RSP 0x80 -/* - * Values of the flags parameter to sdp_record_register - */ -#define SDP_RECORD_PERSIST 0x01 -#define SDP_DEVICE_RECORD 0x02 - -/* - * Values of the flags parameter to sdp_connect - */ -#define SDP_RETRY_IF_BUSY 0x01 -#define SDP_WAIT_ON_CLOSE 0x02 - /* * SDP Error codes */ @@ -499,17 +487,6 @@ struct sdp_data_struct { int unitSize; }; -/* - * a session with an SDP server - */ -typedef struct { - int sock; - int state; - int local; - int flags; - uint16_t tid; // Current transaction ID -} sdp_session_t; - #ifdef __cplusplus } #endif diff --git a/include/sdp_lib.h b/include/sdp_lib.h index dc074c6a..8a89ab6e 100644 --- a/include/sdp_lib.h +++ b/include/sdp_lib.h @@ -69,6 +69,30 @@ static inline void sdp_list_foreach(sdp_list_t *list, sdp_list_func_t f, void *u f(list->data, u); } +/* + * Values of the flags parameter to sdp_record_register + */ +#define SDP_RECORD_PERSIST 0x01 +#define SDP_DEVICE_RECORD 0x02 + +/* + * Values of the flags parameter to sdp_connect + */ +#define SDP_RETRY_IF_BUSY 0x01 +#define SDP_WAIT_ON_CLOSE 0x02 + +/* + * a session with an SDP server + */ +typedef struct { + int sock; + int state; + int local; + int flags; + uint16_t tid; // Current transaction ID + void *priv; +} sdp_session_t; + /* * create an L2CAP connection to a Bluetooth device * @@ -83,11 +107,9 @@ static inline void sdp_list_foreach(sdp_list_t *list, sdp_list_func_t f, void *u */ sdp_session_t *sdp_connect(const bdaddr_t *src, const bdaddr_t *dst, uint32_t flags); int sdp_close(sdp_session_t *session); +int sdp_get_socket(const sdp_session_t *session); -static inline int sdp_get_socket(const sdp_session_t *s) -{ - return s->sock; -} +uint16_t sdp_gen_tid(sdp_session_t *session); /* * find all devices in the piconet @@ -535,14 +557,6 @@ static inline int sdp_get_icon_url(const sdp_record_t *rec, char *str, int len) return sdp_get_string_attr(rec, SDP_ATTR_ICON_URL, str, len); } -/* - * Generate unique transaction identifiers - */ -static inline uint16_t sdp_gen_tid(sdp_session_t *session) -{ - return session->tid++; -} - sdp_record_t *sdp_extract_pdu(const uint8_t *pdata, int *scanned); sdp_data_t *sdp_extract_string(uint8_t *, int *); -- cgit