我正在尝试将UA-651 bp智能连接到手机。但是当它在范围内时,我无法使用设备自动连接我的应用程序? 我也尝试下面的代码,它不适合我.plz给我解决方案
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.
// boolean: Whether to directly connect to the remote device (false) or
// to automatically connect as soon as the remote device becomes
// available (true).
mBluetoothGatt = device.connectGatt(this, true, mGattCallback);
Log.d(TAG, "Trying to create a new connection.");
mBluetoothDeviceAddress = address;
mConnectionState = STATE_CONNECTING;
return true;
}