MT2523 API Reference  LinkIt SDK v4
Define

This section defines the macros for the SDP server. More...

Overview

This section defines the macros for the SDP server.

Macros

#define BT_SDP_DATA_ELEMENT_TYPE_NIL   0x00
 The NULL type. More...
 
#define BT_SDP_DATA_ELEMENT_TYPE_UINT   0x08
 The element type for unsigned integer. More...
 
#define BT_SDP_DATA_ELEMENT_TYPE_SINT   0x10
 The element type for a signed integer. More...
 
#define BT_SDP_DATA_ELEMENT_TYPE_UUID   0x18
 The element type for the UUID. More...
 
#define BT_SDP_DATA_ELEMENT_TYPE_TEXT   0x20
 The element type for text string. More...
 
#define BT_SDP_DATA_ELEMENT_TYPE_BOOL   0x28
 The element type for Boolean value. More...
 
#define BT_SDP_DATA_ELEMENT_TYPE_SEQ   0x30
 The element type for data element sequence. More...
 
#define BT_SDP_DATA_ELEMENT_TYPE_ALT   0x38
 The element type for data element alternative. More...
 
#define BT_SDP_DATA_ELEMENT_TYPE_URL   0x40
 The element type for the URL. More...
 
#define BT_SDP_DATA_ELEMENT_TYPE_MASK   0xf8
 To get the element type, bitwise "and" this element type mask with the first byte of the data element. More...
 
#define BT_SDP_DATA_ELEMENT_SIZE_1BYTE   0x00
 A 1-byte element. More...
 
#define BT_SDP_DATA_ELEMENT_SIZE_2BYTE   0x01
 A 2-byte element. More...
 
#define BT_SDP_DATA_ELEMENT_SIZE_4BYTE   0x02
 A 4-byte element. More...
 
#define BT_SDP_DATA_ELEMENT_SIZE_8BYTE   0x03
 An 8-byte element. More...
 
#define BT_SDP_DATA_ELEMENT_SIZE_16BYTE   0x04
 A 16-byte element. More...
 
#define BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_8BIT   0x05
 The actual size of the data element, in bytes, is in the next 8 bits. More...
 
#define BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_16BIT   0x06
 The actual size of the data element, in bytes, is in the next 16 bits. More...
 
#define BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_32BIT   0x07
 The actual size of the data element, in bytes, is in the next 32 bits. More...
 
#define BT_SDP_DATA_ELEMENT_SIZE_MASK   0x07
 To get the data size, bitwise "and" this element size mask with the first byte of the data element. More...
 
#define BT_SDP_ATTRIBUTE_ID_INVALID   0xFFFF
 Invalid attribute ID. More...
 
#define BT_SDP_ATTRIBUTE_ID_SERVICE_CLASS_ID_LIST   0x0001
 The following attributes are required to be present in all service records. More...
 
#define BT_SDP_ATTRIBUTE_ID_SERVICE_RECORD_STATE   0x0002
 The following attributes are universal to all service records, meaning that the same attribute IDs are always used. More...
 
#define BT_SDP_ATTRIBUTE_ID_SERVICE_ID   0x0003
 Identifies the service instance by the service record. More...
 
#define BT_SDP_ATTRIBUTE_ID_PROTOCOL_DESC_LIST   0x0004
 Describes one or more protocol stacks. More...
 
#define BT_SDP_ATTRIBUTE_ID_BROWSE_GROUP_LIST   0x0005
 Represents a browse group to which the service record belongs to. More...
 
#define BT_SDP_ATTRIBUTE_ID_LANG_BASE_ID_LIST   0x0006
 Supports human-readable attributes for multiple natural languages in a single service record. More...
 
#define BT_SDP_ATTRIBUTE_ID_SERVICE_INFO_TIME_TO_LIVE   0x0007
 The information in a service record, expected to remain valid and unchanged. More...
 
#define BT_SDP_ATTRIBUTE_ID_SERVICE_AVAILABILITY   0x0008
 Represents if the service is available to accept additional clients. More...
 
#define BT_SDP_ATTRIBUTE_ID_BT_PROFILE_DESC_LIST   0x0009
 The descriptions of the Bluetooth profiles. More...
 
#define BT_SDP_ATTRIBUTE_ID_DOC_URL   0x000a
 The documentation path of a service record. More...
 
#define BT_SDP_ATTRIBUTE_ID_CLIENT_EXEC_URL   0x000b
 The execution location of the client. More...
 
#define BT_SDP_ATTRIBUTE_ID_ICON_URL   0x000c
 The icon location of the service. More...
 
#define BT_SDP_ATTRIBUTE_ID_ADDITIONAL_PROT_DESC_LISTS   0x000d
 Same as BT_SDP_ATTRIBUTE_ID_PROTOCOL_DESC_LIST, but for those services that require more channels which can't be described in the BT_SDP_ATTRIBUTE_ID_PROTOCOL_DESC_LIST. More...
 
