ota_tftp_download takes an optional receive_cb that will report on the status of the TFTP transfer

This commit is contained in:
Kenshi Kawaguchi 2016-05-25 00:07:13 -07:00 committed by Angus Gratton
parent d62fd4899a
commit 84856f80a9
2 changed files with 19 additions and 6 deletions

View file

@ -3,6 +3,8 @@
#include "lwip/err.h"
typedef void (*tftp_receive_cb)(size_t bytes_received);
/* TFTP Server OTA Support
*
* To use, call ota_tftp_init_server() which will start the TFTP server task
@ -41,8 +43,12 @@ void ota_tftp_init_server(int listen_port);
Returns 0 on success, LWIP err.h values for errors.
Does not change the current firmware slot, or reboot.
receive_cb: called repeatedly after each successful packet that
has been written to flash and ACKed. Can pass NULL to omit.
*/
err_t ota_tftp_download(const char *server, int port, const char *filename, int timeout, int ota_slot);
err_t ota_tftp_download(const char *server, int port, const char *filename,
int timeout, int ota_slot, tftp_receive_cb receive_cb);
#define TFTP_PORT 69