From ef6feb37ce74c4eb0c6d60783fdf00cb4a18b8ae Mon Sep 17 00:00:00 2001 From: huangxiang <155373492@qq.com> Date: Tue, 29 Apr 2025 11:27:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iflytop/gd/infrastructure/drivers/WebSocketCommandBusImpl.java | 4 +++- src/main/java/com/iflytop/gd/system/models/MotorStatus.java | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/iflytop/gd/system/models/MotorStatus.java diff --git a/src/main/java/com/iflytop/gd/infrastructure/drivers/WebSocketCommandBusImpl.java b/src/main/java/com/iflytop/gd/infrastructure/drivers/WebSocketCommandBusImpl.java index 050ea97..ab29cca 100644 --- a/src/main/java/com/iflytop/gd/infrastructure/drivers/WebSocketCommandBusImpl.java +++ b/src/main/java/com/iflytop/gd/infrastructure/drivers/WebSocketCommandBusImpl.java @@ -73,7 +73,9 @@ public class WebSocketCommandBusImpl implements CommandBus { } commandPacket.setPacketIndex(packetIndex); this.countDownLatch = new CountDownLatch(1); - this.session.getBasicRemote().sendText(commandPacket.toByteString()); + String byteString = commandPacket.toByteString(); + log.info("ModuleId={}, CommandId={}, 数据包二进制字符内容={}", commandPacket.getModuleId(), commandPacket.getCmdId(), byteString); + this.session.getBasicRemote().sendText(byteString); boolean isTimeout = !this.countDownLatch.await(timeout, unit); // 命令返回或者超时了 if (isTimeout) { diff --git a/src/main/java/com/iflytop/gd/system/models/MotorStatus.java b/src/main/java/com/iflytop/gd/system/models/MotorStatus.java new file mode 100644 index 0000000..b045ba1 --- /dev/null +++ b/src/main/java/com/iflytop/gd/system/models/MotorStatus.java @@ -0,0 +1,5 @@ +package com.iflytop.gd.system.models; + +public class MotorStatus { + private Integer speed; +}