#define BT_SDP_ATTRIBUTE_ID_SERVICE_NAME   0x0000
 The following attribute IDs must be added with the attribute ID base included in the BT_SDP_ATTRIBUTE_ID_LANG_BASE_ID_LIST attribute, usually it is 0x0100. More...
 
#define BT_SDP_ATTRIBUTE_ID_SERVICE_DESCRIPTION   0x0001
 The brief description of the service. More...
 
#define BT_SDP_ATTRIBUTE_ID_PROVIDER_NAME   0x0002
 The name of the service provider. More...
 
#define BT_SDP_ATTRIBUTE_ID_GROUP_ID   0x0200
 The following attribute applies only to a service record that corresponds to a browse group descriptor service. More...
 
#define BT_SDP_ATTRIBUTE_ID_VERSION_NUMBER_LIST   0x0200
 The following attributes apply only to the service record that corresponds to the service discovery server itself. More...
 
#define BT_SDP_ATTRIBUTE_ID_SERVICE_DATABASE_STATE   0x0201
 An Integer that facilitates caching of the service records. More...
 
#define BT_SDP_ATTRIBUTE_ID_SUPPORTED_FEATURES   0x0311
 The following attributes are used by the specific profiles as defined in the profile specifications. More...
 
#define BT_SDP_ATTRIBUTE_ID_SUPPORTED_REPOSITORIES   0x0314
 For phonebook access profile.
 
#define BT_SDP_SERVICE_CLASS_SERVICE_DISCOVERY_SERVER   0x1000
 For SDP service class.
 
#define BT_SDP_SERVICE_CLASS_BROWSE_GROUP_DESC   0x1001
 For browse group descriptor service.
 
#define BT_SDP_SERVICE_CLASS_PUBLIC_BROWSE_GROUP   0x1002
 For public browse group service.
 
#define BT_SDP_SERVICE_CLASS_SERIAL_PORT   0x1101
 For serial port service and profile.
 
#define BT_SDP_SERVICE_CLASS_OBEX_OBJECT_PUSH   0x1105
 For OBEX object push service and object push profile.
 
#define BT_SDP_SERVICE_CLASS_OBEX_FILE_TRANSFER   0x1106
 For OBEX file transfer service and file transfer profile.
 
#define BT_SDP_SERVICE_CLASS_HEADSET   0x1108
 For headset service and profile.
 
#define BT_SDP_SERVICE_CLASS_AUDIO_SOURCE   0x110A
 For audio source.
 
#define BT_SDP_SERVICE_CLASS_AUDIO_SINK   0x110B
 For audio sink.
 
#define BT_SDP_SERVICE_CLASS_AV_REMOTE_CONTROL_TARGET   0x110C
 For audio/video remote control target.
 
#define BT_SDP_SERVICE_CLASS_AUDIO_DISTRIBUTION   0x110D
 For advanced audio distribution profile.
 
#define BT_SDP_SERVICE_CLASS_AV_REMOTE_CONTROL   0x110E
 For audio/video remote control.
 
#define BT_SDP_SERVICE_CLASS_AV_REMOTE_CONTROL_CONTROL   0x110F
 For audio/video remote control.
 
#define BT_SDP_SERVICE_CLASS_HEADSET_AUDIO_GATEWAY   0x1112
 For headset audio gateway.
 
#define BT_SDP_SERVICE_CLASS_HANDSFREE   0x111E
 For handsfree profile.
 
#define BT_SDP_SERVICE_CLASS_HANDSFREE_AUDIO_GATEWAY   0x111F
 For handsfree audio gateway.
 
#define BT_SDP_SERVICE_CLASS_HUMAN_INTERFACE_DEVICE   0x1124
 For human interface device profile.
 
#define BT_SDP_SERVICE_CLASS_SIM_ACCESS   0x112D
 For SIM access profile.
 
#define BT_SDP_SERVICE_CLASS_PBAP_CLIENT   0x112E
 For phonebook access client.
 
#define BT_SDP_SERVICE_CLASS_PBAP_SERVER   0x112F
 For phonebook access server.
 
#define BT_SDP_SERVICE_CLASS_PBAP   0x1130
 For phonebook access.
 
#define BT_SDP_SERVICE_CLASS_HEADSET_HS   0x1131
 For headset access.
 
#define BT_SDP_SERVICE_CLASS_GENERIC_AUDIO   0x1203
 For generic audio service.
 
#define BT_SDP_INVALID_UUID   0xFFFF
 Invalid UUID. More...
 
#define BT_SDP_PROTOCOL_SDP   0x0001
 Service discovery protocol. More...
 
#define BT_SDP_PROTOCOL_RFCOMM   0x0003
 RFCOMM protocol. More...
 
