且构网

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

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

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

设备地址只是蓝牙设备的唯一标识符,不包含用于连接的信息.必须进行扫描才能从蓝牙设备检索广播信号中的信息,以便可以建立连接.扫描完成后,信息将保存在设备上的某个位置并绑定到设备地址.

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.

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

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