OTA: Add TFTP client mode, expand ota_basic example.

This commit is contained in:
Angus Gratton 2016-03-23 17:33:08 +11:00
parent a3956af4ca
commit e671927bd0
3 changed files with 162 additions and 6 deletions

View file

@ -1,5 +1,8 @@
#ifndef _OTA_TFTP_H
#define _OTA_TFTP_H
#include "lwip/err.h"
/* TFTP Server OTA Support
*
* To use, call ota_tftp_init_server() which will start the TFTP server task
@ -30,6 +33,17 @@
*/
void ota_tftp_init_server(int listen_port);
/* Attempt to make a TFTP client connection and download the specified filename.
'timeout' is in milliseconds, and is timeout for any UDP exchange
_not_ the entire download.
Returns 0 on success, LWIP err.h values for errors.
Does not change the current firmware slot, or reboot.
*/
err_t ota_tftp_download(const char *server, int port, const char *filename, int timeout, int ota_slot);
#define TFTP_PORT 69
#endif