#define BT_SDP_PROTOCOL_ATT   0x0007
 ATT protocol. More...
 
#define BT_SDP_PROTOCOL_OBEX   0x0008
 OBEX protocol. More...
 
#define BT_SDP_PROTOCOL_AVCTP   0x0017
 Audio/video control transport protocol. More...
 
#define BT_SDP_PROTOCOL_AVDTP   0x0019
 Audio/video distribution transport protocol. More...
 
#define BT_SDP_PROTOCOL_L2CAP   0x0100
 L2CAP protocol. More...
 
#define BT_SDP_ATTRIBUTE(attribute_id, attribute)
 To format a bt_sdps_attribute_t structure using the supplied attribute ID and attribute value. More...
 
#define BT_SDP_ATTRIBUTE_HEADER_8BIT(size)
 To form a data element sequence header using the supplied 8-bit size value. More...
 
#define BT_SDP_ATTRIBUTE_HEADER_16BIT(size)
 To form a data element sequence header using the supplied 16-bit size value. More...
 
#define BT_SDP_ATTRIBUTE_HEADER_32BIT(size)
 To form a data element sequence header using the supplied 32-bit size value. More...
 
#define BT_SDP_UUID_16BIT(uuid)
 To form a UUID data element from the supplied 16-bit UUID value. More...
 
#define BT_SDP_UUID_32BIT(uuid)
 To form a UUID data element from the supplied 32-bit UUID value. More...
 
#define BT_SDP_UUID_128BIT(uuid)
 To form a UUID data element from the supplied 128-bit UUID value. More...
 
#define BT_SDP_UINT_8BIT(uint)
 To form an unsigned integer data element from the supplied 8-bit unsigned integer value. More...
 
#define BT_SDP_UINT_16BIT(uint)
 To form an unsigned integer data element from the supplied 16-bit unsigned integer value. More...
 
#define BT_SDP_UINT_32BIT(uint)
 To form an unsigned integer data element from the supplied 32-bit unsigned integer value. More...
 
#define BT_SDP_UINT_64BIT(uint)
 To form an unsigned integer data element from the supplied 64-bit unsigned integer value. More...
 
#define BT_SDP_UINT_128BIT(uint)
 To form an unsigned integer data element from the supplied 128-bit unsigned integer value. More...
 
#define BT_SDP_TEXT_8BIT(size)
 To form a text data element header from the supplied 8-bit size value. More...
 
#define BT_SDP_TEXT_16BIT(size)
 To form a text data element header from the supplied 16-bit size value. More...
 
#define BT_SDP_TEXT_32BIT(size)
 To form a text data element header from the supplied 32-bit size value. More...
 
#define BT_SDP_URL_8BIT(size)
 To form a URL data element header from the supplied 8-bit size value. More...
 
#define BT_SDP_BOOL(value)
 To form a Boolean data element from the supplied 8-bit Boolean value. More...
 

Typedefs

typedef uint8_t bt_sdp_data_element_type_t
 Data elements begin with a single byte that contains both type and size information. More...
 
typedef uint8_t bt_sdp_data_element_size_t
 Define the type of data element size. More...
 
typedef uint16_t bt_sdp_attribute_id_t
 Define the attribute ID. More...
 
typedef uint16_t bt_sdp_service_class_id_t
 The UUIDs associated with a specific service and profile. More...
 
typedef uint16_t bt_sdp_protocol_uuid_t
 The UUIDs associated with protocols. More...
 

Macro Definition Documentation

#define BT_SDP_ATTRIBUTE (   attribute_id,
  attribute 
)
Value:
{ attribute_id, /* Attribute ID. */ \
sizeof(attribute), /* Attribute size. */ \
attribute } /* Attribute value. */

To format a bt_sdps_attribute_t structure using the supplied attribute ID and attribute value.

This macro is used to format an attribute into bt_sdps_attribute_t structure for a SDP record.

Parameters: Attribute_id is the attribute ID, please refer to the bt_sdp_attribute_id_t. Attribute is an array with the attribute value.

#define BT_SDP_ATTRIBUTE_HEADER_16BIT (   size)
Value:
(uint8_t)(((size) & 0xff00) >> 8), /* Bits[15:8] of size. */ \
(uint8_t)((size) & 0x00ff) /* Bits[7:0] of size. */
#define BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_16BIT
The actual size of the data element, in bytes, is in the next 16 bits.
Definition: bt_sdp.h:213
#define BT_SDP_DATA_ELEMENT_TYPE_SEQ
The element type for data element sequence.
Definition: bt_sdp.h:186

To form a data element sequence header using the supplied 16-bit size value.

The data element sequence header is used in the SDP record attributes and the SDP queries. Notice that this macro only forms the header portion of the data element sequence. The actual data elements within this sequence will need to be formed by using other SDP macros.

Parameters: size - 16-bit size of the data element sequence.

