![]() |
MT2523 API Reference
LinkIt SDK v4
|
The Bluetooth notification service is a Bluetooth service that parses the information from a remote device. More...
The Bluetooth notification service is a Bluetooth service that parses the information from a remote device.
The information could be a common notification, message, missed call or a customized content.
| Terms | Details |
|---|---|
| SPP | Serial Port Profile. For more information, please refer to Wikipedia. |
| SDP | Service Discovery Protocol. For more information, please refer to Wikipedia. |
| DOGP | Data Over GATT Profile. It is a GATT based profile defined by MediaTek. It is used to transmit (send and receive) data through a GATT server. |
| EXCD | Extend Command. It is used to send and receive customized data. |
Functions | |
| bt_notify_result_t | bt_notify_register_callback (const bt_bd_addr_t *bt_addr, char *sender, bt_notify_callback_t cb_ptr) |
| This function registers a callback function to the Bluetooth notification service. More... | |
| bt_notify_result_t | bt_notify_deregister_callback (const bt_bd_addr_t *bt_addr, bt_notify_callback_t cb_ptr) |
| This function unregisters the callback function that has already been registered. More... | |
| int32_t | bt_notify_send_data (bt_bd_addr_t *bt_addr, const char *data, uint16_t data_len, bool is_new) |
| Call this function to send data. More... | |
| void | bt_notify_init (uint8_t sdp_id) |
| This function initializes the Bluetooth notification service. More... | |
| bt_notify_data_source_t | bt_notify_get_data_source (bt_bd_addr_t *bt_addr) |
| Call this function to get the data transfer mode. More... | |
Modules | |
| Define | |
| This section defines the macros for the Bluetooth notification service. | |
| Struct | |
| This section defines the structures for the Bluetooth notification service. | |
| bt_notify_result_t bt_notify_deregister_callback | ( | const bt_bd_addr_t * | bt_addr, |
| bt_notify_callback_t | cb_ptr | ||
| ) |
This function unregisters the callback function that has already been registered.
| [in] | bt_addr | is the Bluetooth address of a remote device. It cannot be NULL. |
| [in] | cb_ptr | is the callback function to unregister. |
| bt_notify_data_source_t bt_notify_get_data_source | ( | bt_bd_addr_t * | bt_addr | ) |
Call this function to get the data transfer mode.
| [in] | bt_addr | is the Bluetooth address of a remote device. It cannot be NULL. |
| void bt_notify_init | ( | uint8_t | sdp_id | ) |
This function initializes the Bluetooth notification service.
It should be called either in application initialization or in system initialization.
| [in] | sdp_id | is the record ID of the SDP. |
| bt_notify_result_t bt_notify_register_callback | ( | const bt_bd_addr_t * | bt_addr, |
| char * | sender, | ||
| bt_notify_callback_t | cb_ptr | ||
| ) |
This function registers a callback function to the Bluetooth notification service.
| [in] | bt_addr | is the Bluetooth address of a remote device. It can be NULL. |
| [in] | sender | is a character string to identify the entity the callback is registered for. |
| [in] | cb_ptr | is the callback function. |
| int32_t bt_notify_send_data | ( | bt_bd_addr_t * | bt_addr, |
| const char * | data, | ||
| uint16_t | data_len, | ||
| bool | is_new | ||
| ) |
Call this function to send data.
Wait for the BT_NOTIFY_EVENT_SEND_IND event to send more data.
| [in] | bt_addr | is the Bluetooth address of the remote device to send data to. It cannot be NULL. |
| [in] | data | is the data to be sent. |
| [in] | data_len | is the data length. |
| [in] | is_new | is the flag indicating if the data is new. |