public static OperationResult<bool> GKUpdateFirmware(XDevice device, string fileName, string userName) { Stop(); var firmwareUpdateHelper = new FirmwareUpdateHelper(); firmwareUpdateHelper.Update(device, fileName, userName); Start(); if (firmwareUpdateHelper.ErrorList.Count > 0) return new OperationResult<bool>(firmwareUpdateHelper.ErrorList.Aggregate((a,b)=> a + "\n" + b)) { Result = false }; return new OperationResult<bool> { Result = true }; }
public static OperationResult<bool> GKUpdateFirmwareFSCS(HexFileCollectionInfo hxcFileInfo, string userName, List<XDevice> devices) { Stop(); var firmwareUpdateHelper = new FirmwareUpdateHelper(); firmwareUpdateHelper.UpdateFSCS(hxcFileInfo, devices, userName); Start(); if (firmwareUpdateHelper.ErrorList.Count > 0) return new OperationResult<bool>(firmwareUpdateHelper.ErrorList.Aggregate((a, b) => a + "\n" + b)) { Result = false }; return new OperationResult<bool> { Result = true }; }
public static OperationResult<bool> GKUpdateFirmware(GKDevice device, List<byte> firmwareBytes, string userName, Guid clientUID) { Stop(); var firmwareUpdateHelper = new FirmwareUpdateHelper(); string updateResult = firmwareUpdateHelper.Update(device, firmwareBytes, userName, clientUID); Start(); if (updateResult != null) return OperationResult<bool>.FromError(updateResult, false); return new OperationResult<bool>(true); }