#define BT_SDP_ATTRIBUTE_HEADER_32BIT (   size)
Value:
(uint8_t)(((size) & 0xff000000) >> 24), /* Bits[32:24] of size. */ \
(uint8_t)(((size) & 0x00ff0000) >> 16), /* Bits[23:16] of size. */ \
(uint8_t)(((size) & 0x0000ff00) >> 8), /* Bits[15:8] of size. */ \
(uint8_t)((size) & 0x000000ff) /* Bits[7:0] of size. */
#define BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_32BIT
The actual size of the data element, in bytes, is in the next 32 bits.
Definition: bt_sdp.h:215
#define BT_SDP_DATA_ELEMENT_TYPE_SEQ
The element type for data element sequence.
Definition: bt_sdp.h:186

To form a data element sequence header using the supplied 32-bit size value.

The data element sequence header is used in the SDP record attributes and the SDP queries. Notice that this macro only forms the header portion of the data element sequence. The actual data elements within this sequence will need to be formed by using other SDP macros.

Parameters: size - 32-bit size of the data element sequence.

#define BT_SDP_ATTRIBUTE_HEADER_8BIT (   size)
Value:
size /* 8-bit size. */
#define BT_SDP_DATA_ELEMENT_TYPE_SEQ
The element type for data element sequence.
Definition: bt_sdp.h:186
#define BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_8BIT
The actual size of the data element, in bytes, is in the next 8 bits.
Definition: bt_sdp.h:211

To form a data element sequence header using the supplied 8-bit size value.

The data element sequence header is used in the SDP record attributes and the SDP queries. Notice that this macro only forms the header portion of the data element sequence. The actual data elements within this sequence will need to be formed by using other SDP macros.

Parameters: size - 8-bit size of the data element sequence.

#define BT_SDP_ATTRIBUTE_ID_ADDITIONAL_PROT_DESC_LISTS   0x000d

Same as BT_SDP_ATTRIBUTE_ID_PROTOCOL_DESC_LIST, but for those services that require more channels which can't be described in the BT_SDP_ATTRIBUTE_ID_PROTOCOL_DESC_LIST.

#define BT_SDP_ATTRIBUTE_ID_BROWSE_GROUP_LIST   0x0005

Represents a browse group to which the service record belongs to.

#define BT_SDP_ATTRIBUTE_ID_BT_PROFILE_DESC_LIST   0x0009

The descriptions of the Bluetooth profiles.

#define BT_SDP_ATTRIBUTE_ID_CLIENT_EXEC_URL   0x000b

The execution location of the client.

#define BT_SDP_ATTRIBUTE_ID_DOC_URL   0x000a

The documentation path of a service record.

#define BT_SDP_ATTRIBUTE_ID_GROUP_ID   0x0200

The following attribute applies only to a service record that corresponds to a browse group descriptor service.

A UUID to locate services that are part of the browse group.

#define BT_SDP_ATTRIBUTE_ID_ICON_URL   0x000c

The icon location of the service.

#define BT_SDP_ATTRIBUTE_ID_INVALID   0xFFFF

Invalid attribute ID.

#define BT_SDP_ATTRIBUTE_ID_LANG_BASE_ID_LIST   0x0006

Supports human-readable attributes for multiple natural languages in a single service record.

It's a list in which each member contains a language identifier, a character encoding identifier and a base attribute ID.

#define BT_SDP_ATTRIBUTE_ID_PROTOCOL_DESC_LIST   0x0004

Describes one or more protocol stacks.

#define BT_SDP_ATTRIBUTE_ID_PROVIDER_NAME   0x0002

The name of the service provider.

#define BT_SDP_ATTRIBUTE_ID_SERVICE_AVAILABILITY   0x0008

Represents if the service is available to accept additional clients.

#define BT_SDP_ATTRIBUTE_ID_SERVICE_CLASS_ID_LIST   0x0001

The following attributes are required to be present in all service records.

A data element sequence of UUIDs. Each UUID represents a service class supported by the service record. At least one UUID must be present. The UUIDs should be listed in order from the most specific class to the most general class unless specified by the profile specifications defining the service classes.

The bt_sdp_service_class_id_t type represents these UUIDs.

#define BT_SDP_ATTRIBUTE_ID_SERVICE_DATABASE_STATE   0x0201

An Integer that facilitates caching of the service records.

#define BT_SDP_ATTRIBUTE_ID_SERVICE_DESCRIPTION   0x0001

The brief description of the service.

#define BT_SDP_ATTRIBUTE_ID_SERVICE_ID   0x0003

Identifies the service instance by the service record.

#define BT_SDP_ATTRIBUTE_ID_SERVICE_INFO_TIME_TO_LIVE   0x0007

The information in a service record, expected to remain valid and unchanged.

#define BT_SDP_ATTRIBUTE_ID_SERVICE_NAME   0x0000

