MT6572蓝牙问题
时间:10-02
整理:3721RD
点击:
bluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
bluetoothAdapter.cancelDiscovery();
BluetoothDevice device = bluetoothAdapter.getRemoteDevice(strAddr);
BluetoothSocket e = (BluetoothSocket) device.getClass().getMethod("createRfcoMMSocket",new Class[] { Integer.TYPE }).invoke(device, new Object[] { Integer.valueOf(1) });
if (e != null) {
Class clazz = e.getRemoteDevice().getClass();
Class[] paramTypes = new Class[] { Integer.TYPE };
Method m = clazz.getMethod("createRfcommSocket", paramTypes);
Object[] params = new Object[] { Integer.valueOf(1) };
mmSocket = (BluetoothSocket) m.invoke(e.getRemoteDevice(),params);
mmSocket.connect();
}
MT6572上面,使用蓝牙端口连接的方式,在mmSocket.connect()后,会出来read error或timeout的错误。代码在其它平台验证过是没问题的,不知道是系统要打补丁还是哪里有bug,请问有人遇到这样的问题的吗?
