Java 如何连接蓝牙BP监控设备
我们需要从Java应用程序连接蓝牙血压监护仪Java 如何连接蓝牙BP监控设备,java,sockets,bluetooth,bluecove,java-micro-editon-sdk3.0,Java,Sockets,Bluetooth,Bluecove,Java Micro Editon Sdk3.0,我们需要从Java应用程序连接蓝牙血压监护仪 操作系统:Windows 10 语言:Java11 我们能够完成下面的事情 我们已将血压监测器与windows平板电脑配对 BP监视器的地址是c15a8bb412d0,服务名称是14839ac4… 我们尝试了以下代码,但无法连接到设备 //Sample code LocalDevice local = LocalDevice.getLocalDevice(); String serviceUUID="14839ac47d7e415c
- 操作系统:Windows 10
- 语言:Java11
//Sample code
LocalDevice local = LocalDevice.getLocalDevice();
String serviceUUID="14839ac47d7e415c9a42167340cf2339";
//String address="c15a8bb412d0";
String deviceURL = "btspp://"+serviceUUID+";name=BP2 3513;authenticate=false;encrypt=false;master=false";
javax.microedition.io.Connection notifier = Connector.open(deviceURL);
StreamConnectionNotifier streamNotifier = (StreamConnectionNotifier) notifier;
StreamConnection connection = streamNotifier.acceptAndOpen();
System.out.println(" Connection accepted.");
OutputStream output = connection.openOutputStream();
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader reader = new BufferedReader(isr);
控制卡在“连接已接受”行之前
谢谢你,詹姆斯·Z。