CSharp_NoiseFloor.ControlPowerSDR.getCommand C# (CSharp) Method

getCommand() public method

public getCommand ( string command ) : String
command string
return String
        public String getCommand(string command)
        {
            String result = "";
            if (comPort.IsOpen)
            {
                comPort.Write(command);
                System.Threading.Thread.Sleep(100);

                result = comPort.ReadExisting();
            }

            return result;
        }

Usage Example

Ejemplo n.º 1
0
        private void measureNoiseFloor()
        {
            ProgressStatus(new ProgressEventArgs("Start Measuring Noise Floor"));
            actual = startf;
            // for loop start to end with step
            while (actual < stopf)
            {
                ProgressStatus(new ProgressEventArgs("Measure Signal Level for frequency " + actual));

                ctrlSDR.setCommand(sdrCATCommand.setFrequency(actual));
                ctrlSDR.setCommand(sdrCATCommand.setCWLMode());
                Thread.Sleep(100);
                String value = ctrlSDR.getCommand(sdrCATCommand.getRxMeter()).Replace("ZZRM1", "").Replace("dBm;", "");
                nf_measurement[actual] = value;

                actual = actual + stepf;
            }
            ProgressStatus(new ProgressEventArgs("nextStep"));
        }