diff options
| -rw-r--r-- | include/sdp.h | 23 | ||||
| -rw-r--r-- | include/sdp_lib.h | 38 | ||||
| -rw-r--r-- | src/sdp.c | 10 | 
3 files changed, 36 insertions, 35 deletions
| diff --git a/include/sdp.h b/include/sdp.h index 200a6b0e..f6af1261 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -374,18 +374,6 @@ extern "C" {  #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   */  #define SDP_INVALID_VERSION		0x0001 @@ -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 @@ -70,6 +70,30 @@ static inline void sdp_list_foreach(sdp_list_t *list, sdp_list_func_t f, void *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   *    * INPUT: @@ -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 *); @@ -3301,3 +3301,13 @@ fail:  	errno = err;  	return 0;  } + +int sdp_get_socket(const sdp_session_t *session) +{ +	return session->sock; +} + +uint16_t sdp_gen_tid(sdp_session_t *session) +{ +	return session->tid++; +} | 