The following attribute IDs must be added with the attribute ID base included in the BT_SDP_ATTRIBUTE_ID_LANG_BASE_ID_LIST attribute, usually it is 0x0100.

Please refer to the example code.The service name.

#define BT_SDP_ATTRIBUTE_ID_SERVICE_RECORD_STATE   0x0002

The following attributes are universal to all service records, meaning that the same attribute IDs are always used.

However, attributes may or may not be present within a service record.

For more details about these attributes, please refer to the Bluetooth core specification version 4.2 [VOL 3, part B].Facilitates caching of the service attributes.

#define BT_SDP_ATTRIBUTE_ID_SUPPORTED_FEATURES   0x0311

The following attributes are used by the specific profiles as defined in the profile specifications.

Describes the supported features.

#define BT_SDP_ATTRIBUTE_ID_VERSION_NUMBER_LIST   0x0200

The following attributes apply only to the service record that corresponds to the service discovery server itself.

Therefore, they are valid only when the BT_SDP_ATTRIBUTE_ID_SERVICE_CLASS_ID_LIST contains the BT_SDP_SERVICE_CLASS_SERVICE_DISCOVERY_SERVER UUID.A list of the version numbers supported by the SDP server.

#define BT_SDP_BOOL (   value)
Value:
BT_SDP_DATA_ELEMENT_TYPE_BOOL + BT_SDP_DATA_ELEMENT_SIZE_1BYTE, /* Type and size index is 0x28. */ \
(uint8_t)(value) /* Boolean value */
#define BT_SDP_DATA_ELEMENT_SIZE_1BYTE
A 1-byte element.
Definition: bt_sdp.h:205
#define BT_SDP_DATA_ELEMENT_TYPE_BOOL
The element type for Boolean value.
Definition: bt_sdp.h:184

To form a Boolean data element from the supplied 8-bit Boolean value.

The Boolean data element is used in the SDP record attributes and the SDP queries.

Parameters: The value is 8-bit Boolean value.

#define BT_SDP_DATA_ELEMENT_SIZE_16BYTE   0x04

A 16-byte element.

#define BT_SDP_DATA_ELEMENT_SIZE_1BYTE   0x00

A 1-byte element.

It actually means size 0, however, if the element type is BT_SDP_DATA_ELEMENT_TYPE_NIL.

#define BT_SDP_DATA_ELEMENT_SIZE_2BYTE   0x01

A 2-byte element.

#define BT_SDP_DATA_ELEMENT_SIZE_4BYTE   0x02

A 4-byte element.

#define BT_SDP_DATA_ELEMENT_SIZE_8BYTE   0x03

An 8-byte element.

#define BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_16BIT   0x06

The actual size of the data element, in bytes, is in the next 16 bits.

#define BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_32BIT   0x07

The actual size of the data element, in bytes, is in the next 32 bits.

#define BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_8BIT   0x05

The actual size of the data element, in bytes, is in the next 8 bits.

#define BT_SDP_DATA_ELEMENT_SIZE_MASK   0x07

To get the data size, bitwise "and" this element size mask with the first byte of the data element.

#define BT_SDP_DATA_ELEMENT_TYPE_ALT   0x38

The element type for data element alternative.

The data contains a sequence of data elements. This type is used when there is more than one sequence of BT_SDP_DATA_ELEMENT_TYPE_SEQ. The profile with this element type must use a size type of BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_8BIT, BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_16BIT or BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_32BIT.

#define BT_SDP_DATA_ELEMENT_TYPE_BOOL   0x28

The element type for Boolean value.

The profile with this element type must use a size type of BT_SDP_DATA_ELEMENT_SIZE_1BYTE.

#define BT_SDP_DATA_ELEMENT_TYPE_MASK   0xf8

To get the element type, bitwise "and" this element type mask with the first byte of the data element.

#define BT_SDP_DATA_ELEMENT_TYPE_NIL   0x00

The NULL type.

It requires a size of BT_SDP_DATA_ELEMENT_SIZE_1BYTE, which means an actual size of 0 for this type.

#define BT_SDP_DATA_ELEMENT_TYPE_SEQ   0x30

The element type for data element sequence.

The profile with this element type must use a size type of BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_8BIT, BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_16BIT or BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_32BIT.

#define BT_SDP_DATA_ELEMENT_TYPE_SINT   0x10

The element type for a signed integer.

The profile with this element type must use a size type of BT_SDP_DATA_ELEMENT_SIZE_1BYTE, BT_SDP_DATA_ELEMENT_SIZE_2BYTE, BT_SDP_DATA_ELEMENT_SIZE_4BYTE, BT_SDP_DATA_ELEMENT_SIZE_8BYTE or BT_SDP_DATA_ELEMENT_SIZE_16BYTE.

#define BT_SDP_DATA_ELEMENT_TYPE_TEXT   0x20

The element type for text string.

