| | |
| | | |
| | | case "CAN": |
| | | // CAN 驱动: endpoint 格式为 "busName:nodeIndex" 如 "CAN_BUS_1:0" |
| | | string busName = ip; // ip 字段用作总线名称 |
| | | int nodeIndex = port; // port 字段用作节点编号 |
| | | Log.Info($"[DriverFactory] 创建 CAN 虚拟驱动: Bus={busName}, Node={nodeIndex}"); |
| | | return new CanDriverAdapter(deviceId, busName, nodeIndex); |
| | | // 统一的 CanDeviceDriver(Local 默认走 TCP NodeChannel 连模拟器) |
| | | Log.Info($"[DriverFactory] 创建 CAN 驱动: Endpoint={endpoint}"); |
| | | return new CanDeviceDriver(deviceId, endpoint); |
| | | |
| | | default: |
| | | throw new NotSupportedException($"不支持的传输协议类型: {transport}。支持的类型: Tcp, SCPI, ModBus, S7, Serial, CAN"); |