5.9.4.6 OTA File Erase API

NMI_API sint8 m2m_ota_host_file_erase
(
uint8            u8Handler,
tpfFileEraseCb    pfHFDEraseCb
);
The File Erase API requires the following two arguments:
  • The first argument is a handler of the file to erase, to ensure that it is valid to perform a Flash erase.
  • The second argument is a callback which executes when the erase is complete.

Having a callback to tell the Application when the erase has been completed is useful to act as a trigger for a subsequent operation (example, download a second file).

Note: The file erase performs an erase of the entire host file partition and any file handler is destroyed regardless of the end result of the erase operation in the WINC. Since the data in the Flash is partially or completely destroyed, the handlers are invalidated when the process starts for safety.