Inheritance: BootloaderResponse
Esempio n. 1
0
        public void ProgramRow(int flashArrayId, int rowNumber, byte[] data)
        {
            int i;
            int maxChunkSize = (int)_channel.MaxTransferSize - 11;

            byte[]        chunk    = new byte[maxChunkSize];
            EmptyResponse response = new EmptyResponse();

            // Break the data transfer up into pieces that aren't too large
            for (i = 0; i < data.Length - maxChunkSize; i += maxChunkSize)
            {
                Array.Copy(data, i, chunk, 0, maxChunkSize);
                SendDataCommand sd = new SendDataCommand(_checksumType, chunk);
                SendCommand(sd, response);
            }

            // Send the last chunk and the program command
            chunk = new byte[data.Length - i];
            Array.Copy(data, i, chunk, 0, data.Length - i);
            ProgramRowCommand cmd = new ProgramRowCommand(_checksumType, (byte)flashArrayId, (ushort)rowNumber, chunk);

            SendCommand(cmd, response);
        }
Esempio n. 2
0
 protected void SendData(byte[] data)
 {
     SendDataCommand cmd = new SendDataCommand(_checksumType, data);
     EmptyResponse response = new EmptyResponse();
     SendCommand(cmd, response);
 }
Esempio n. 3
0
 public void SyncBootloader()
 {
     SyncBootloaderCommand cmd = new SyncBootloaderCommand(_checksumType);
     EmptyResponse response = new EmptyResponse();
     SendCommand(cmd, response);
 }
Esempio n. 4
0
        public void ProgramRow(int flashArrayId, int rowNumber, byte[] data)
        {
            int i;
            int maxChunkSize = (int)_channel.MaxTransferSize - 11;
            byte[] chunk = new byte[maxChunkSize];
            EmptyResponse response = new EmptyResponse();

            // Break the data transfer up into pieces that aren't too large
            for (i = 0; i < data.Length - maxChunkSize; i += maxChunkSize)
            {
                Array.Copy(data, i, chunk, 0, maxChunkSize);
                SendDataCommand sd = new SendDataCommand(_checksumType, chunk);
                SendCommand(sd, response);
            }

            // Send the last chunk and the program command
            chunk = new byte[data.Length - i];
            Array.Copy(data, i, chunk, 0, data.Length - i);
            ProgramRowCommand cmd = new ProgramRowCommand(_checksumType, (byte)flashArrayId, (ushort)rowNumber, chunk);
            SendCommand(cmd, response);
        }
Esempio n. 5
0
 public void EraseRow(int flashArrayId, int rowNumber)
 {
     EraseRowCommand cmd = new EraseRowCommand(_checksumType, (byte)flashArrayId, (ushort)rowNumber);
     EmptyResponse response = new EmptyResponse();
     SendCommand(cmd, response);
 }