3.2.5.3 Write Chunk Command

During the Start Transfer Stage of the update, the host sends a series of WriteChunk commands to the client. These commands contain sequential chunks of data from the Client Update File as described in the File Chunking Details description.

3.2.5.3.1 Command Details

Write Chunk Command Details and Success Response Data Payload

Command Code

0x03

Command Data Payload

<N bytes of data from the Client Update File>

Successful Response Data Payload

None

       N

If NumberRemainingBytesInFile >= MaxCommandDataLength: N = MaxCommandDataLength

If NumberRemainingBytesInFile < MaxCommandDataLength: N = NumberRemainingBytesInFile

3.2.5.3.2 Command Response Pair Example

The following figure shows an example of a host using WriteChunk commands to divide a Client Update File into pieces that are sent to the client. This example breaks up the file into 4-byte chunks and sends them to the client. The number of bytes in each chunk is discovered from the client during the Discovery stage. The Client Buffer Info Parameter contains a MaxCommandDataLength field. The Client Update File is divided into MaxCommandDataLength size chunks and sent over to the client. If the last chunk isn’t exactly MaxCommandDataLength bytes long, the last chunk is simply equal in size to the number of bytes remaining in the Client Update File.

Figure 3-4. Command Response Pair Example
Figure Notes
Note 1:This example assumes the ClientBufferInfo parameter MaxCommandDataLength obtained during the discovery stage is 4 bytes and divides the file into 4-byte chunks for the WriteChunk commands.
Note 2:Since the last chunk of the Client Update File only contains 3 bytes, only 3 bytes of the file data are sent to the client in the last WriteChunk command.