Exemplo n.º 1
0
        static private bool GetReports(SerialPortFacade serialPort, string outputPath)
        {
            bool valid = false;

            if (serialPort.Receiver.state ==
                Constants.ReceiverStates.TxDcOffsetCalComplete)
            {
                // maybe get all reports in a list, then iterate through the list
                valid = serialPort.Write(Constants.UHD_Cal_Reports.reportDir);
                while (serialPort.Receiver.state ==
                       Constants.ReceiverStates.TxDcOffsetCalComplete)
                {
                    ;
                }
            }

            if (serialPort.Receiver.state ==
                Constants.ReceiverStates.RxIqReportDownloaded)
            {
                valid = serialPort.Write(Constants.UHD_Cal_Reports.reportDir);
                while (serialPort.Receiver.state ==
                       Constants.ReceiverStates.RxIqReportDownloaded)
                {
                    ;
                }
            }

            if (serialPort.Receiver.state ==
                Constants.ReceiverStates.TxIqReportDownloaded)
            {
                valid = serialPort.Write(Constants.UHD_Cal_Reports.reportDir);
                while (serialPort.Receiver.state ==
                       Constants.ReceiverStates.TxIqReportDownloaded)
                {
                    ;
                }
            }

            return(valid &&
                   (serialPort.Receiver.state ==
                    Constants.ReceiverStates.TxDcOffsetReportDownloaded));
        }
Exemplo n.º 2
0
        static private bool HandleCal(SerialPortFacade serialPort)
        {
            bool valid = false;

            if (serialPort.Receiver.state ==
                Constants.ReceiverStates.LoggedIn)
            {
                valid = serialPort.Write(Constants.UHD_Cals.uhd_cal_rx_iq_balance);
                while (serialPort.Receiver.state ==
                       Constants.ReceiverStates.LoggedIn)
                {
                    ;
                }
            }

            if (serialPort.Receiver.state ==
                Constants.ReceiverStates.RxIqCalComplete)
            {
                valid = serialPort.Write(Constants.UHD_Cals.uhd_cal_tx_iq_balance);
                while (serialPort.Receiver.state ==
                       Constants.ReceiverStates.RxIqCalComplete)
                {
                    ;
                }
            }

            if (serialPort.Receiver.state ==
                Constants.ReceiverStates.TxIqCalComplete)
            {
                valid = serialPort.Write(Constants.UHD_Cals.uhd_cal_tx_dc_offset);
                while (serialPort.Receiver.state ==
                       Constants.ReceiverStates.TxIqCalComplete)
                {
                    ;
                }
            }

            return(valid &&
                   (serialPort.Receiver.state ==
                    Constants.ReceiverStates.TxDcOffsetCalComplete));
        }
Exemplo n.º 3
0
        static private bool HandleLogin(SerialPortFacade serialPort, string username, string password)
        {
            bool valid = false;

            if (serialPort.Receiver.state ==
                Constants.ReceiverStates.LoggedIn)
            {
                return(valid);
            }

            if (serialPort.Receiver.state ==
                Constants.ReceiverStates.Booted)
            {
                valid = serialPort.Write(username);

                while (serialPort.Receiver.state ==
                       Constants.ReceiverStates.Booted)
                {
                    ;
                }
            }

            if (serialPort.Receiver.state ==
                Constants.ReceiverStates.UsernameEntered)
            {
                valid = serialPort.Write(password);

                while (serialPort.Receiver.state ==
                       Constants.ReceiverStates.UsernameEntered)
                {
                    ;
                }
            }


            return(valid &&
                   (serialPort.Receiver.state ==
                    Constants.ReceiverStates.LoggedIn));
        }