private void RetrieveLog(Request request)
        {
            string filename = request.Value;

            if (String.IsNullOrWhiteSpace(filename))
            {
                Logger.Instance.Write("RetrieveLog", LogLevel.Medium, "Invalid filename to retrieve");
                RequestComponent.GetInstance().FinishRequest(macAddress, Models.InputModels.RequestInputModel.From(request.Id, false));
            }

            LogRetriever.GetInstance().PostLog(macAddress, filename, request.Id);
        }
        private void UpdateFontFactor(Request request, Structure structure)
        {
            float value = -1;
            float.TryParse(request.Value, out value);

            if (value < 0)
            {
                RequestComponent.GetInstance().FinishRequest(macAddress, Models.InputModels.RequestInputModel.From(request.Id, false));
                return;
            }

            structure.FontSizeFactor = value;
            RequestComponent.GetInstance().FinishRequest(macAddress, Models.InputModels.RequestInputModel.From(request.Id, true));
        }
        private void handleRequest(Request request, Structure structure)
        {
            Logger.Instance.Write("handleRequest", LogLevel.Low, "Handling Request " + request.RequestType.ToString() + " with value '" + request.Value ?? request.Value + "'");

            if (request.RequestType == RequestType.SoftwareUpdate)
            {
                SoftwareUpdateComponent.GetInstance(macAddress, request.Id).GetLatestSoftwareVersion(request.Value);
            }
            else if (request.RequestType == RequestType.RestartDevice)
            {
                RequestComponent.GetInstance().FinishRequest(macAddress, Models.InputModels.RequestInputModel.From(request.Id, true));
                HardwareComponent.Restart();
            }
            else if (request.RequestType == RequestType.TakeScreenshot)
            {
                TakeScreenshot(request);
            }
            else if (request.RequestType == RequestType.RetrieveLog)
            {
                RetrieveLog(request);
            }
        }
        private void TakeScreenshot(Request request)
        {
            Guid screenshotId;
            if (request.Value == null || !Guid.TryParse(request.Value, out screenshotId))
            {
                Logger.Instance.Write("TakeScreenshot", LogLevel.Medium, "Invalid value for request");
                RequestComponent.GetInstance().FinishRequest(macAddress, Models.InputModels.RequestInputModel.From(request.Id, false));
                return;
            }

            if (ScreenshotComponent.GetInstance().CreateScreenshot())
            {
                ScreenshotComponent.GetInstance().SendScreenshot(screenshotId, macAddress, request.Id);
                RequestComponent.GetInstance().FinishRequest(macAddress, Models.InputModels.RequestInputModel.From(request.Id, true));
            }
            else
            {
                RequestComponent.GetInstance().FinishRequest(macAddress, Models.InputModels.RequestInputModel.From(request.Id, false));
            }
        }