Inheritance: BootloaderResponse
コード例 #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);
        }
コード例 #2
0
ファイル: FreebooterHost.cs プロジェクト: arachnidlabs/loki
 protected void SendData(byte[] data)
 {
     SendDataCommand cmd = new SendDataCommand(_checksumType, data);
     EmptyResponse response = new EmptyResponse();
     SendCommand(cmd, response);
 }
コード例 #3
0
ファイル: FreebooterHost.cs プロジェクト: arachnidlabs/loki
 public void SyncBootloader()
 {
     SyncBootloaderCommand cmd = new SyncBootloaderCommand(_checksumType);
     EmptyResponse response = new EmptyResponse();
     SendCommand(cmd, response);
 }
コード例 #4
0
ファイル: FreebooterHost.cs プロジェクト: arachnidlabs/loki
        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);
        }
コード例 #5
0
ファイル: FreebooterHost.cs プロジェクト: arachnidlabs/loki
 public void EraseRow(int flashArrayId, int rowNumber)
 {
     EraseRowCommand cmd = new EraseRowCommand(_checksumType, (byte)flashArrayId, (ushort)rowNumber);
     EmptyResponse response = new EmptyResponse();
     SendCommand(cmd, response);
 }