The profile with this element type must use a size type of BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_8BIT, BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_16BIT or BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_32BIT.

#define BT_SDP_DATA_ELEMENT_TYPE_UINT   0x08

The element type for unsigned integer.

The profile with this element type must use a size type of BT_SDP_DATA_ELEMENT_SIZE_1BYTE, BT_SDP_DATA_ELEMENT_SIZE_2BYTE, BT_SDP_DATA_ELEMENT_SIZE_4BYTE, BT_SDP_DATA_ELEMENT_SIZE_8BYTE or BT_SDP_DATA_ELEMENT_SIZE_16BYTE.

#define BT_SDP_DATA_ELEMENT_TYPE_URL   0x40

The element type for the URL.

The profile with this element type must use a size type of BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_8BIT, BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_16BIT or BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_32BIT.

#define BT_SDP_DATA_ELEMENT_TYPE_UUID   0x18

The element type for the UUID.

The profile with this element type must use the size type of BT_SDP_DATA_ELEMENT_SIZE_2BYTE, BT_SDP_DATA_ELEMENT_SIZE_4BYTE or BT_SDP_DATA_ELEMENT_SIZE_16BYTE.

#define BT_SDP_INVALID_UUID   0xFFFF

Invalid UUID.

#define BT_SDP_PROTOCOL_ATT   0x0007

ATT protocol.

#define BT_SDP_PROTOCOL_AVCTP   0x0017

Audio/video control transport protocol.

#define BT_SDP_PROTOCOL_AVDTP   0x0019

Audio/video distribution transport protocol.

#define BT_SDP_PROTOCOL_L2CAP   0x0100

L2CAP protocol.

#define BT_SDP_PROTOCOL_OBEX   0x0008

OBEX protocol.

#define BT_SDP_PROTOCOL_RFCOMM   0x0003

RFCOMM protocol.

#define BT_SDP_PROTOCOL_SDP   0x0001

Service discovery protocol.

#define BT_SDP_TEXT_16BIT (   size)
Value:
(uint8_t)(((size) & 0xff00) >> 8), /* Bits[15:8] of size */ \
(uint8_t)((size) & 0x00ff) /* Bits[7:0] of size */
#define BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_16BIT
The actual size of the data element, in bytes, is in the next 16 bits.
Definition: bt_sdp.h:213
#define BT_SDP_DATA_ELEMENT_TYPE_TEXT
The element type for text string.
Definition: bt_sdp.h:180

To form a text data element header from the supplied 16-bit size value.

The text data element is used in the SDP record attributes and the SDP queries. Notice that this macro only forms the header portion of the text data element. The actual text data within this data element will need to be provided separately.

Parameters: The size is 16-bit size value.

#define BT_SDP_TEXT_32BIT (   size)
Value:
(uint8_t)(((size) & 0xff000000) >> 24), /* Bits[32:24] of size */ \
(uint8_t)(((size) & 0x00ff0000) >> 16), /* Bits[23:16] of size */ \
(uint8_t)(((size) & 0x0000ff00) >> 8), /* Bits[15:8] of size */ \
(uint8_t)((size) & 0x000000ff) /* Bits[7:0] of size */
#define BT_SDP_DATA_ELEMENT_TYPE_TEXT
The element type for text string.
Definition: bt_sdp.h:180
#define BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_32BIT
The actual size of the data element, in bytes, is in the next 32 bits.
Definition: bt_sdp.h:215

To form a text data element header from the supplied 32-bit size value.

The text data element is used in the SDP record attributes and the SDP queries. Notice that this macro only forms the header portion of the text data element. The actual text data within this data element will need to be provided separately.

Parameters: The size is 32-bit size value.

#define BT_SDP_TEXT_8BIT (   size)
Value:
(uint8_t)(size) /* 8-bit size */
#define BT_SDP_DATA_ELEMENT_TYPE_TEXT
The element type for text string.
Definition: bt_sdp.h:180
#define BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_8BIT
The actual size of the data element, in bytes, is in the next 8 bits.
Definition: bt_sdp.h:211

To form a text data element header from the supplied 8-bit size value.

The text data element is used in the SDP record attributes and the SDP queries. Notice that this macro only forms the header portion of the text data element. The actual text data within this data element will need to be provided separately.

Parameters: The size is a 8-bit size value.

#define BT_SDP_UINT_128BIT (   uint)
Value:
/* unsigned integer must be a 16-byte array */ \
BT_SDP_DATA_ELEMENT_TYPE_UINT + BT_SDP_DATA_ELEMENT_SIZE_16BYTE, /* Type and size index is 0x0C. */ \
uint /* 128-bit unsigned integer */
#define BT_SDP_DATA_ELEMENT_SIZE_16BYTE
A 16-byte element.
Definition: bt_sdp.h:210

To form an unsigned integer data element from the supplied 128-bit unsigned integer value.

