MT2523 API Reference  LinkIt SDK v4
Define

This section defines the macros for the SPP. More...

Overview

This section defines the macros for the SPP.

Macros

#define BT_SPP_INVALID_HANDLE   0x00000000
 An invalid value for the SPP handle.
 
#define BT_SPP_SDP_ATTRIBUTE_UUID_LENGTH   BT_SDP_ATTRIBUTE_HEADER_8BIT(17)
 Attribute value length of the SPP service class ID list.
 
#define BT_SPP_SDP_ATTRIBUTE_UUID   BT_SDP_UUID_128BIT
 Attribute value of the SPP service class ID list. More...
 
#define BT_SPP_SDP_ATTRIBUTE_PROTOCOL_DESCRIPTOR(server_id)
 Attribute value of the SPP protocol descriptor list. More...
 
#define BT_SPP_SDP_ATTRIBUTE_PUBLIC_BROWSE_GROUP
 Attribute value of the SPP Public Browse Group. More...
 
#define BT_SPP_SDP_ATTRIBUTE_LANGUAGE
 Attribute value of the SPP language base. More...
 
#define BT_SPP_SDP_ATTRIBUTE_SIZE_OF_SERVICE_NAME(size)    BT_SDP_TEXT_8BIT(size)
 The SPP service name's size.
 
#define BT_SPP_SDP_ATTRIBUTE_SERVICE_CLASS_ID_LIST(uuid_array)   BT_SDP_ATTRIBUTE(BT_SDP_ATTRIBUTE_ID_SERVICE_CLASS_ID_LIST, uuid_array)
 The SPP service class ID list attribute. More...
 
#define BT_SPP_SDP_ATTRIBUTE_PROTOCOL_DESC_LIST(protocol_descriptor_array)   BT_SDP_ATTRIBUTE(BT_SDP_ATTRIBUTE_ID_PROTOCOL_DESC_LIST, protocol_descriptor_array)
 The SPP protocol descriptor list attribute. More...
 
#define BT_SPP_SDP_ATTRIBUTE_BROWSE_GROUP_LIST(browse_group_array)   BT_SDP_ATTRIBUTE(BT_SDP_ATTRIBUTE_ID_BROWSE_GROUP_LIST, browse_group_array)
 The SPP Public Browse Group attribute. More...
 
#define BT_SPP_SDP_ATTRIBUTE_LANGUAGE_BASE_LIST(language_array)   BT_SDP_ATTRIBUTE(BT_SDP_ATTRIBUTE_ID_LANG_BASE_ID_LIST, language_array)
 The SPP language base ID list attribute. More...
 
#define BT_SPP_SDP_ATTRIBUTE_SERVICE_NAME(name_array)   BT_SDP_ATTRIBUTE(BT_SDP_ATTRIBUTE_ID_SERVICE_NAME + 0x0100, name_array)
 The SPP service name attribute. More...
 
#define BT_SPP_CONNECT_IND   (BT_MODULE_SPP | 0x0000)
 The SPP event definitions. More...
 
#define BT_SPP_CONNECT_CNF   (BT_MODULE_SPP | 0x0001)
 The result of a connect attempt initiated by a local or remote device is available. More...
 
#define BT_SPP_DISCONNECT_IND   (BT_MODULE_SPP | 0x0002)
 A disconnect attempt is initiated by a local or remote device or a link loss occurred. More...
 
#define BT_SPP_DATA_RECEIVED_IND   (BT_MODULE_SPP | 0x0003)
 Data was received from the remote device. More...
 
#define BT_SPP_READY_TO_SEND_IND   (BT_MODULE_SPP | 0x0004)
 The Bluetooth TX buffer has free space for sending data. More...
 
#define BT_STATUS_SPP_TX_NOT_AVAILABLE   (BT_MODULE_SPP |0xE0)
 Define for SPP failed status. More...
 
#define BT_SPP_SERVER_ID_START   0x06
 This enumeration defines the SPP server ID as an input parameter assigned to BT_SPP_SDP_ATTRIBUTE_PROTOCOL_DESCRIPTOR. More...
 
#define BT_SPP_SERVER_ID_END   0x1E
 End of the SPP server ID. More...
 

Macro Definition Documentation

#define BT_SPP_CONNECT_CNF   (BT_MODULE_SPP | 0x0001)

The result of a connect attempt initiated by a local or remote device is available.

The structure for this event is defined as bt_spp_connect_cnf_t.

#define BT_SPP_CONNECT_IND   (BT_MODULE_SPP | 0x0000)

The SPP event definitions.

A connect attempt is initiated from a remote device. Call the function bt_spp_connect_response() to accept or reject the attempt. The structure for this event is defined as bt_spp_connect_ind_t.

#define BT_SPP_DATA_RECEIVED_IND   (BT_MODULE_SPP | 0x0003)

Data was received from the remote device.

The "packet" and "pakcet_length" fields describe the received data. The structure for this event is defined as bt_spp_data_received_ind_t.

#define BT_SPP_DISCONNECT_IND   (BT_MODULE_SPP | 0x0002)

A disconnect attempt is initiated by a local or remote device or a link loss occurred.

The structure for this event is defined as bt_spp_disconnect_ind_t.

#define BT_SPP_READY_TO_SEND_IND   (BT_MODULE_SPP | 0x0004)

The Bluetooth TX buffer has free space for sending data.

