获取和设定蓝牙地址和蓝牙名称的相关api:
services\bt_app\besbt.h
unsigned char *bt_get_local_address(void);
void bt_set_local_address(unsigned char* btaddr);
unsigned char *bt_get_ble_local_address(void);
void bt_set_ble_local_address(uint8_t* bleAddr);
const char *bt_get_local_name(void);
void bt_set_local_name(const char* name);
const char *bt_get_ble_local_name(void);
具体实现方法可以查看besmain.cpp
services\bt_app\besmain.cpp
unsigned char *bt_get_local_address(void)
{
return bt_addr;
}
void bt_set_local_address(unsigned char* btaddr)
{
if (btaddr != NULL) {
memcpy(bt_addr, btaddr, BTIF_BD_ADDR_SIZE);
}
}
void bt_set_ble_local_address(uint8_t* bleAddr)
{
if (bleAddr)
{