From 559890c482f5973f06aafdfec9550fee5ba3c7f2 Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 09 十一月 2026 17:02:15 +0800
Subject: [PATCH] feat: CAN 模拟器 TCP 化 + 多设备并发调试 + 后台生命周期管理

---
 Aging.ResourceContracts/DeviceOperationTypes.cs |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/Aging.ResourceContracts/DeviceOperationTypes.cs b/Aging.ResourceContracts/DeviceOperationTypes.cs
new file mode 100644
index 0000000..2b0e5e2
--- /dev/null
+++ b/Aging.ResourceContracts/DeviceOperationTypes.cs
@@ -0,0 +1,36 @@
+namespace Aging.ResourceContracts
+{
+    public enum OperationState
+    {
+        Succeeded, Failed,
+        /// <summary>鏍呮爮鏍¢獙澶辫触锛欸rant 鐨� epoch/generation 宸插け鏁堬紙鍚� Broker 閲嶅惎锛夈��</summary>
+        RejectedStaleLease,
+        /// <summary>INV-04 闆忓舰锛氬鎴风 configHash 涓� Broker 鐢熸晥閰嶇疆涓嶄竴鑷淬��</summary>
+        RejectedConfigMismatch,
+        /// <summary>浼氳瘽闃熷垪婊°��</summary>
+        RejectedQueueFull,
+        /// <summary>宸插彂閫佷絾缁撴灉鏈煡锛圛NV-06锛氱姝㈠綋鏈墽琛岋級銆�</summary>
+        Unknown
+    }
+
+    /// <summary>涓�娆℃湁鐣岃澶囧姩浣滐紙MVP=OneShot锛夈�侴rants 蹇呴』瑕嗙洊 resources銆�</summary>
+    public sealed class DeviceOperation
+    {
+        /// <summary>鐧藉悕鍗曟搷浣滅爜锛屽 "CAN_SEND"/"CAN_RECV"/"CAN_AUTO_RESPONSE"/"CAN_STATUS"銆�</summary>
+        public string OperationCode { get; set; } = "";
+        public string ParametersJson { get; set; } = "{}";
+        public string IdempotencyKey { get; set; } = "";
+        public string ConfigHash { get; set; } = "";
+        public LeaseGrant[] Grants { get; set; } = new LeaseGrant[0];
+        public long DeadlineUtcMs { get; set; }
+    }
+
+    public sealed class OperationResult
+    {
+        public string RequestId { get; set; } = "";
+        public OperationState State { get; set; }
+        public string ErrorCode { get; set; } = "";
+        public string ReadbackJson { get; set; } = "{}";
+        public long ServerEpoch { get; set; }
+    }
+}

--
Gitblit v1.9.1