微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > MT6572蓝牙问题

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,请问有人遇到这样的问题的吗?


       

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top