Browse Source

feat:增加日志

tags/freeze
黄翔 3 months ago
parent
commit
ef6feb37ce
  1. 4
      src/main/java/com/iflytop/gd/infrastructure/drivers/WebSocketCommandBusImpl.java
  2. 5
      src/main/java/com/iflytop/gd/system/models/MotorStatus.java

4
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) {

5
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;
}
Loading…
Cancel
Save