Exemplo n.º 1
0
        /// <summary>
        /// Send a BREAK and stop pinging.
        /// </summary>
        private void StopPinging()
        {
            _adcpSerialPort.StopPinging();

            // Wait for an output
            Thread.Sleep(RTI.AdcpSerialPort.WAIT_STATE * 4);

            DispalyStatus("Stop ADCP Pinging");
        }
Exemplo n.º 2
0
 /// <summary>
 /// Start pinging.
 /// </summary>
 public void StopPinging()
 {
     if (_serialPort != null && _serialPort.IsAvailable())
     {
         Task.Run(() => _serialPort.StopPinging());
     }
     else
     {
         DisplayConnectionError();
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Execute the upload process.  This should be called
        /// from the async command.
        /// </summary>
        /// <param name="fileName">File name to upload.</param>
        private void ExecuteUpdateFirmware(object fileName)
        {
            // Convert the object to a string array
            var files = fileName as string[];

            if (files != null)
            {
                // Stop the ADCP pinging if its pinging
                AdcpSerialPort.StopPinging();

                // Upload all the selected files
                foreach (var file in files)
                {
                    // Upload the file to the ADCP
                    AdcpSerialPort.XModemUpload(file);

                    // Wait for the update to complete
                    Thread.Sleep(AdcpSerialPort.WAIT_STATE * 2);

                    // Load the firmware to NAND
                    if (file.ToLower().Contains("rtisys"))
                    {
                        AdcpSerialPort.SendDataWaitReply("FMCOPYS");
                    }

                    // Load the boot code to NAND
                    if (file.ToLower().Contains("boot"))
                    {
                        AdcpSerialPort.SendDataWaitReply("FMCOPYB");
                    }
                }


                // Reboot the ADCP to use the new firmware
                AdcpSerialPort.Reboot();

                // Validate the files uploaded
                // By downloading it and compairing it against
                // the original file
            }
        }