谢谢你查查我的问题。
我使用android开发人员中的代码来连接ble:
BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);
if (device == null) {
Log.w(TAG, "Device not found. Unable to connect.");
return false;
}
// We want to directly connect to the device, so we are setting the autoConnect
// parameter to false.
if (mBluetoothGatt != null) {
mBluetoothGatt.close();
mBluetoothGatt = null;
}
mBluetoothGatt = device.connectGatt(this, false, mGattCallback);但是在代码工作之后,对对话框就会出现,而我实际上并不需要这对工作,我只需要连接客户端,然后发送数据(我需要连接的远程设备已经被设置为“不需要对”),有什么方法可以避免对调用吗?
谢谢!
发布于 2016-11-08 21:44:49
只有当远程设备实际发送“安全请求”数据包时,才会设置配对对话框,表明它希望配对。所以你的“不需要对”设置由于某种原因似乎不能正常工作.
https://stackoverflow.com/questions/40487662
复制相似问题