Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
sdp.h
Go to the documentation of this file.
1
4
5/*
6 * Copyright (c) 2016 Intel Corporation
7 *
8 * SPDX-License-Identifier: Apache-2.0
9 */
10#ifndef ZEPHYR_INCLUDE_BLUETOOTH_CLASSIC_SDP_H_
11#define ZEPHYR_INCLUDE_BLUETOOTH_CLASSIC_SDP_H_
12
22
23#include <sys/types.h>
24
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32/*
33 * All definitions are based on Bluetooth Assigned Numbers
34 * of the Bluetooth Specification
35 */
36
41#define BT_SDP_SDP_SERVER_SVCLASS 0x1000
42#define BT_SDP_BROWSE_GRP_DESC_SVCLASS 0x1001
43#define BT_SDP_PUBLIC_BROWSE_GROUP 0x1002
44#define BT_SDP_SERIAL_PORT_SVCLASS 0x1101
45#define BT_SDP_LAN_ACCESS_SVCLASS 0x1102
46#define BT_SDP_DIALUP_NET_SVCLASS 0x1103
47#define BT_SDP_IRMC_SYNC_SVCLASS 0x1104
48#define BT_SDP_OBEX_OBJPUSH_SVCLASS 0x1105
49#define BT_SDP_OBEX_FILETRANS_SVCLASS 0x1106
50#define BT_SDP_IRMC_SYNC_CMD_SVCLASS 0x1107
51#define BT_SDP_HEADSET_SVCLASS 0x1108
52#define BT_SDP_CORDLESS_TELEPHONY_SVCLASS 0x1109
53#define BT_SDP_AUDIO_SOURCE_SVCLASS 0x110a
54#define BT_SDP_AUDIO_SINK_SVCLASS 0x110b
55#define BT_SDP_AV_REMOTE_TARGET_SVCLASS 0x110c
56#define BT_SDP_ADVANCED_AUDIO_SVCLASS 0x110d
57#define BT_SDP_AV_REMOTE_SVCLASS 0x110e
58#define BT_SDP_AV_REMOTE_CONTROLLER_SVCLASS 0x110f
59#define BT_SDP_INTERCOM_SVCLASS 0x1110
60#define BT_SDP_FAX_SVCLASS 0x1111
61#define BT_SDP_HEADSET_AGW_SVCLASS 0x1112
62#define BT_SDP_WAP_SVCLASS 0x1113
63#define BT_SDP_WAP_CLIENT_SVCLASS 0x1114
64#define BT_SDP_PANU_SVCLASS 0x1115
65#define BT_SDP_NAP_SVCLASS 0x1116
66#define BT_SDP_GN_SVCLASS 0x1117
67#define BT_SDP_DIRECT_PRINTING_SVCLASS 0x1118
68#define BT_SDP_REFERENCE_PRINTING_SVCLASS 0x1119
69#define BT_SDP_IMAGING_SVCLASS 0x111a
70#define BT_SDP_IMAGING_RESPONDER_SVCLASS 0x111b
71#define BT_SDP_IMAGING_ARCHIVE_SVCLASS 0x111c
72#define BT_SDP_IMAGING_REFOBJS_SVCLASS 0x111d
73#define BT_SDP_HANDSFREE_SVCLASS 0x111e
74#define BT_SDP_HANDSFREE_AGW_SVCLASS 0x111f
75#define BT_SDP_DIRECT_PRT_REFOBJS_SVCLASS 0x1120
76#define BT_SDP_REFLECTED_UI_SVCLASS 0x1121
77#define BT_SDP_BASIC_PRINTING_SVCLASS 0x1122
78#define BT_SDP_PRINTING_STATUS_SVCLASS 0x1123
79#define BT_SDP_HID_SVCLASS 0x1124
80#define BT_SDP_HCR_SVCLASS 0x1125
81#define BT_SDP_HCR_PRINT_SVCLASS 0x1126
82#define BT_SDP_HCR_SCAN_SVCLASS 0x1127
83#define BT_SDP_CIP_SVCLASS 0x1128
84#define BT_SDP_VIDEO_CONF_GW_SVCLASS 0x1129
85#define BT_SDP_UDI_MT_SVCLASS 0x112a
86#define BT_SDP_UDI_TA_SVCLASS 0x112b
87#define BT_SDP_AV_SVCLASS 0x112c
88#define BT_SDP_SAP_SVCLASS 0x112d
89#define BT_SDP_PBAP_PCE_SVCLASS 0x112e
90#define BT_SDP_PBAP_PSE_SVCLASS 0x112f
91#define BT_SDP_PBAP_SVCLASS 0x1130
92#define BT_SDP_MAP_MSE_SVCLASS 0x1132
93#define BT_SDP_MAP_MCE_SVCLASS 0x1133
94#define BT_SDP_MAP_SVCLASS 0x1134
95#define BT_SDP_GNSS_SVCLASS 0x1135
96#define BT_SDP_GNSS_SERVER_SVCLASS 0x1136
97#define BT_SDP_MPS_SC_SVCLASS 0x113a
98#define BT_SDP_MPS_SVCLASS 0x113b
99#define BT_SDP_PNP_INFO_SVCLASS 0x1200
100#define BT_SDP_GENERIC_NETWORKING_SVCLASS 0x1201
101#define BT_SDP_GENERIC_FILETRANS_SVCLASS 0x1202
102#define BT_SDP_GENERIC_AUDIO_SVCLASS 0x1203
103#define BT_SDP_GENERIC_TELEPHONY_SVCLASS 0x1204
104#define BT_SDP_UPNP_SVCLASS 0x1205
105#define BT_SDP_UPNP_IP_SVCLASS 0x1206
106#define BT_SDP_UPNP_PAN_SVCLASS 0x1300
107#define BT_SDP_UPNP_LAP_SVCLASS 0x1301
108#define BT_SDP_UPNP_L2CAP_SVCLASS 0x1302
109#define BT_SDP_VIDEO_SOURCE_SVCLASS 0x1303
110#define BT_SDP_VIDEO_SINK_SVCLASS 0x1304
111#define BT_SDP_VIDEO_DISTRIBUTION_SVCLASS 0x1305
112#define BT_SDP_HDP_SVCLASS 0x1400
113#define BT_SDP_HDP_SOURCE_SVCLASS 0x1401
114#define BT_SDP_HDP_SINK_SVCLASS 0x1402
115#define BT_SDP_GENERIC_ACCESS_SVCLASS 0x1800
116#define BT_SDP_GENERIC_ATTRIB_SVCLASS 0x1801
117#define BT_SDP_APPLE_AGENT_SVCLASS 0x2112
121
122#define BT_SDP_SERVER_RECORD_HANDLE 0x0000
123
132#define BT_SDP_ATTR_RECORD_HANDLE 0x0000
133#define BT_SDP_ATTR_SVCLASS_ID_LIST 0x0001
134#define BT_SDP_ATTR_RECORD_STATE 0x0002
135#define BT_SDP_ATTR_SERVICE_ID 0x0003
136#define BT_SDP_ATTR_PROTO_DESC_LIST 0x0004
137#define BT_SDP_ATTR_BROWSE_GRP_LIST 0x0005
138#define BT_SDP_ATTR_LANG_BASE_ATTR_ID_LIST 0x0006
139#define BT_SDP_ATTR_SVCINFO_TTL 0x0007
140#define BT_SDP_ATTR_SERVICE_AVAILABILITY 0x0008
141#define BT_SDP_ATTR_PROFILE_DESC_LIST 0x0009
142#define BT_SDP_ATTR_DOC_URL 0x000a
143#define BT_SDP_ATTR_CLNT_EXEC_URL 0x000b
144#define BT_SDP_ATTR_ICON_URL 0x000c
145#define BT_SDP_ATTR_ADD_PROTO_DESC_LIST 0x000d
146
147#define BT_SDP_ATTR_GROUP_ID 0x0200
148#define BT_SDP_ATTR_IP_SUBNET 0x0200
149#define BT_SDP_ATTR_VERSION_NUM_LIST 0x0200
150#define BT_SDP_ATTR_SUPPORTED_FEATURES_LIST 0x0200
151#define BT_SDP_ATTR_GOEP_L2CAP_PSM 0x0200
152#define BT_SDP_ATTR_SVCDB_STATE 0x0201
153
154#define BT_SDP_ATTR_MPSD_SCENARIOS 0x0200
155#define BT_SDP_ATTR_MPMD_SCENARIOS 0x0201
156#define BT_SDP_ATTR_MPS_DEPENDENCIES 0x0202
157
158#define BT_SDP_ATTR_SERVICE_VERSION 0x0300
159#define BT_SDP_ATTR_EXTERNAL_NETWORK 0x0301
160#define BT_SDP_ATTR_SUPPORTED_DATA_STORES_LIST 0x0301
161#define BT_SDP_ATTR_DATA_EXCHANGE_SPEC 0x0301
162#define BT_SDP_ATTR_NETWORK 0x0301
163#define BT_SDP_ATTR_FAX_CLASS1_SUPPORT 0x0302
164#define BT_SDP_ATTR_REMOTE_AUDIO_VOLUME_CONTROL 0x0302
165#define BT_SDP_ATTR_MCAP_SUPPORTED_PROCEDURES 0x0302
166#define BT_SDP_ATTR_FAX_CLASS20_SUPPORT 0x0303
167#define BT_SDP_ATTR_SUPPORTED_FORMATS_LIST 0x0303
168#define BT_SDP_ATTR_FAX_CLASS2_SUPPORT 0x0304
169#define BT_SDP_ATTR_AUDIO_FEEDBACK_SUPPORT 0x0305
170#define BT_SDP_ATTR_NETWORK_ADDRESS 0x0306
171#define BT_SDP_ATTR_WAP_GATEWAY 0x0307
172#define BT_SDP_ATTR_HOMEPAGE_URL 0x0308
173#define BT_SDP_ATTR_WAP_STACK_TYPE 0x0309
174#define BT_SDP_ATTR_SECURITY_DESC 0x030a
175#define BT_SDP_ATTR_NET_ACCESS_TYPE 0x030b
176#define BT_SDP_ATTR_MAX_NET_ACCESSRATE 0x030c
177#define BT_SDP_ATTR_IP4_SUBNET 0x030d
178#define BT_SDP_ATTR_IP6_SUBNET 0x030e
179#define BT_SDP_ATTR_SUPPORTED_CAPABILITIES 0x0310
180#define BT_SDP_ATTR_SUPPORTED_FEATURES 0x0311
181#define BT_SDP_ATTR_SUPPORTED_FUNCTIONS 0x0312
182#define BT_SDP_ATTR_TOTAL_IMAGING_DATA_CAPACITY 0x0313
183#define BT_SDP_ATTR_SUPPORTED_REPOSITORIES 0x0314
184#define BT_SDP_ATTR_MAS_INSTANCE_ID 0x0315
185#define BT_SDP_ATTR_SUPPORTED_MESSAGE_TYPES 0x0316
186#define BT_SDP_ATTR_PBAP_SUPPORTED_FEATURES 0x0317
187#define BT_SDP_ATTR_MAP_SUPPORTED_FEATURES 0x0317
188
189#define BT_SDP_ATTR_SPECIFICATION_ID 0x0200
190#define BT_SDP_ATTR_VENDOR_ID 0x0201
191#define BT_SDP_ATTR_PRODUCT_ID 0x0202
192#define BT_SDP_ATTR_VERSION 0x0203
193#define BT_SDP_ATTR_PRIMARY_RECORD 0x0204
194#define BT_SDP_ATTR_VENDOR_ID_SOURCE 0x0205
195
196#define BT_SDP_ATTR_HID_DEVICE_RELEASE_NUMBER 0x0200
197#define BT_SDP_ATTR_HID_PARSER_VERSION 0x0201
198#define BT_SDP_ATTR_HID_DEVICE_SUBCLASS 0x0202
199#define BT_SDP_ATTR_HID_COUNTRY_CODE 0x0203
200#define BT_SDP_ATTR_HID_VIRTUAL_CABLE 0x0204
201#define BT_SDP_ATTR_HID_RECONNECT_INITIATE 0x0205
202#define BT_SDP_ATTR_HID_DESCRIPTOR_LIST 0x0206
203#define BT_SDP_ATTR_HID_LANG_ID_BASE_LIST 0x0207
204#define BT_SDP_ATTR_HID_SDP_DISABLE 0x0208
205#define BT_SDP_ATTR_HID_BATTERY_POWER 0x0209
206#define BT_SDP_ATTR_HID_REMOTE_WAKEUP 0x020a
207#define BT_SDP_ATTR_HID_PROFILE_VERSION 0x020b
208#define BT_SDP_ATTR_HID_SUPERVISION_TIMEOUT 0x020c
209#define BT_SDP_ATTR_HID_NORMALLY_CONNECTABLE 0x020d
210#define BT_SDP_ATTR_HID_BOOT_DEVICE 0x020e
211#define BT_SDP_ATTR_HID_SSR_HOST_MAX_LATENCY 0x020f
212#define BT_SDP_ATTR_HID_SSR_HOST_MIN_TIMEOUT 0x0210
216
217/*
218 * These identifiers are based on the SDP spec stating that
219 * "base attribute id of the primary (universal) language must be 0x0100"
220 *
221 * Other languages should have their own offset; e.g.:
222 * #define XXXLangBase yyyy
223 * #define AttrServiceName_XXX 0x0000+XXXLangBase
224 */
225#define BT_SDP_PRIMARY_LANG_BASE 0x0100
226
227#define BT_SDP_ATTR_SVCNAME_PRIMARY (0x0000 + BT_SDP_PRIMARY_LANG_BASE)
228#define BT_SDP_ATTR_SVCDESC_PRIMARY (0x0001 + BT_SDP_PRIMARY_LANG_BASE)
229#define BT_SDP_ATTR_PROVNAME_PRIMARY (0x0002 + BT_SDP_PRIMARY_LANG_BASE)
230
241#define BT_SDP_PROTO_SDP 0x0001
242#define BT_SDP_PROTO_UDP 0x0002
243#define BT_SDP_PROTO_RFCOMM 0x0003
244#define BT_SDP_PROTO_TCP 0x0004
245#define BT_SDP_PROTO_TCS_BIN 0x0005
246#define BT_SDP_PROTO_TCS_AT 0x0006
247#define BT_SDP_PROTO_ATT 0x0007
248#define BT_SDP_PROTO_OBEX 0x0008
249#define BT_SDP_PROTO_IP 0x0009
250#define BT_SDP_PROTO_FTP 0x000a
251#define BT_SDP_PROTO_HTTP 0x000c
252#define BT_SDP_PROTO_WSP 0x000e
253#define BT_SDP_PROTO_BNEP 0x000f
254#define BT_SDP_PROTO_UPNP 0x0010
255#define BT_SDP_PROTO_HID 0x0011
256#define BT_SDP_PROTO_HARDCOPY_CTRL 0x0012
257#define BT_SDP_PROTO_HARDCOPY_DATA 0x0014
258#define BT_SDP_PROTO_HARDCOPY_NTF 0x0016
259#define BT_SDP_PROTO_AVCTP 0x0017
260#define BT_SDP_PROTO_AVDTP 0x0019
261#define BT_SDP_PROTO_CMTP 0x001b
262#define BT_SDP_PROTO_MCAP_CTRL 0x001e
263#define BT_SDP_PROTO_MCAP_DATA 0x001f
264#define BT_SDP_PROTO_L2CAP 0x0100
268
297#define BT_SDP_DATA_NIL 0x00
298#define BT_SDP_UINT8 0x08
299#define BT_SDP_UINT16 0x09
300#define BT_SDP_UINT32 0x0a
301#define BT_SDP_UINT64 0x0b
302#define BT_SDP_UINT128 0x0c
303#define BT_SDP_INT8 0x10
304#define BT_SDP_INT16 0x11
305#define BT_SDP_INT32 0x12
306#define BT_SDP_INT64 0x13
307#define BT_SDP_INT128 0x14
308#define BT_SDP_UUID_UNSPEC 0x18
309#define BT_SDP_UUID16 0x19
310#define BT_SDP_UUID32 0x1a
311#define BT_SDP_UUID128 0x1c
312#define BT_SDP_TEXT_STR_UNSPEC 0x20
313#define BT_SDP_TEXT_STR8 0x25
314#define BT_SDP_TEXT_STR16 0x26
315#define BT_SDP_TEXT_STR32 0x27
316#define BT_SDP_BOOL 0x28
317#define BT_SDP_SEQ_UNSPEC 0x30
318#define BT_SDP_SEQ8 0x35
319#define BT_SDP_SEQ16 0x36
320#define BT_SDP_SEQ32 0x37
321#define BT_SDP_ALT_UNSPEC 0x38
322#define BT_SDP_ALT8 0x3d
323#define BT_SDP_ALT16 0x3e
324#define BT_SDP_ALT32 0x3f
325#define BT_SDP_URL_STR_UNSPEC 0x40
326#define BT_SDP_URL_STR8 0x45
327#define BT_SDP_URL_STR16 0x46
328#define BT_SDP_URL_STR32 0x47
332
333#define BT_SDP_TYPE_DESC_MASK 0xf8
334#define BT_SDP_SIZE_DESC_MASK 0x07
335#define BT_SDP_SIZE_INDEX_OFFSET 5
336
344
350
359
360/*
361 * --------------------------------------------------- ------------------
362 * | Service Hdl | Attr list ptr | Attr count | Next | -> | Service Hdl | ...
363 * --------------------------------------------------- ------------------
364 */
365
369#define BT_SDP_ARRAY_8(...) ((uint8_t[]) {__VA_ARGS__})
370
374#define BT_SDP_ARRAY_16(...) ((uint16_t[]) {__VA_ARGS__})
375
379#define BT_SDP_ARRAY_32(...) ((uint32_t[]) {__VA_ARGS__})
380
403#define BT_SDP_ARRAY_UUID_128(w32, w1, w2, w3, w48) \
404 BT_SDP_ARRAY_8(BT_UUID_128_ENCODE(w32, w1, w2, w3, w48))
405
411#define BT_SDP_TYPE_SIZE(_type) .type = _type, \
412 .data_size = BIT(_type & BT_SDP_SIZE_DESC_MASK), \
413 .total_size = BIT(_type & BT_SDP_SIZE_DESC_MASK) + 1
414
421#define BT_SDP_TYPE_SIZE_VAR(_type, _size) .type = _type, \
422 .data_size = _size, \
423 .total_size = BIT((_type & BT_SDP_SIZE_DESC_MASK) - \
424 BT_SDP_SIZE_INDEX_OFFSET) + _size + 1
425
429#define BT_SDP_DATA_ELEM_LIST(...) ((struct bt_sdp_data_elem[]) {__VA_ARGS__})
430
431
440#define BT_SDP_NEW_SERVICE \
441{ \
442 BT_SDP_ATTR_RECORD_HANDLE, \
443 { BT_SDP_TYPE_SIZE(BT_SDP_UINT32), BT_SDP_ARRAY_32(0) } \
444}, \
445{ \
446 BT_SDP_ATTR_RECORD_STATE, \
447 { BT_SDP_TYPE_SIZE(BT_SDP_UINT32), BT_SDP_ARRAY_32(0) } \
448}, \
449{ \
450 BT_SDP_ATTR_LANG_BASE_ATTR_ID_LIST, \
451 { BT_SDP_TYPE_SIZE_VAR(BT_SDP_SEQ8, 9), \
452 BT_SDP_DATA_ELEM_LIST( \
453 { BT_SDP_TYPE_SIZE(BT_SDP_UINT16), BT_SDP_ARRAY_8('n', 'e') }, \
454 { BT_SDP_TYPE_SIZE(BT_SDP_UINT16), BT_SDP_ARRAY_16(106) }, \
455 { BT_SDP_TYPE_SIZE(BT_SDP_UINT16), \
456 BT_SDP_ARRAY_16(BT_SDP_PRIMARY_LANG_BASE) } \
457 ), \
458 } \
459}, \
460{ \
461 BT_SDP_ATTR_BROWSE_GRP_LIST, \
462 { BT_SDP_TYPE_SIZE_VAR(BT_SDP_SEQ8, 3), \
463 BT_SDP_DATA_ELEM_LIST( \
464 { BT_SDP_TYPE_SIZE(BT_SDP_UUID16), \
465 BT_SDP_ARRAY_16(BT_SDP_PUBLIC_BROWSE_GROUP) }, \
466 ), \
467 } \
468}
469
470
480#define BT_SDP_LIST(_att_id, _type_size, _data_elem_seq) \
481{ \
482 _att_id, { _type_size, _data_elem_seq } \
483}
484
492#define BT_SDP_SERVICE_ID(_uuid) \
493{ \
494 BT_SDP_ATTR_SERVICE_ID, \
495 { BT_SDP_TYPE_SIZE(BT_SDP_UUID16), &((struct bt_uuid_16) _uuid) } \
496}
497
505#define BT_SDP_SERVICE_NAME(_name) \
506{ \
507 BT_SDP_ATTR_SVCNAME_PRIMARY, \
508 { BT_SDP_TYPE_SIZE_VAR(BT_SDP_TEXT_STR8, (sizeof(_name)-1)), _name } \
509}
510
518#define BT_SDP_SUPPORTED_FEATURES(_features) \
519{ \
520 BT_SDP_ATTR_SUPPORTED_FEATURES, \
521 { BT_SDP_TYPE_SIZE(BT_SDP_UINT16), BT_SDP_ARRAY_16(_features) } \
522}
523
531#define BT_SDP_SUPPORTED_CAPABILITIES(_capabilities) \
532{ \
533 BT_SDP_ATTR_SUPPORTED_CAPABILITIES, \
534 { BT_SDP_TYPE_SIZE(BT_SDP_UINT8), BT_SDP_ARRAY_8(_capabilities) } \
535}
536
544#define BT_SDP_SUPPORTED_FUNCTIONS(_functions) \
545{ \
546 BT_SDP_ATTR_SUPPORTED_FUNCTIONS, \
547 { BT_SDP_TYPE_SIZE(BT_SDP_UINT32), BT_SDP_ARRAY_32(_functions) } \
548}
549
557#define BT_SDP_RECORD(_attrs) \
558{ \
559 .attrs = _attrs, \
560 .attr_count = ARRAY_SIZE((_attrs)), \
561}
562
563/* Server API */
564
577
578/* Client API */
579
587
591enum {
594};
595
597
626typedef uint8_t (*bt_sdp_discover_func_t)(struct bt_conn *conn, struct bt_sdp_client_result *result,
627 const struct bt_sdp_discover_params *params);
628
630enum {
637};
638
640#define BT_SDP_ATTR_ID_RANGE(beginning, ending) {(beginning), (ending)}
641
654
662
686
722
723int bt_sdp_discover(struct bt_conn *conn,
724 struct bt_sdp_discover_params *params);
725
737 const struct bt_sdp_discover_params *params);
738
739
740/* Helper types & functions for SDP client to get essential data from server */
741
754int bt_sdp_get_proto_param(const struct net_buf *buf, uint16_t proto,
755 uint16_t *param);
756
771int bt_sdp_get_addl_proto_param(const struct net_buf *buf, uint16_t proto, uint8_t index,
772 uint16_t *param);
773
786int bt_sdp_get_profile_version(const struct net_buf *buf, uint16_t profile,
787 uint16_t *version);
788
799int bt_sdp_get_features(const struct net_buf *buf, uint16_t *features);
800
812int bt_sdp_get_vendor_id(const struct net_buf *buf, uint16_t *vendor_id);
813
826int bt_sdp_get_product_id(const struct net_buf *buf, uint16_t *product_id);
827
843int bt_sdp_record_parse(const struct net_buf *buf,
844 bool (*func)(const struct bt_sdp_attribute *attr, void *user_data),
845 void *user_data);
846
856bool bt_sdp_has_attr(const struct net_buf *buf, uint16_t attr_id);
857
870int bt_sdp_get_attr(const struct net_buf *buf, uint16_t attr_id, struct bt_sdp_attribute *attr);
871
890
909
920
931
945
970
988
1005 bool (*func)(const struct bt_sdp_attr_value_pair *value,
1006 void *user_data),
1007 void *user_data);
1008
1019bool bt_sdp_attr_has_uuid(const struct bt_sdp_attribute *attr, const struct bt_uuid *uuid);
1020
1034int bt_sdp_attr_read(const struct bt_sdp_attribute *attr, const struct bt_uuid *uuid,
1035 struct bt_sdp_attr_value *value);
1036
1053 bool (*func)(const struct bt_sdp_attribute *attr, void *user_data),
1054 void *user_data);
1055
1068
1088 const struct bt_uuid *uuid, struct bt_sdp_attr_value *value);
1089
1090#ifdef __cplusplus
1091}
1092#endif
1093
1097
1098#endif /* ZEPHYR_INCLUDE_BLUETOOTH_CLASSIC_SDP_H_ */
Bluetooth UUID handling.
Bluetooth connection handling.
bool bt_sdp_attr_has_uuid(const struct bt_sdp_attribute *attr, const struct bt_uuid *uuid)
Check if SDP attribute contains a specific UUID.
int bt_sdp_record_parse(const struct net_buf *buf, bool(*func)(const struct bt_sdp_attribute *attr, void *user_data), void *user_data)
Iterate through discovered SDP record.
bool bt_sdp_has_attr(const struct net_buf *buf, uint16_t attr_id)
check if the specific attribute identifier is found.
#define BT_SDP_SIZE_DESC_MASK
Definition sdp.h:334
int bt_sdp_attr_read(const struct bt_sdp_attribute *attr, const struct bt_uuid *uuid, struct bt_sdp_attr_value *value)
Read SDP attribute value for a specific UUID.
int bt_sdp_discover(struct bt_conn *conn, struct bt_sdp_discover_params *params)
Allows user to start SDP discovery session.
int bt_sdp_discover_cancel(struct bt_conn *conn, const struct bt_sdp_discover_params *params)
Release waiting SDP discovery request.
bt_sdp_attr_value_type
SDP attribute value type enumeration.
Definition sdp.h:937
int bt_sdp_register_service(struct bt_sdp_record *service)
Register a Service Record.
int bt_sdp_get_product_id(const struct net_buf *buf, uint16_t *product_id)
Get Product ID.
#define BT_SDP_UINT128
Unsigned 128-bit integer.
Definition sdp.h:302
int bt_sdp_get_attr(const struct net_buf *buf, uint16_t attr_id, struct bt_sdp_attribute *attr)
Get a specific attribute by ID from SDP record.
int bt_sdp_get_profile_version(const struct net_buf *buf, uint16_t profile, uint16_t *version)
Get profile version.
ssize_t bt_sdp_attr_addl_proto_count(const struct bt_sdp_attribute *attr)
Get count of protocol descriptors in Additional Protocol Descriptor List.
int bt_sdp_attr_value_parse(const struct bt_sdp_attribute *attr, bool(*func)(const struct bt_sdp_attr_value_pair *value, void *user_data), void *user_data)
Parse SDP attribute values.
int bt_sdp_get_addl_proto_param(const struct net_buf *buf, uint16_t proto, uint8_t index, uint16_t *param)
Get additional parameter value related to given stacked protocol UUID.
int bt_sdp_attr_addl_proto_parse(const struct bt_sdp_attribute *attr, bool(*func)(const struct bt_sdp_attribute *attr, void *user_data), void *user_data)
Parse Additional Protocol Descriptor List attribute.
int bt_sdp_attr_addl_proto_read(const struct bt_sdp_attribute *attr, uint16_t index, const struct bt_uuid *uuid, struct bt_sdp_attr_value *value)
Read value from Additional Protocol Descriptor List for specific index and UUID.
uint8_t(* bt_sdp_discover_func_t)(struct bt_conn *conn, struct bt_sdp_client_result *result, const struct bt_sdp_discover_params *params)
Callback type reporting to user that there is a resolved result on remote for given UUID and the resu...
Definition sdp.h:626
int bt_sdp_get_features(const struct net_buf *buf, uint16_t *features)
Get SupportedFeatures attribute value.
int bt_sdp_get_vendor_id(const struct net_buf *buf, uint16_t *vendor_id)
Get Vendor ID.
int bt_sdp_get_proto_param(const struct net_buf *buf, uint16_t proto, uint16_t *param)
Give to user parameter value related to given stacked protocol UUID.
#define BT_SDP_INT128
Signed 128-bit integer.
Definition sdp.h:307
@ BT_SDP_DISCOVER_UUID_CONTINUE
Definition sdp.h:593
@ BT_SDP_DISCOVER_UUID_STOP
Definition sdp.h:592
@ BT_SDP_DISCOVER_SERVICE_ATTR
Discover Service Attribute.
Definition sdp.h:634
@ BT_SDP_DISCOVER_SERVICE_SEARCH_ATTR
Discover Service Search Attribute.
Definition sdp.h:636
@ BT_SDP_DISCOVER_SERVICE_SEARCH
Discover Service Search.
Definition sdp.h:632
@ BT_SDP_ATTR_VALUE_TYPE_BOOL
Boolean.
Definition sdp.h:941
@ BT_SDP_ATTR_VALUE_TYPE_URL
URL string.
Definition sdp.h:943
@ BT_SDP_ATTR_VALUE_TYPE_SINT
Signed integer.
Definition sdp.h:940
@ BT_SDP_ATTR_VALUE_TYPE_UINT
Unsigned integer.
Definition sdp.h:939
@ BT_SDP_ATTR_VALUE_TYPE_TEXT
Text string.
Definition sdp.h:942
@ BT_SDP_ATTR_VALUE_TYPE_NONE
No value.
Definition sdp.h:938
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:44
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
__SIZE_TYPE__ ssize_t
Definition types.h:28
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__INT32_TYPE__ int32_t
Definition stdint.h:74
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
__INT64_TYPE__ int64_t
Definition stdint.h:75
__INT8_TYPE__ int8_t
Definition stdint.h:72
__INT16_TYPE__ int16_t
Definition stdint.h:73
Opaque type representing a connection to a remote device.
SDP attribute value for signed integer types.
Definition sdp.h:896
int64_t s64
64-bit signed integer value
Definition sdp.h:904
int8_t s8
8-bit signed integer value
Definition sdp.h:901
uint8_t size
Size of the signed integer value in bytes.
Definition sdp.h:898
int32_t s32
32-bit signed integer value
Definition sdp.h:903
int16_t s16
16-bit signed integer value
Definition sdp.h:902
uint8_t s128[BIT(0x14 &0x07)]
128-bit signed integer value as byte array
Definition sdp.h:906
SDP attribute value pair structure.
Definition sdp.h:982
struct bt_sdp_attr_value * value
Pointer to the parsed attribute value.
Definition sdp.h:986
struct bt_uuid * uuid
UUID identifier for the attribute.
Definition sdp.h:984
SDP attribute value for text string types.
Definition sdp.h:914
uint8_t * text
Pointer to the text string data.
Definition sdp.h:918
uint32_t len
Length of the text string in bytes.
Definition sdp.h:916
SDP attribute value for unsigned integer types.
Definition sdp.h:877
uint64_t u64
64-bit unsigned integer value
Definition sdp.h:885
uint8_t size
Size of the unsigned integer value in bytes.
Definition sdp.h:879
uint8_t u128[BIT(0x0c &0x07)]
128-bit unsigned integer value as byte array
Definition sdp.h:887
uint8_t u8
8-bit unsigned integer value
Definition sdp.h:882
uint32_t u32
32-bit unsigned integer value
Definition sdp.h:884
uint16_t u16
16-bit unsigned integer value
Definition sdp.h:883
SDP attribute value for URL string types.
Definition sdp.h:925
uint32_t len
Length of the URL string in bytes.
Definition sdp.h:927
uint8_t * url
Pointer to the URL string data.
Definition sdp.h:929
SDP attribute value container structure.
Definition sdp.h:953
struct bt_sdp_attr_value_text text
URL string value (when type is BT_SDP_ATTR_VALUE_TYPE_URL).
Definition sdp.h:965
enum bt_sdp_attr_value_type type
Type of the attribute value.
Definition sdp.h:955
struct bt_sdp_attr_value_uint uint
Signed integer value (when type is BT_SDP_ATTR_VALUE_TYPE_SINT).
Definition sdp.h:961
struct bt_sdp_attr_value_int sint
Text string value (when type is BT_SDP_ATTR_VALUE_TYPE_TEXT).
Definition sdp.h:963
bool value
< Boolean value (when type is BT_SDP_ATTR_VALUE_TYPE_BOOL)
Definition sdp.h:959
struct bt_sdp_attr_value_url url
Definition sdp.h:967
SDP attribute ID list for Service Attribute and Service Search Attribute transactions.
Definition sdp.h:656
size_t count
Count of the SDP attribute ID range.
Definition sdp.h:658
struct bt_sdp_attribute_id_range * ranges
Attribute ID range array list.
Definition sdp.h:660
SDP attribute ID range.
Definition sdp.h:648
uint16_t ending
Ending attribute ID of the range.
Definition sdp.h:652
uint16_t beginning
Beginning attribute ID of the range.
Definition sdp.h:650
SDP Attribute Value.
Definition sdp.h:346
uint16_t id
Attribute ID.
Definition sdp.h:347
struct bt_sdp_data_elem val
Attribute data.
Definition sdp.h:348
Generic SDP Client Query Result data holder.
Definition sdp.h:581
bool next_record_hint
flag pointing that there are more result chunks for given UUID
Definition sdp.h:585
struct net_buf * resp_buf
buffer containing unparsed SDP record result for given UUID
Definition sdp.h:583
SDP Generic Data Element Value.
Definition sdp.h:338
const void * data
Definition sdp.h:342
uint32_t data_size
Size of the data element.
Definition sdp.h:340
uint32_t total_size
Total size of the data element.
Definition sdp.h:341
uint8_t type
Type of the data element.
Definition sdp.h:339
Main user structure used in SDP discovery of remote.
Definition sdp.h:664
uint32_t handle
Service record handle.
Definition sdp.h:670
const struct bt_uuid * uuid
UUID (service) to be discovered on remote SDP entity.
Definition sdp.h:668
bt_sdp_discover_func_t func
Discover callback to be called on resolved SDP record.
Definition sdp.h:673
struct net_buf_pool * pool
Memory buffer enabled by user for SDP query results.
Definition sdp.h:675
struct bt_sdp_attribute_id_list * ids
Attribute ID list for Service Attribute and Service Search Attribute transactions.
Definition sdp.h:684
uint8_t type
Discover type.
Definition sdp.h:677
SDP Service Record Value.
Definition sdp.h:352
sys_snode_t node
Definition sdp.h:357
size_t attr_count
Number of attributes.
Definition sdp.h:355
uint8_t index
Index of the record in LL.
Definition sdp.h:356
struct bt_sdp_attribute * attrs
Base addr of attr array.
Definition sdp.h:354
uint32_t handle
Redundant, for quick ref.
Definition sdp.h:353
This is a 'tentative' type and should be used as a pointer only.
Definition uuid.h:52
Network buffer pool representation.
Definition net_buf.h:1184
Network buffer representation.
Definition net_buf.h:1048
Binary representation of a UUID.
Definition uuid.h:48