230 #define BT_SPP_INVALID_HANDLE 0x00000000 235 #define BT_SPP_SDP_ATTRIBUTE_UUID_LENGTH BT_SDP_ATTRIBUTE_HEADER_8BIT(17) 241 #define BT_SPP_SDP_ATTRIBUTE_UUID BT_SDP_UUID_128BIT 247 #define BT_SPP_SDP_ATTRIBUTE_PROTOCOL_DESCRIPTOR(server_id) \ 248 BT_SDP_ATTRIBUTE_HEADER_8BIT(12), \ 249 BT_SDP_ATTRIBUTE_HEADER_8BIT(3), \ 250 BT_SDP_UUID_16BIT(BT_SDP_PROTOCOL_L2CAP), \ 251 BT_SDP_ATTRIBUTE_HEADER_8BIT(5), \ 252 BT_SDP_UUID_16BIT(BT_SDP_PROTOCOL_RFCOMM), \ 253 BT_SDP_UINT_8BIT(server_id) 259 #define BT_SPP_SDP_ATTRIBUTE_PUBLIC_BROWSE_GROUP \ 260 BT_SDP_ATTRIBUTE_HEADER_8BIT(3), \ 261 BT_SDP_UUID_16BIT(BT_SDP_SERVICE_CLASS_PUBLIC_BROWSE_GROUP) 266 #define BT_SPP_SDP_ATTRIBUTE_LANGUAGE \ 267 BT_SDP_ATTRIBUTE_HEADER_8BIT(9), \ 268 BT_SDP_UINT_16BIT(0x656E), \ 269 BT_SDP_UINT_16BIT(0x006A), \ 270 BT_SDP_UINT_16BIT(0x0100) 275 #define BT_SPP_SDP_ATTRIBUTE_SIZE_OF_SERVICE_NAME(size) \ 276 BT_SDP_TEXT_8BIT(size) 282 #define BT_SPP_SDP_ATTRIBUTE_SERVICE_CLASS_ID_LIST(uuid_array) \ 283 BT_SDP_ATTRIBUTE(BT_SDP_ATTRIBUTE_ID_SERVICE_CLASS_ID_LIST, uuid_array) 289 #define BT_SPP_SDP_ATTRIBUTE_PROTOCOL_DESC_LIST(protocol_descriptor_array) \ 290 BT_SDP_ATTRIBUTE(BT_SDP_ATTRIBUTE_ID_PROTOCOL_DESC_LIST, protocol_descriptor_array) 296 #define BT_SPP_SDP_ATTRIBUTE_BROWSE_GROUP_LIST(browse_group_array) \ 297 BT_SDP_ATTRIBUTE(BT_SDP_ATTRIBUTE_ID_BROWSE_GROUP_LIST, browse_group_array) 303 #define BT_SPP_SDP_ATTRIBUTE_LANGUAGE_BASE_LIST(language_array) \ 304 BT_SDP_ATTRIBUTE(BT_SDP_ATTRIBUTE_ID_LANG_BASE_ID_LIST, language_array) 311 #define BT_SPP_SDP_ATTRIBUTE_SERVICE_NAME(name_array) \ 312 BT_SDP_ATTRIBUTE(BT_SDP_ATTRIBUTE_ID_SERVICE_NAME + 0x0100, name_array) 317 #define BT_SPP_CONNECT_IND (BT_MODULE_SPP | 0x0000) 319 #define BT_SPP_CONNECT_CNF (BT_MODULE_SPP | 0x0001) 321 #define BT_SPP_DISCONNECT_IND (BT_MODULE_SPP | 0x0002) 323 #define BT_SPP_DATA_RECEIVED_IND (BT_MODULE_SPP | 0x0003) 325 #define BT_SPP_READY_TO_SEND_IND (BT_MODULE_SPP | 0x0004) 331 #define BT_STATUS_SPP_TX_NOT_AVAILABLE (BT_MODULE_SPP |0xE0) 337 #define BT_SPP_SERVER_ID_START 0x06 338 #define BT_SPP_SERVER_ID_END 0x1E 354 uint16_t max_packet_length;
360 uint8_t local_server_id;
378 uint16_t packet_length;
398 const uint8_t *uuid128);
424 uint16_t packet_length);
void bt_spp_hold_data(uint8_t *data)
This function holds the SPP packet until it is fully consumed.
uint32_t handle
The SPP handle of the current connection.
Definition: bt_spp.h:371
bt_status_t bt_spp_connect_response(uint32_t handle, bool accept)
This function is for the SPP server to accept or reject connection from a remote client, the BT_SPP_CONNECT_CNF event is reported to indicate the result of the response.
This structure defines BT_SPP_DATA_RECEIVED_IND.
Definition: bt_spp.h:380
void bt_spp_release_data(uint8_t *data)
This function releases the SPP packet after it is consumed.
This structure defines BT_SPP_DISCONNECT_IND.
Definition: bt_spp.h:370
uint32_t handle
The SPP handle of the current connection.
Definition: bt_spp.h:376
bt_status_t bt_spp_send(uint32_t handle, uint8_t *packet, uint16_t packet_length)
This function sends data to a remote device.
This structure defines BT_SPP_CONNECT_IND.
Definition: bt_spp.h:363
uint8_t bt_bd_addr_t[6]
Address type, defined in Bluetooth core specification version 4.2.
Definition: bt_type.h:180
int32_t bt_status_t
Define the status type, returned from the APIs, and defined as BT_STATUS_XXX.
Definition: bt_type.h:173
This structure defines BT_SPP_CONNECT_CNF.
Definition: bt_spp.h:357
bt_status_t bt_spp_disconnect(uint32_t handle)
This function disconnects an existing connection, the BT_SPP_DISCONNECT_IND event is reported to indi...
bt_status_t bt_spp_connect(uint32_t *handle, const bt_bd_addr_t *address, const uint8_t *uuid128)
This function is for the SPP client to connect to a remote server, the BT_SPP_CONNECT_CNF event is re...
This structure defines BT_SPP_READY_TO_SEND_IND.
Definition: bt_spp.h:375