This section defines the Bluetooth callback manager API to manage all Bluetooth callback functions.
More...
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
- Add a customized record with the service name, language list, service class ID list and a protocol description list for a service. Add your own record according to the SDP interoperability requirements in the related profile specification. To add customized records with the SDP macros and API:
- Example code:
{
}
{
}
static const uint8_t my_service_class_id_list[] =
{
};
{
};
{
.attribute_list = my_sdp_attributes,
};
{
printf("Initialization has failed! \r\n");
}
}
{
printf("De-initialization has failed! \r\n");
}
}
|
| | Define |
| | Define the callback manager structures.
|
| |
This function unregister the callback from the Bluetooth callback manager.
- Parameters
-
| [in] | type | is the callback type to unregister. |
| [in] | callback | is 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.
This function registers a callback to the Bluetooth callback manager.
- Parameters
-
| [in] | type | is the callback type to register. |
| [in] | module_mask | Specifies 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] | callback | is 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.