Beispiel #1
0
        /// <summary>
        /// Send the specified binary file to the device through the serial port via xmodem (checksum).
        /// </summary>
        /// <param name="fileName">Name of the file to be sent</param>
        /// <param name="image">Bytes of the file to be sent</param>
        private void SendXmodem(String fileName, byte[] image)
        {
            myFileSender = new XmodemSender(fileName, image);
            SetStatusLabelText("Downloading " + fileName);

            myFileSender.eUpdateMessage    = debugMsg;
            myFileSender.eSendBytes        = SendData;
            myFileSender.eSendByte         = SendData;
            myFileSender.eFlush            = Flush;
            myFileSender.eTransferComplete = fileTransferComplete;
            myFileSender.SendFile();
        }
Beispiel #2
0
        /// <summary>
        /// Send the specified stewie file to the device through the serial port.
        /// </summary>
        /// <param name="fileName">Name of the file to be sent</param>
        /// <param name="image">Bytes of the file to be sent</param>
        /// <param name="c">Synchronization character</param>
        private void SendStewie(String fileName, byte[] image, char c)
        {
            myFileSender = new StewieFileSender(fileName, image, c);
            SetStatusLabelText("Downloading " + fileName);

            myFileSender.eUpdateMessage    = debugStewie;
            myFileSender.eSendBytes        = SendData;
            myFileSender.eSendByte         = SendData;
            myFileSender.eFlush            = Flush;
            myFileSender.eTransferComplete = fileTransferComplete;
            myFileSender.SendFile();
        }