Пример #1
0
        private bool RequestTransferSize()
        {
            InvokeWriteStateLbl("Querying");
            InvokeSwitchProgressBarMode(ProgressBarStyle.Marquee);
            InvokeWriteLogString("Preparing...\r\n");
            bool result = false;



            var sizeBytes = BitConverter.GetBytes(fw_bytes.Length);

            byte[] bytes = new byte[5];
            bytes[0] = 0x31;
            bytes[1] = sizeBytes[0];
            bytes[2] = sizeBytes[1];
            bytes[3] = sizeBytes[2];
            bytes[4] = sizeBytes[3];



            try
            {
                nmeaPort.SendRaw(bytes);

                Thread.Sleep(500);
                result = true;
                timer.Start();
            }
            catch (Exception ex)
            {
                ProcessException(ex, false);
            }

            return(result);
        }
Пример #2
0
 private void Send(byte[] data)
 {
     try
     {
         port.SendRaw(data);
         if (!isServiceTab)
         {
             bytesSent += data.Length;
         }
         InvokeAppendText(commLogTxb, logger.Write(string.Format("<< {0}", Utils.ToSafeString(data))));
     }
     catch (Exception ex)
     {
         InvokeAppendText(commLogTxb, logger.Write(ex));
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #3
0
 public void RawDataSend(byte[] data)
 {
     port.SendRaw(data);
 }