public static String GetActualMeasurementValue(Device deviceToRead) { String actualValue = null; switch (deviceToRead.Protocol) { case "com-1": actualValue = new SylcvacComAccess().GetActualValueFromComInterface(deviceToRead); break; default: throw new ReadWriteException("Keine Schnittstelle für das Prokololl " + deviceToRead.Protocol + " implementiert"); } return(actualValue); }
public IHttpActionResult SetValueZero(String id) { try { List <Device> devices = ConfigurationAccess.GetDeviceListFromConfig(); Device deviceToRead = DeviceListHandler.GetDeviceFromDeviceList(devices, id); String handShake = new SylcvacComAccess().SetActualValueToZero(deviceToRead); return(Ok(handShake)); } catch (ReadWriteException ex) { return(BadRequest(ex.Message)); } }