/**
 * @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

#ifndef UNUSED
#define UNUSED(x) (void)(x)
#endif

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
