Exemplo n.º 1
0
        //void ComPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
        //{

        //    byte[] data = new byte[ComPort.BytesToRead];
        //    for (int i = 0; i < data.Length; i++)
        //    {
        //        data[i] = (byte)ComPort.ReadByte();
        //    }

        //    this.HandleByte(data);


        //    //throw new Exception("The method or operation is not implemented.");
        //}

        private void comboPorts_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ComPort != null)
            {
                ComPort.Close();
                OnConnectedChanged();
            }

            int idx = comboPorts.SelectedIndex;

            if (idx <= 0)
            {
                ComPort = null;
                butEditSerial.Enabled = false;
                return;
            }

            string portName = comboPorts.SelectedItem.ToString();

            ComPort = new SerialPort(portName);

            //ComPort.DataReceived += new SerialDataReceivedEventHandler(ComPort_DataReceived);
            butEditSerial.Enabled = true;
            ComPort.Open();
            OnConnectedChanged();
            iSerial = new BoxdorferSerial(ComPort, this);

            atmelVersion.Read(iSerial);
            SynchronizeRead();
        }
Exemplo n.º 2
0
 public void Write(BoxdorferSerial theChannel)
 {
     if (theChannel != null)
     {
         theChannel.AddCommand(this);
     }
 }
Exemplo n.º 3
0
 public void Write(BoxdorferSerial theChannel)
 {
     if (theChannel != null)
     {
         theChannel.AddCommand(this);
     }
 }
Exemplo n.º 4
0
 public void Read(BoxdorferSerial theChannel)
 {
     //iLogger.Debug(String.Format("BoxdorferLong Read {0:X}", iReceiveCommand));
     if (theChannel != null)
     {
         isWriting = false;
         theChannel.AddCommand(this);
     }
 }
Exemplo n.º 5
0
 public void Write(BoxdorferSerial theChannel)
 {
     //iLogger.Debug(String.Format("BoxdorferLong Write {0:X}", iSendCommand));
     if (theChannel != null)
     {
         isWriting = true;
         theChannel.AddCommand(this);
     }
 }
Exemplo n.º 6
0
 public void Read(BoxdorferSerial theChannel)
 {
     //iLogger.Debug(String.Format("BoxdorferLong Read {0:X}", iReceiveCommand));
     if (theChannel != null)
     {
         isWriting = false;
         theChannel.AddCommand(this);
     }
 }
Exemplo n.º 7
0
 public void Write(BoxdorferSerial theChannel)
 {
     //iLogger.Debug(String.Format("BoxdorferLong Write {0:X}", iSendCommand));
     if (theChannel != null)
     {
         isWriting = true;
         theChannel.AddCommand(this);
     }
 }
Exemplo n.º 8
0
 public void SendCommand(BoxdorferSerial aPort)
 {
     if (Check)
     {
         aPort.SendByte(iOnCommand);
     }
     else
     {
         aPort.SendByte(iOffCommand);
     }
 }
Exemplo n.º 9
0
 public void SendCommand(BoxdorferSerial aPort)
 {
     if (Check)
     {
         aPort.SendByte(iOnCommand);
     }
     else
     {
         aPort.SendByte(iOffCommand);
     }
 }
Exemplo n.º 10
0
 public void SendCommand(BoxdorferSerial aPort)
 {
     if (isWriting)
     {
         aPort.SendLong(iValue);
         aPort.SendByte(iSendCommand);
         count = 4;
     }
     else
     {
         aPort.SendByte(iReceiveCommand);
         count  = 0;
         iValue = 0;
     }
 }
Exemplo n.º 11
0
 public void SendCommand(BoxdorferSerial aPort)
 {
     aPort.SendByte(iCmd);
 }
Exemplo n.º 12
0
 /**
  * @brief
  * Send the command to the controler
  *
  * @param theChannel
  * The serial connection to the controler
  */
 public void Send(BoxdorferSerial theChannel)
 {
     theChannel.AddCommand(this);
 }
Exemplo n.º 13
0
 /**
  * @brief
  * Send the command to the controler
  *
  * @param theChannel
  * The serial connection to the controler
  */
 public void Send(BoxdorferSerial theChannel)
 {
     theChannel.AddCommand(this);
 }
Exemplo n.º 14
0
 public void SendCommand(BoxdorferSerial aPort)
 {
     aPort.SendByte(iCmd);
 }
Exemplo n.º 15
0
 public void Read(BoxdorferSerial theChannel)
 {
     // Do nothing
 }
Exemplo n.º 16
0
 public void Read(BoxdorferSerial theChannel)
 {
     // Do nothing
 }
Exemplo n.º 17
0
 public void SendCommand(BoxdorferSerial aPort)
 {
     if (isWriting)
     {
         aPort.SendLong(iValue);
         aPort.SendByte(iSendCommand);
         count = 4;
     }
     else
     {
         aPort.SendByte(iReceiveCommand);
         count = 0;
         iValue = 0;
     }
 }