nRF Connect SDK API 2.8.99
|
#include <include/net/download_client.h>
Download client event IDs.
Enumerator | |
---|---|
DOWNLOAD_CLIENT_EVT_FRAGMENT | Event contains a fragment. The application may return any non-zero value to stop the download. |
DOWNLOAD_CLIENT_EVT_ERROR | An error has occurred during download and the connection to the server has been lost. Error reason may be one of the following:
In case of errors on the socket during send() or recv() (ECONNRESET), returning zero from the callback will let the library attempt to reconnect to the server and download the last fragment again. Otherwise, the application may return any non-zero value to stop the download. On any other error code than ECONNRESET, the client will not attempt to reconnect and ignores the return value. In case the download is stopped, and it was started using download_client_get, the download client automatically closes the connection. The application should wait for DOWNLOAD_CLIENT_EVT_CLOSED before attempting another download. If download is stopped, and it was started using download_client_start the application should manually disconnect (download_client_disconnect) to clean up the network socket and wait for DOWNLOAD_CLIENT_EVT_CLOSED before attempting another download. |
DOWNLOAD_CLIENT_EVT_DONE | Download complete. |
DOWNLOAD_CLIENT_EVT_CLOSED | Connection have been closed. Client is now idle, ready for next download |