5.9.4.3 OTA File Read HIF

NMI_API sint8 m2m_ota_host_file_read_hif
(
uint8            u8Handler,
uint32            u32Offset,
uint32            u32Size,
tpfFileReadCb        pfHFDReadCb
);

When the download completes, the file is stored in the WINC’s Flash. This API can be used to read the file from the WINC using HIF messages. It is mandatory to have a valid handler, not having one could mean that the file has been invalidated and therefore it must be unavailable for any operation. This protects read against invalid or corrupted data.

The offset marks the position in bytes of Flash to read from, counting from the beginning of the file. Therefore, an offset of zero is translated as reading from the beginning of the file. Size specifies the amount of bytes to read, starting at the offset defined. The last argument is the callback to be executed when the read is complete.

Advantages (vs SPI read)
  • While reading a file using HIF messages, the host can continue operation, being notified by an interrupt from the WINC when data read is complete.
  • Does not require the WINC to be reset after the read is complete.
Disadvantages (vs SPI read)
  • File reads via HIF are slightly slower than reads via SPI.