From cd4bb33d29613a3a5313e24260d2120a84d3dd89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=8A=9B?= Date: Mon, 16 Oct 2023 09:27:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=A9=E4=BD=99=E4=BB=A3=E7=A0=81=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/cl/myapplication/MainJavaActivity.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/cl/myapplication/MainJavaActivity.java b/app/src/main/java/com/cl/myapplication/MainJavaActivity.java index c1f2fee..96f49ed 100644 --- a/app/src/main/java/com/cl/myapplication/MainJavaActivity.java +++ b/app/src/main/java/com/cl/myapplication/MainJavaActivity.java @@ -48,6 +48,9 @@ public class MainJavaActivity extends AppCompatActivity implements AdapterView.O private ActivityMainJavaBinding binding; private Device mDevice; private byte[] b1 = {(byte) 33, (byte) -3}; + + private byte[] t = {(byte) 67, (byte) 72,(byte) 73,(byte) 78}; + private String[] mDevices; private String[] mBaudrates; private int mDeviceIndex; @@ -142,13 +145,15 @@ public void openState(SerialPortEnum serialPortEnum, File device, SerialStatus s } }); -/* //多串口演示 + //多串口演示 List list2=new ArrayList<>(); //串口ttyS4 - list2.add(new Driver("/dev/ttyUSB0", "115200")); - list2.add(new Driver("/dev/ttyUSB1", "115200")); list2.add(new Driver("/dev/ttyS4", "115200")); - SerialUtils.getInstance().manyOpenSerialPort(list2);*/ + list2.add(new Driver("/dev/ttyS2", "115200")); +// list2.add(new Driver("/dev/ttyS4", "115200")); + SerialUtils.getInstance().manyOpenSerialPort(list2); + + binding.btnOpenDevice.setOnClickListener(v -> { if (mOpened) {