Call the function bt_spp_send() to send the application data. The structure for this event is defined as bt_spp_ready_to_send_ind_t.

#define BT_SPP_SDP_ATTRIBUTE_BROWSE_GROUP_LIST (   browse_group_array)    BT_SDP_ATTRIBUTE(BT_SDP_ATTRIBUTE_ID_BROWSE_GROUP_LIST, browse_group_array)

The SPP Public Browse Group attribute.

Parameters
[in]browse_group_arrayis an array to hold the BT_SPP_SDP_ATTRIBUTE_PUBLIC_BROWSE_GROUP.
#define BT_SPP_SDP_ATTRIBUTE_LANGUAGE
Value:
BT_SDP_UINT_16BIT(0x656E), \
BT_SDP_UINT_16BIT(0x006A), \
BT_SDP_UINT_16BIT(0x0100)
#define BT_SDP_ATTRIBUTE_HEADER_8BIT(size)
To form a data element sequence header using the supplied 8-bit size value.
Definition: bt_sdp.h:489

Attribute value of the SPP language base.

#define BT_SPP_SDP_ATTRIBUTE_LANGUAGE_BASE_LIST (   language_array)    BT_SDP_ATTRIBUTE(BT_SDP_ATTRIBUTE_ID_LANG_BASE_ID_LIST, language_array)

The SPP language base ID list attribute.

Parameters
[in]language_arrayis an array to hold the BT_SPP_SDP_ATTRIBUTE_LANGUAGE.
#define BT_SPP_SDP_ATTRIBUTE_PROTOCOL_DESC_LIST (   protocol_descriptor_array)    BT_SDP_ATTRIBUTE(BT_SDP_ATTRIBUTE_ID_PROTOCOL_DESC_LIST, protocol_descriptor_array)

The SPP protocol descriptor list attribute.

Parameters
[in]protocol_descriptor_arrayis an array to hold the BT_SPP_SDP_ATTRIBUTE_PROTOCOL_DESCRIPTOR.
#define BT_SPP_SDP_ATTRIBUTE_PROTOCOL_DESCRIPTOR (   server_id)
Value:
BT_SDP_ATTRIBUTE_HEADER_8BIT(3), \
BT_SDP_UUID_16BIT(BT_SDP_PROTOCOL_L2CAP), \
BT_SDP_ATTRIBUTE_HEADER_8BIT(5), \
BT_SDP_UUID_16BIT(BT_SDP_PROTOCOL_RFCOMM), \
BT_SDP_UINT_8BIT(server_id)
#define BT_SDP_ATTRIBUTE_HEADER_8BIT(size)
To form a data element sequence header using the supplied 8-bit size value.
Definition: bt_sdp.h:489
#define BT_SDP_PROTOCOL_RFCOMM
RFCOMM protocol.
Definition: bt_sdp.h:449
#define BT_SDP_PROTOCOL_L2CAP
L2CAP protocol.
Definition: bt_sdp.h:459

Attribute value of the SPP protocol descriptor list.

Parameters
[in]server_idis a uint8 RFCOMM channel number between 0x06 and 0x1E.
#define BT_SPP_SDP_ATTRIBUTE_PUBLIC_BROWSE_GROUP
Value:
#define BT_SDP_SERVICE_CLASS_PUBLIC_BROWSE_GROUP
For public browse group service.
Definition: bt_sdp.h:332
#define BT_SDP_ATTRIBUTE_HEADER_8BIT(size)
To form a data element sequence header using the supplied 8-bit size value.
Definition: bt_sdp.h:489

Attribute value of the SPP Public Browse Group.

Any SDP attribute structure can include this attribute to add itself to the root level of the Public Browse Group.

#define BT_SPP_SDP_ATTRIBUTE_SERVICE_CLASS_ID_LIST (   uuid_array)    BT_SDP_ATTRIBUTE(BT_SDP_ATTRIBUTE_ID_SERVICE_CLASS_ID_LIST, uuid_array)

The SPP service class ID list attribute.

Parameters
[in]uuid_arrayis an array to hold the BT_SPP_SDP_ATTRIBUTE_UUID.
#define BT_SPP_SDP_ATTRIBUTE_SERVICE_NAME (   name_array)    BT_SDP_ATTRIBUTE(BT_SDP_ATTRIBUTE_ID_SERVICE_NAME + 0x0100, name_array)

The SPP service name attribute.

Parameters
[in]name_arrayis an array including the size of name(BT_SPP_SDP_ATTRIBUTE_SIZE_OF_SERVICE_NAME) and its text or string name.
#define BT_SPP_SDP_ATTRIBUTE_UUID   BT_SDP_UUID_128BIT

Attribute value of the SPP service class ID list.

Parameters
[in]uuid128is a 128-bit UUID of the SPP server.
#define BT_SPP_SERVER_ID_END   0x1E

End of the SPP server ID.

#define BT_SPP_SERVER_ID_START   0x06

This enumeration defines the SPP server ID as an input parameter assigned to BT_SPP_SDP_ATTRIBUTE_PROTOCOL_DESCRIPTOR.

If multiple SPP SDP records exist, there must be a different server ID in each record.Beginning of the SPP server ID.

#define BT_STATUS_SPP_TX_NOT_AVAILABLE   (BT_MODULE_SPP |0xE0)

Define for SPP failed status.

The error code after calling the function bt_spp_send() to send the application data.