简体   繁体   English

如何在Android设备和PC之间创建多个蓝牙套接字连接?

[英]How to create multiple bluetooth socket connection between Android device and PC?

UUID u = UUID.fromString(MY_UUID);
BluetoothSocket btsoc = device.createRfcommSocketToServiceRecord(u);
btsoc.connect();

This will create the bluetooth connection with PC. 这将创建与PC的蓝牙连接。 Can I create another socket connection with different UUID? 是否可以使用其他UUID创建另一个套接字连接? In normal socket, we could distinguish it with port number on one IP address. 在普通套接字中,我们可以通过一个IP地址上的端口号来区分它。

Yes, you can create many connections using different UUIDs. 是的,您可以使用不同的UUID创建许多连接。 You can check this question ( Multiple bluetooth connection ) for further details. 您可以检查此问题( 多个蓝牙连接 )以获取更多详细信息。

;) ;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM