tftp client: pass 'mode' as an enum, not as a string constant

This commit is contained in:
Simon Goldschmidt
2018-10-17 21:37:46 +02:00
parent 4edbec760a
commit 0ee4784d0c
2 changed files with 31 additions and 6 deletions

View File

@@ -37,8 +37,14 @@
#include "lwip/apps/tftp_common.h"
enum tftp_transfer_mode {
TFTP_MODE_OCTET,
TFTP_MODE_NETASCII,
TFTP_MODE_BINARY /* used in old versions only */
};
err_t tftp_init_client(const struct tftp_context* ctx);
err_t tftp_get(void* handle, const ip_addr_t *addr, u16_t port, const char* fname, const char* mode);
err_t tftp_put(void* handle, const ip_addr_t *addr, u16_t port, const char* fname, const char* mode);
err_t tftp_get(void* handle, const ip_addr_t *addr, u16_t port, const char* fname, enum tftp_transfer_mode mode);
err_t tftp_put(void* handle, const ip_addr_t *addr, u16_t port, const char* fname, enum tftp_transfer_mode mode);
#endif /* LWIP_HDR_APPS_TFTP_CLIENT_H */