MT2523 API Reference  LinkIt SDK v4
BT Callback Manager

This section defines the Bluetooth callback manager API to manage all Bluetooth callback functions. More...

Overview

This section defines the Bluetooth callback manager API to manage all Bluetooth callback functions.

Terms and Acronyms

Terms Details
SDP Service Discovery Protocol. For more information, please refer to Wikipedia.
AVRCP Audio/Video Remote Control Profile. For more information, please refer to Wikipedia.
SPP Serial Port Profile. For more information, please refer to Wikipedia.
HFP Hands-Free Profile. For more information, please refer to Hands-free profile in Wikipedia.
GATT Generic Attribute Profile defines a service framework using the Attribute Protocol for discovering services, and for reading and writing characteristic value on a remote device.
GAP Generic Access Profile defines the generic procedures related to the discovery of Bluetooth devices and link management aspects of connecting to Bluetooth devices. It also defines procedures related to use of different security levels.
MM Memory Management. For more information, please refer to bt_system.h.
A2DP Advanced Audio Distribution Profile. For more information, please refer to Wikipedia.
PBAPC Phonebook Access Profile Client. For more information, please refer to Wikipedia.

How to use this module

Functions

bt_status_t bt_callback_manager_register_callback (bt_callback_type_t type, bt_callback_module_mask_t module_mask, void *callback)
 This function registers a callback to the Bluetooth callback manager. More...
 
bt_status_t bt_callback_manager_deregister_callback (bt_callback_type_t type, void *callback)
 This function unregister the callback from the Bluetooth callback manager. More...
 
bt_status_t bt_callback_manager_add_sdp_customized_record (const bt_sdps_record_t *record)
 This function adds a user record to the SDP. More...
 

Modules

 Define
 Define the callback manager structures.
 

Function Documentation

bt_status_t bt_callback_manager_add_sdp_customized_record ( const bt_sdps_record_t record)

This function adds a user record to the SDP.

For more information about how to add a record, please refer to the bt_sdp.h.

Parameters
[in]recordis the pointer to the record.
Returns
BT_STATUS_SUCCESS, if the record was added successfully. BT_STATUS_FAIL, if the maximum number of records, as defined by BT_CALLBACK_MANAGER_USER_RECORD_MAX in bt_callback_manager_config.h, has been reached.
bt_status_t bt_callback_manager_deregister_callback ( bt_callback_type_t  type,
void *  callback 
)

This function unregister the callback from the Bluetooth callback manager.

Parameters
[in]typeis the callback type to unregister.
[in]callbackis a pointer to the callback function to unregister.
Returns
BT_STATUS_SUCCESS, if the operation is successful. BT_STATUS_FAIL, if the callback type is incorrect or unregistered, or the callback function is unregistered.
bt_status_t bt_callback_manager_register_callback ( bt_callback_type_t  type,
bt_callback_module_mask_t  module_mask,
void *  callback 
)

This function registers a callback to the Bluetooth callback manager.

Parameters
[in]typeis the callback type to register.
[in]module_maskSpecifies the modules that the callback is registered for, so that the callback manager can filter the unnecessary events. The parameter is only applicable to bt_callback_type_app_event and needs to be set when registering for bt_callback_type_app_event type. The value of this parameter is ignored when registering for any other callback types. Please refer to bt_callback_module_mask_t.
[in]callbackis a pointer to the callback function to register. This callback function is invoked by the callback manager when the Bluetooth stack notifies the callback manager.
Returns
BT_STATUS_SUCCESS, if the operation is successful. BT_STATUS_FAIL, if the callback type is incorrect or already registered or if the maximum number of callbacks, as defined by BT_CALLBACK_MANAGER_APP_EVENT_CALLBACK_MAX in the header file bt_callback_manager_config.h for the bt_callback_type_app_event type, has been reached.