From 9671fa60b69a5b749bfbd989f0aa281aa284dde6 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期四, 12 三月 2026 16:50:57 +0800
Subject: [PATCH] 1
---
zy-acs-hex/src/main/java/com/zy/acs/hex/enums/ProtocolType.java | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 101 insertions(+), 0 deletions(-)
diff --git a/zy-acs-hex/src/main/java/com/zy/acs/hex/enums/ProtocolType.java b/zy-acs-hex/src/main/java/com/zy/acs/hex/enums/ProtocolType.java
new file mode 100644
index 0000000..cb5c9fd
--- /dev/null
+++ b/zy-acs-hex/src/main/java/com/zy/acs/hex/enums/ProtocolType.java
@@ -0,0 +1,101 @@
+package com.zy.acs.hex.enums;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 鏍囪瘑鏋氫妇
+ * Created by vincent on 2019-04-02
+ */
+public enum ProtocolType {
+
+ // 涓嬭 -------------------------------------------------------------------
+
+ PATH_COMMAND(0x01, "璺緞鏁版嵁鍖�", DirectionType.DOWN),
+
+ PICK_PLACE_ACK(0x06, "鍙栨斁璐у簲绛斿寘", DirectionType.DOWN),
+
+ ACTION_COMMAND(0x02, "鍔ㄤ綔鍛戒护鍖�", DirectionType.DOWN),
+
+ HEARTBEAT_COMMAND(0x03, "蹇冭烦鍖�", DirectionType.DOWN),
+
+ FAULT_CLEAR_COMMAND(0x04, "鏁呴殰鍛戒护鍖�", DirectionType.DOWN),
+
+ ACTIVATION_COMMAND(0x80, "婵�娲诲寘", DirectionType.DOWN),
+
+ LOGIN_ACK(0xF0, "鐧诲綍搴旂瓟鍖�", DirectionType.DOWN),
+
+ ACTION_SUCCESS_ACK(0xA1, "鍔ㄤ綔瀹屾垚鎴愬姛搴旂瓟", DirectionType.DOWN),
+
+ ACTION_FAIL_ACK(0xA0, "鍔ㄤ綔瀹屾垚澶辫触搴旂瓟", DirectionType.DOWN),
+
+ PATH_ACK_RESPONSE(0xB1, "璺緞鏁版嵁鍖呭洖澶峚ck", DirectionType.DOWN),
+
+ // 涓婅 -------------------------------------------------------------------
+
+ PATH_ACK(0x01, "璺緞搴旂瓟鍖�", DirectionType.UP),
+
+ PICK_PLACE_REQUEST(0x06, "鍙栨斁璐ц姹傚寘", DirectionType.UP),
+
+ COMMAND_ACK(0x02, "鍛戒护搴旂瓟鍖�", DirectionType.UP),
+
+ ACTION_COMPLETE(0x11, "鍔ㄤ綔瀹屾垚鍖�", DirectionType.UP),
+
+ DATA_CODE_REPORT(0x12, "鏈夌爜瀹炴椂鏁版嵁鍖�", DirectionType.UP),
+
+ DATA_WITHOUT_CODE_REPORT(0x13, "鏃犵爜瀹炴椂鏁版嵁鍖�", DirectionType.UP),
+
+ HEARTBEAT_REPORT(0x03, "蹇冭烦鍖�", DirectionType.UP),
+
+ FAULT_REPORT(0x04, "鏁呴殰鏁版嵁鍖�", DirectionType.UP),
+
+ HANDLE_FALUT_ACK(0x14, "鏁呴殰娓呴櫎搴旂瓟鍖�", DirectionType.UP),
+
+ SILO_REPORT(0x70, "鏂欎粨淇℃伅鍖�", DirectionType.UP),
+
+ LOGIN_REPORT(0xF0, "鏈哄櫒浜虹櫥闄嗘暟鎹寘", DirectionType.UP),
+
+ ;
+
+ private final int code; // 缂栫爜
+ private final String des; // 鎻忚堪
+ private final DirectionType direction;
+
+ ProtocolType(int code, String des, DirectionType direction) {
+ this.code = code;
+ this.des = des;
+ this.direction = direction;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public String getDes() {
+ return des;
+ }
+
+ public DirectionType getDirection() {
+ return direction;
+ }
+
+ public static List<ProtocolType> listByDirectionType(DirectionType direction) {
+ List<ProtocolType> protocolTypes = new ArrayList<ProtocolType>();
+ for (ProtocolType type : ProtocolType.values()) {
+ if (type.getDirection() == direction) {
+ protocolTypes.add(type);
+ }
+ }
+ return protocolTypes;
+ }
+
+ public static ProtocolType getByCode(int code, DirectionType direction) {
+ for (ProtocolType type : ProtocolType.values()) {
+ if (type.getCode() == code && type.getDirection() == direction) {
+ return type;
+ }
+ }
+ return null;
+ }
+
+}
--
Gitblit v1.9.1