在做蓝牙配对时,发现调用setPin函数发送PIN码,如123456时,蓝牙设备那边一直显示PIN错误。
我试过了无论是字符串的123456,还是数字123456都不行,但是使用全0的PIN可以配对成功,请大神指教。。
byte[] pin = (byte[]) BluetoothDevice.class.getMethod("convertPinToBytes", String.class).invoke(BluetoothDevice.class, "123456");
Log.i("pair", Arrays.toString(pin));
boolean flag = device.setPin(pin);