| | |
| | | throw new NotImplementedException(); |
| | | } |
| | | |
| | | public bool SendCommand(DeviceCommand command, string deviceChildCode) |
| | | public bool SendCommand<T>(T command, string deviceChildCode) where T : IDataTransfer, new() |
| | | { |
| | | DeviceProDTO? devicePro = _deviceProDTOs.Where(x => x.DeviceProParamType == nameof(DeviceCommand) && x.DeviceChildCode == deviceChildCode).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | if (devicePro == null) |
| | |
| | | |
| | | public T ReadCustomer<T>(string deviceChildCode) where T : IDataTransfer, new() |
| | | { |
| | | DeviceProDTO? devicePro = _deviceProDTOs.Where(x => x.DeviceProParamType == nameof(DeviceCommand) && x.DeviceChildCode == deviceChildCode).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | DeviceProDTO? devicePro = _deviceProDTOs.Where(x => x.DeviceProParamType == "ReadDeviceCommand" && x.DeviceChildCode == deviceChildCode).OrderBy(x => x.DeviceProOffset).FirstOrDefault(); |
| | | |
| | | if (devicePro == null) |
| | | { |
| | | throw new Exception(); |
| | | throw new Exception("未找到协议信息"); |
| | | } |
| | | else |
| | | { |