private void stopDataCapture()
        {
            GloCaptureCommand stopCommand = new GloCaptureCommand()
            {
                isStart = 0
            };

            sendGloObject(ref stopCommand, Glo.IDs.CaptureCommand);

            capturingData = false;
            view.setCaptureButtonText("Start");
            logAndDisplayMessage("Capture stopped", MessageSource.UI);

            // write out all received data
            writeDataToFile();
        }
        private void startDataCapture()
        {
            captureData.Clear();

            if (verifyCaptureParameters())
            {
                GloCaptureCommand startCommand = new GloCaptureCommand()
                {
                    isStart   = 1,
                    frequency = (UInt16)view.CaptureSampleRate,
                };
                sendGloObject(ref startCommand, Glo.IDs.CaptureCommand);

                capturingData = true;
                view.setCaptureButtonText("Stop");
                logAndDisplayMessage("Capture started", MessageSource.UI);

                captureWaitingWorker.RunWorkerAsync(view.CaptureDuration * 1000);
            }
        }