summaryrefslogtreecommitdiffstats
path: root/include/sdp_lib.h
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-08-17 21:59:25 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-08-17 21:59:25 +0000
commit8f6ea7c3d24dc21f120b6d29fc975936b4d4f3b7 (patch)
tree13adaefcf54de2406ecc33fa8a211a783a50bb1a /include/sdp_lib.h
parent914617b58d2b68d1e3792a77fc5dd37f78d2037b (diff)
Add additional private data field
Diffstat (limited to 'include/sdp_lib.h')
-rw-r--r--include/sdp_lib.h38
1 files changed, 26 insertions, 12 deletions
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 *);