← Back to the chapter · Next detail →
Technical detail · CoAP Advanced Features
Reconstruction and block sizing
CoAP block-wise transfer divides one resource representation, the data describing that resource, into numbered pieces for reassembly.
The block number is NUM; M is the more flag, set to 1 when more blocks follow and 0 for the final block. Legal decoded sizes are 16, 32, 64, 128, 256, 512 and 1024 bytes. The SZX field encodes a size exponent rather than a byte count. Place a block at NUM multiplied by its decoded size. Track covered byte ranges; appending arrivals is insufficient. Compare ETags when supplied: these identify representation versions, and a changed version must not be mixed into the previous image.