From 756933610f922ae828bd1df34693463bfad33605 Mon Sep 17 00:00:00 2001 From: whycq <913841844@qq.com> Date: 星期一, 19 八月 2024 08:21:33 +0800 Subject: [PATCH] # --- app/src/main/java/com/example/agvcontroller/MainActivity.java | 5 +++-- app/src/main/java/com/example/agvcontroller/action/ForwardBackAction.java | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/example/agvcontroller/MainActivity.java b/app/src/main/java/com/example/agvcontroller/MainActivity.java index b77dcb1..d655f7c 100644 --- a/app/src/main/java/com/example/agvcontroller/MainActivity.java +++ b/app/src/main/java/com/example/agvcontroller/MainActivity.java @@ -125,8 +125,8 @@ // forceSwitchBtn = findViewById(R.id.btn_force_switch); goForwardBtn = findViewById(R.id.btn_go_forward); goBackwardBtn = findViewById(R.id.btn_go_backward); - rotatopnLeftBtn = findViewById(R.id.btn_go_backward); - rotatopnRightBtn = findViewById(R.id.btn_go_forward); + rotatopnLeftBtn = findViewById(R.id.btn_rotatopn_left); + rotatopnRightBtn = findViewById(R.id.btn_rotatopn_right); modelSwitchBtn = findViewById(R.id.btn_model_switch); Intent intent = getIntent(); @@ -257,6 +257,7 @@ } } return false; + } } diff --git a/app/src/main/java/com/example/agvcontroller/action/ForwardBackAction.java b/app/src/main/java/com/example/agvcontroller/action/ForwardBackAction.java index 1406f9d..eee350c 100644 --- a/app/src/main/java/com/example/agvcontroller/action/ForwardBackAction.java +++ b/app/src/main/java/com/example/agvcontroller/action/ForwardBackAction.java @@ -1,5 +1,7 @@ package com.example.agvcontroller.action; +import android.util.Log; + import com.example.agvcontroller.protocol.IActionBody; import com.example.agvcontroller.socket.RadixTools; @@ -15,6 +17,11 @@ public byte[] writeToBytes() { byte[] bytes = RadixTools.shortToByte(pwd); // byte[] bytes = Integer.toHexString(pwd & 0xFFFF).getBytes(); + StringBuilder sb = new StringBuilder(); + for (byte b : bytes) { + sb.append(String.format("%02x", b)); + } + Log.i("FF",sb.toString()); return bytes; } -- Gitblit v1.9.1