The unsigned integer data element is used in the SDP record attributes and the SDP queries.

Parameters: The uint is a 128-bit unsigned integer value.

#define BT_SDP_UINT_16BIT (   uint)
Value:
BT_SDP_DATA_ELEMENT_TYPE_UINT + BT_SDP_DATA_ELEMENT_SIZE_2BYTE, /* Type and size index is 0x09. */ \
(uint8_t)(((uint) & 0xff00) >> 8), /* Bits[15:8] of unsigned integer */ \
(uint8_t)((uint) & 0x00ff) /* Bits[7:0] of unsigned integer */
#define BT_SDP_DATA_ELEMENT_SIZE_2BYTE
A 2-byte element.
Definition: bt_sdp.h:207
#define BT_SDP_DATA_ELEMENT_TYPE_UINT
The element type for unsigned integer.
Definition: bt_sdp.h:168

To form an unsigned integer data element from the supplied 16-bit unsigned integer value.

The unsigned integer data element is used in SDP record attributes and the SDP queries.

Parameters: The uint is a 16-bit unsigned integer value.

#define BT_SDP_UINT_32BIT (   uint)
Value:
BT_SDP_DATA_ELEMENT_TYPE_UINT + BT_SDP_DATA_ELEMENT_SIZE_4BYTE, /* Type and size index is 0x0A. */ \
(uint8_t)(((uint) & 0xff000000) >> 24), /* Bits[31:24] of unsigned integer */ \
(uint8_t)(((uint) & 0x00ff0000) >> 16), /* Bits[23:16] of unsigned integer */ \
(uint8_t)(((uint) & 0x0000ff00) >> 8), /* Bits[15:8] of unsigned integer */ \
(uint8_t)((uint) & 0x000000ff) /* Bits[7:0] of unsigned integer */
#define BT_SDP_DATA_ELEMENT_SIZE_4BYTE
A 4-byte element.
Definition: bt_sdp.h:208
#define BT_SDP_DATA_ELEMENT_TYPE_UINT
The element type for unsigned integer.
Definition: bt_sdp.h:168

To form an unsigned integer data element from the supplied 32-bit unsigned integer value.

The unsigned integer data element is used in SDP record attributes and the SDP queries.

Parameters: The uint is a 32-bit unsigned integer value.

#define BT_SDP_UINT_64BIT (   uint)
Value:
/* unsigned integer must be an 8-byte array */ \
BT_SDP_DATA_ELEMENT_TYPE_UINT + BT_SDP_DATA_ELEMENT_SIZE_8BYTE, /* Type and size index is 0x0B. */ \
uint /* 64-bit unsigned integer */
#define BT_SDP_DATA_ELEMENT_SIZE_8BYTE
An 8-byte element.
Definition: bt_sdp.h:209

To form an unsigned integer data element from the supplied 64-bit unsigned integer value.

The unsigned integer data element is used in SDP record attributes and the SDP queries.

Parameters: The uint is a 64-bit unsigned integer value.

#define BT_SDP_UINT_8BIT (   uint)
Value:
BT_SDP_DATA_ELEMENT_TYPE_UINT + BT_SDP_DATA_ELEMENT_SIZE_1BYTE, /* Type and size index is 0x08. */ \
(uint8_t)(uint) /* 8-bit unsigned integer */
#define BT_SDP_DATA_ELEMENT_SIZE_1BYTE
A 1-byte element.
Definition: bt_sdp.h:205
#define BT_SDP_DATA_ELEMENT_TYPE_UINT
The element type for unsigned integer.
Definition: bt_sdp.h:168

To form an unsigned integer data element from the supplied 8-bit unsigned integer value.

The unsigned integer data element is used in SDP record attributes and the SDP queries.

Parameters: uint is an 8-bit unsigned integer value.

#define BT_SDP_URL_8BIT (   size)
Value:
(uint8_t)(size)
#define BT_SDP_DATA_ELEMENT_TYPE_URL
The element type for the URL.
Definition: bt_sdp.h:196
#define BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_8BIT
The actual size of the data element, in bytes, is in the next 8 bits.
Definition: bt_sdp.h:211

To form a URL data element header from the supplied 8-bit size value.

The URL data element is used in the SDP record attributes and the SDP queries. Notice that this macro only forms the header portion of the URL data element. The actual URL data within this data element will need to be provided separately.

Parameters: The size is 8-bit size value.

#define BT_SDP_UUID_128BIT (   uuid)
Value:
/* UUID must be a 16-byte array */ \
BT_SDP_DATA_ELEMENT_TYPE_UUID + BT_SDP_DATA_ELEMENT_SIZE_16BYTE, /* Type and size index is 0x1C. */ \
uuid /* 128-bit UUID */
#define BT_SDP_DATA_ELEMENT_SIZE_16BYTE
A 16-byte element.
Definition: bt_sdp.h:210

