This section provides APIs to get Bluetooth device information and handle the bonding procedures.
More...
This section provides APIs to get Bluetooth device information and handle the bonding procedures.
How to use this module
- Step 1. Initialize the device manager at boot up.
- Step 2. Use device manager APIs to access the paired device list.
- Sample code:
uint32_t read_number = 5;
uint32_t i;
for(i = 0; i < read_number; i++)
{
printf(
"paired index: %d, device name: %s", i, paired_devices->
name);
}
- Step 3. Delete a paired device.
- Sample code:
bt_bd_addr_t address = {0x00, 0x33, 0x63, 0x56, 0xE0, 0x4C};
}
|
| | Define |
| | Define Bluetooth device manager service data types and values.
|
| |
| | Struct |
| | This section defines structures for the Bluetooth device manager service.
|
| |
This function unpairs an already paired device.
If the specified device is unpaired, the return status is BT_STATUS_FAIL.
- Parameters
-
| [in] | address | is the address of the already paired device. |
- Returns
- BT_STATUS_SUCCESS, if the device is unpaired successfully. BT_STATUS_FAIL, if an error occurred.
This function gets the paired device list.
- Parameters
-
| [out] | info | is a list containing the information of paired devices. |
| [in,out] | read_number | specifies the length of the #info list when calling this function. Upon the return of this function call, the #read_number contains the actual number of paired devices in the #info list. |
- Returns
- None.
| uint32_t bt_device_manager_get_paired_number |
( |
void |
| ) |
|
This function gets the number of the paired devices.
- Returns
- The number of the paired devices.
| void bt_device_manager_init |
( |
void |
| ) |
|
This function initializes the Bluetooth device manager.
It's recommended to call this function at the boot up.
- Returns
- None.
This function gets the status of a device.
- Parameters
-
| [in] | address | is the address of the device. |
- Returns
- true, if the device is paired. false, if the device is not paired.