Files
2023-Webservices_And_Applic…/project/Core/Inc/tftp.h
Sander Speetjens 623cf3749c TFTP
Add tftp_custom_write and test functions
2023-11-13 16:03:14 +01:00

43 lines
845 B
C

/**
* @file tftp.h
* @brief tftp server
* @author Sander S.
*/
#ifndef PROJECT_TFTP_H
#define PROJECT_TFTP_H
#include <tftp_server.h>
#ifndef TESTING
#include "lcd_api.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define LOGGER_LEVEL_ALL
#include "log.h"
#include "llfs.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define TFTP_READ 0
typedef struct tftp_custom_file_s {
char* data;
size_t len;
char*name;
size_t ofset;
}tftp_custom_file_t;
void tftp_server_init(void);
void tftp_server_deinit(void);
void tftp_custom_fseek(tftp_custom_file_t* handle, size_t offset, int whence);
size_t tftp_custom_fread(void* buf, size_t bytes, tftp_custom_file_t* handle);
size_t tftp_custom_fwrite(const void* buf, size_t bytes, tftp_custom_file_t* handle);
#ifdef __cplusplus
}
#endif
#endif // PROJECT_TFTP_H