且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android 4.4:低功耗蓝牙;无需扫描 BLE 设备即可连接

更新时间:2023-01-24 08:01:17

设备地址只是蓝牙设备的唯一标识,不包含连接信息.扫描对于从蓝牙设备检索广播信号中的信息是必要的,以便可以建立连接.扫描完成后,信息会保存在设备上的某处并绑定到设备地址.

The device address is merely a unique identifier for the bluetooth device, it doesn't contain the information for connection. The scan is necessary to retrieve the information within the broadcast signal from the bluetooth device so that a connection can be made. Once the scan is done, the information is saved somewhere on the device and bound to the device address.

我认为,如果您尝试检索蓝牙地址的值,它将返回 null,直到它被扫描一次.

I think if you try to retrieve the value for the bluetooth address it will return null until after it has been scanned once.