Function anj_coap_downloader_suspend
Defined in File coap_downloader.h
Function Documentation
-
int anj_coap_downloader_suspend(anj_coap_downloader_t *coap_downloader)
Suspends the download operation and retains its progress in the current downloader instance. The operation can later be continued using anj_coap_downloader_resume.
Only a download that has already been started and is not being finalized can be suspended. This includes the time before data transfer begins and periods spent waiting for another attempt, as well as active data transfer. It cannot be used after the download has ended. anj_coap_downloader_step must be called after this function to complete exchange and connection cleanup.
- Parameters:
coap_downloader – CoAP downloader state.
- Returns:
0 on success, or ANJ_COAP_DOWNLOADER_ERR_INVALID_STATE if the operation cannot be suspended in its current state.