コード例 #1
0
ファイル: Program.cs プロジェクト: gmg2719/usrp-e310-cal
        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));
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: gmg2719/usrp-e310-cal
        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));
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: gmg2719/usrp-e310-cal
        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));
        }