TFTP code writing begin..

This commit is contained in:
maxxir_w
2019-03-25 16:03:01 +04:00
parent 9b6d202c27
commit 53ddb72960
4 changed files with 28 additions and 4 deletions

View File

@@ -20,6 +20,14 @@
/* Extern Functions ---------------------------------------------*/
#ifdef F_STORAGE
extern void save_data(uint8_t *data, uint32_t data_len, uint16_t block_number);
void save_data(uint8_t *data, uint32_t data_len, uint16_t block_number)
{
//Nothing to do with received data yet..
//TODO: Add your own handler here
//Print out data as string
PRINTF("Data #%d-%lu:\r\n%s\r\n", block_number, data_len, data);
}
#endif
/* Global Variable ----------------------------------------------*/

View File

@@ -19,6 +19,13 @@ extern "C" {
#define F_STORAGE // If your target support a storage, you have to activate this feature and implement.
#if defined(F_STORAGE)
#include "ff.h"
FIL fil; // FatFs File objects
FRESULT fr; // FatFs function common result code
#endif
#define SOCK_TFTP 2
#define INFO_DBG 0x01