public ConnectThread(BluetoothDevice device) {
// Use a temporary object that is later assigned to mmSocket,
// because mmSocket is final
BluetoothSocket tmp = null;
mmDevice = device;
// Get a BluetoothSocket to connect with the given BluetoothDevice
try {
// MY_UUID is the app's UUID string, also used by the server code
UUID uuid = Constants.myUUID;
tmp = device.createRfcommSocketToServiceRecord(uuid);
} catch (IOException e) {
Log.e(Constants.TAG, "Create RFcomm socket failed", e);
}
mmSocket = tmp;
}
BluetoothService.java 文件源码
java
阅读 46
收藏 0
点赞 0
评论 0
项目:Lazy-Switches
作者:
评论列表
文章目录