Ejemplo n.º 1
0
 public void CDU_configure(string file_to_upload)
 {
     FileInfo file = new FileInfo(file_to_upload);
     StreamReader reader = file.OpenText();
     string line;
     while ((line = reader.ReadLine()) != null)
     {
         string[] items = line.Split(' ');
       //  uint address = uint.Parse(items[3]);
         uint address = Convert.ToUInt32(items[3], 16);
         uint value = Convert.ToUInt32(items[5], 16);   
         DAN_write_msg msg = new DAN_write_msg(address, value);
         PcapConnection.pcap.sendDanMsg(msg);
         // refresh my cached values
         getNextValues();
     }
     
 }
Ejemplo n.º 2
0
        private void checkBox_BER_COUNTER_ENABLE_CheckedChanged(object sender, EventArgs e)
        {
            //enable/disable BER counter
            uint BER_Counters_Address = 0xd0190408;
            double Value = 0;
            if (this.checkBox_BER_COUNTER_ENABLE.Checked)
            {
                Value = 1;
                Check_BER_Enable = true;
                MessageBox.Show("Need to remove the data cable from GMAC1",
                                "DAN PTP - Information",MessageBoxButtons.OK, MessageBoxIcon.Exclamation);  
            }
            else
            {
                Value = 0;
                Check_BER_Enable = false;
            }
            DAN_write_msg Msg = new DAN_write_msg(BER_Counters_Address, (uint)Value);
            PcapConnection.pcap.sendDanMsg(Msg);

        }
Ejemplo n.º 3
0
        private void buttonMemoryWrite_Click(object sender, EventArgs e)
        {
            // User has clicked OK after editing a memory location.
            UInt32 address, value;

            try
            {
                address = (uint)Convert.ToInt32(textBoxMemoryAddr.Text, 16);
            }
            catch (System.FormatException)
            {
                // TabControl selection only needed if this was an OK button handler
                //this.tabControlNodePropertyPages.SelectedIndex = MEM_VIEWER_PAGE;
                this.textBoxMemoryAddr.Focus();
                this.textBoxMemoryAddr.SelectAll();
                MessageBox.Show("Please enter a hexadecimal number", "Invalid Address",
                        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            try
            {
                value = (uint)Convert.ToInt32(textBoxMemoryValue.Text, 16);
            }
            catch (System.FormatException)
            {
                //this.tabControlNodePropertyPages.SelectedIndex = MEM_VIEWER_PAGE;
                this.textBoxMemoryValue.Focus();
                this.textBoxMemoryValue.SelectAll();
                MessageBox.Show("Please enter a hexadecimal number", "Invalid Address",
                        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            // Send the write...
            DAN_write_msg wMsg = new DAN_write_msg(address, value);
            PcapConnection.pcap.sendDanMsg(wMsg);

            // ... refresh the display with a new read...
            DAN_read_array_msg msg = new DAN_read_array_msg(address, 64);
            outstandingRequestSeq = msg.seq;
            PcapConnection.pcap.sendDanMsg(msg);

            // and restore button and control state to 'Not Editing'
            handleMemoryViewCancel(sender, e);
        }
Ejemplo n.º 4
0
        private void write_new_command(uint address, uint value)
        {
            // Send the write...

            DAN_write_msg wMsg = new DAN_write_msg(address, value);
            PcapConnection.pcap.sendDanMsg(wMsg);
        }
Ejemplo n.º 5
0
 public void resetGMACCounters()
 {
     uint Clear_GMAC_Counters_Value = 1;
     DAN_write_msg Msg = new DAN_write_msg(GMAC_Reset_Counters_Address, (uint)Clear_GMAC_Counters_Value);
     PcapConnection.pcap.sendDanMsg(Msg);
 }
Ejemplo n.º 6
0
        public void resetAirlinkCounters()
        {

        //uint Clr_Counters = 0x0;
        //DAN_write_msg msg = new DAN_write_msg(blockAddrs[0],Clr_Counters);
        //PcapConnection.pcap.sendDanMsg(msg);
        //// refresh my cached values
        //getNextValues();

            // Takes note of current values:
            baseNackData = nackData;
            baseAckData = ackData;
            baseNackCtrl = nackCtrl;
            baseAckCtrl = ackCtrl;
            
            baseTxNumTbs = txNumTbs;
            baseTxNumFrames = txNumFrames;
            baseRxNumTbs = rxNumTbs;
            baseRxNumFrames = rxNumFrames;
            baseRxNumBadTbs0 = rxNumBadTbs0;
            baseRxNumBadTbs1 = rxNumBadTbs1;

            baseAck0 = ack0;
            baseNack0 = nack0;
            baseAck1 = ack1;
            baseNack1 = nack1;
            
            if (FormNodeProperties.instance.Check_BER_Enable)
            {
                DAN_write_msg Msg = new DAN_write_msg(BER_Reset_Counters_Address, Clear_BER_Counters_Value);
                PcapConnection.pcap.sendDanMsg(Msg);
                // refresh my cached values
                getNextValues();
            }

            if (FormNodeProperties.instance.Check_Uncoded_BER_Enable)
            {
                DAN_write_msg Msg = new DAN_write_msg(UCBER_Reset_Counters_Address, Clear_UCBER_Counters_Value);
                PcapConnection.pcap.sendDanMsg(Msg);
                // refresh my cached values
                getNextValues();
            }   
        }
Ejemplo n.º 7
0
 public void ChannelGainActivate(bool activate)
 {
     if (ChannelGainReadRegister)
     {
         if (activate)
         {
             UInt32 CG_Activate = ChannelGainEnableValue | 0x00001000;
             DAN_write_msg wMsg = new DAN_write_msg(ChannelGainEnableAddress, CG_Activate);
             PcapConnection.pcap.sendDanMsg(wMsg);
         }
         else
         {
             UInt32 CG_Deactivate = ChannelGainEnableValue & 0xffff0fff;
             DAN_write_msg wMsg = new DAN_write_msg(ChannelGainEnableAddress, CG_Deactivate);
             PcapConnection.pcap.sendDanMsg(wMsg);
         }
     }
 }
Ejemplo n.º 8
0
 private void buttonResetSOC_Click(object sender, EventArgs e)
 {
     DialogResult dialogResult = MessageBox.Show("This action will reset the unit.\n Do you want to continue?\n", "Reset SoC", MessageBoxButtons.YesNo);
     if (dialogResult == DialogResult.Yes)
     {
         UInt32 CG_Activate = 0x00010000;
         DAN_write_msg wMsg = new DAN_write_msg(SoCResetAddress, CG_Activate);
         PcapConnection.pcap.sendDanMsg(wMsg);
     }                      
 }