To form a UUID data element from the supplied 128-bit UUID value.

The UUID data element is used in the SDP record attributes and the SDP queries.

Parameters: uuid - 128-bit UUID value, please refer to the bt_sdp_service_class_id_t and bt_sdp_protocol_uuid_t. 16-bit UUID values can be converted to 128-bit using the following conversion: 128_bit_value = 16_bit_value * 2^96 + Bluetooth base UUID.

#define BT_SDP_UUID_16BIT (   uuid)
Value:
BT_SDP_DATA_ELEMENT_TYPE_UUID + BT_SDP_DATA_ELEMENT_SIZE_2BYTE, /* Type and size index is 0x19 */ \
(uint8_t)(((uuid) & 0xff00) >> 8), /* Bits[15:8] of UUID */ \
(uint8_t)((uuid) & 0x00ff) /* Bits[7:0] of UUID */
#define BT_SDP_DATA_ELEMENT_SIZE_2BYTE
A 2-byte element.
Definition: bt_sdp.h:207
#define BT_SDP_DATA_ELEMENT_TYPE_UUID
The element type for the UUID.
Definition: bt_sdp.h:176

To form a UUID data element from the supplied 16-bit UUID value.

The UUID data element is used in the SDP record attributes and the SDP queries.

Parameters: uuid - 16-bit UUID value, please refer to the bt_sdp_service_class_id_t and bt_sdp_protocol_uuid_t.

#define BT_SDP_UUID_32BIT (   uuid)
Value:
BT_SDP_DATA_ELEMENT_TYPE_UUID + BT_SDP_DATA_ELEMENT_SIZE_4BYTE, /* Type and size index is 0x1A */ \
(uint8_t)(((uuid) & 0xff000000) >> 24), /* Bits[32:24] of UUID */ \
(uint8_t)(((uuid) & 0x00ff0000) >> 16), /* Bits[23:16] of UUID */ \
(uint8_t)(((uuid) & 0x0000ff00) >> 8), /* Bits[15:8] of UUID */ \
(uint8_t)((uuid) & 0x000000ff) /* Bits[7:0] of UUID */
#define BT_SDP_DATA_ELEMENT_SIZE_4BYTE
A 4-byte element.
Definition: bt_sdp.h:208
#define BT_SDP_DATA_ELEMENT_TYPE_UUID
The element type for the UUID.
Definition: bt_sdp.h:176

To form a UUID data element from the supplied 32-bit UUID value.

The UUID data element is used in the SDP record attributes and the SDP queries.

Parameters: uuid - 32-bit UUID value, please refer to the bt_sdp_service_class_id_t and bt_sdp_protocol_uuid_t. 16-bit UUID values can be converted to 32-bit by zero extending the 16-bit value.

Typedef Documentation

typedef uint16_t bt_sdp_attribute_id_t

Define the attribute ID.

Attribute is identified by an attribute ID. This type includes most (but not all) of the possible attributes available on a Bluetooth device.

Upper layer services may use these attributes or define their own. In this case, the service must define attributes with IDs between 0x0200 and 0xFFFF.Define the type of attribute ID.

typedef uint8_t bt_sdp_data_element_size_t

Define the type of data element size.

typedef uint8_t bt_sdp_data_element_type_t

Data elements begin with a single byte that contains both type and size information.

To create the first byte of a data element, bitwise "or" the bt_sdp_data_element_type_t and bt_sdp_data_element_size_t values into a single byte.

For example, a standard 16 bits unsigned integer with a value of 0x57 could be encoded as follows:

uint8_t val[3] = { BT_SDP_DATA_ELEMENT_TYPE_UINT | BT_SDP_DATA_ELEMENT_SIZE_2BYTE, 0x00, 0x57};

The text string "hello" could be encoded as follows:

uint8_t str[7] = { BT_SDP_DATA_ELEMENT_TYPE_TEXT | BT_SDP_DATA_ELEMENT_SIZE_ADDITIONAL_8BIT, 0x05, 'h','e','l','l','o'};Define the type of data element.

typedef uint16_t bt_sdp_protocol_uuid_t

The UUIDs associated with protocols.

Any number of these UUIDs may be present in the BT_SDP_ATTRIBUTE_ID_SERVICE_CLASS_ID_LIST attribute of a service record and may appear in the BT_SDP_ATTRIBUTE_ID_BT_PROFILE_DESC_LIST ID.Defines the type of protocol ID.

typedef uint16_t bt_sdp_service_class_id_t

The UUIDs associated with a specific service and profile.

Any number of these UUIDs may be present in the BT_SDP_ATTRIBUTE_ID_SERVICE_CLASS_ID_LIST attribute of a service record and may appear in the BT_SDP_ATTRIBUTE_ID_BT_PROFILE_DESC_LIST ID. Defines the type of service class ID.