<span style="font-size:16px;"><strong>1.蓝牙地址获取</strong></span><br><span style="color:#ff00ff;">android P:</span><br>获取方法是bluetooth_address.cpp里面
vendor/qcom/proprietary/bluetooth/hidl_transport/bt/1.0/default/bluetooth_address.cpp
bool BluetoothAddress::GetLocalAddress(uint8_t *local_addr)
{
char property[PROPERTY_VALUE_MAX] = { 0 };
bool valid_bda = false;
// Get addr from vendor location
if (fetch_vendor_addr(local_addr)) {
valid_bda = true;
}
// Get local bdaddr storage path from a system property.
if (!valid_bda && property_get(PROPERTY_BT_BDADDR_PATH, property, NULL)) {
int addr_fd;
ALOGV("%s: Trying %s", __func__, property);
addr_fd = open(property, O_RDONLY);
if (addr_fd != -1) {
int bytes_read = read(addr_fd, property, kStringLength);
CHECK(bytes_read == kStringLength);
close(addr_fd);
// Null terminate the string.
property[kStringLength] = '\0';
// If the addre