5.9.4.4 File Read HIF Callback
typedef void (*tpfFileReadCb)
(
uint8 u8Status,
void *pBuff,
uint32 u32Size
);
The callback is only executed after a file read via HIF messages and it receives three
arguments.
- The first argument is the status of the read, if the read is unsuccessful, then the other arguments will have irrelevant values.
- The second argument is a pointer to the buffer of data read.
- The third argument is size, which indicates the amount of data read and therefore contained in the buffer (maximum 128 bytes).
Specifying large amounts of data to be read via the HIF may exceed the
buffer maximum size (128 bytes), therefore it is recommended to use
u32Size
to offset a second read from within this callback. This
requires the application to track the total size of the file and the amount of bytes
read, requesting the reading of each section at a time until the end of the file is
reached.