From d84bd877e124ae02684d2f2b6a5a0a5eafd140e2 Mon Sep 17 00:00:00 2001 From: Sander Speetjens Date: Mon, 6 Nov 2023 21:38:19 +0100 Subject: [PATCH] TFTP Add initial framework, not doing anything at the moment --- project/Core/Inc/tftp.h | 12 ++++++++++++ project/Core/Src/tftp.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 project/Core/Inc/tftp.h create mode 100644 project/Core/Src/tftp.c diff --git a/project/Core/Inc/tftp.h b/project/Core/Inc/tftp.h new file mode 100644 index 0000000..3ff4cbb --- /dev/null +++ b/project/Core/Inc/tftp.h @@ -0,0 +1,12 @@ +// +// Created by sanderspeetjens on 06/11/23. +// + +#ifndef PROJECT_TFTP_H +#define PROJECT_TFTP_H +#include + +extern struct tftp_context tftpContext_s; + +void tftp_server_init(void); +#endif //PROJECT_TFTP_H diff --git a/project/Core/Src/tftp.c b/project/Core/Src/tftp.c new file mode 100644 index 0000000..8c880c4 --- /dev/null +++ b/project/Core/Src/tftp.c @@ -0,0 +1,37 @@ +// +// Created by sanderspeetjens on 06/11/23. +// + +#include "tftp.h" + +void *tftp_open(const char *fname, const char *mode, u8_t write) +{ + +} + +void tftp_close(void *handle) +{ + +} +int tftp_read(void* handle, void* buf, int bytes) +{ + +} + +int tftp_write(void* handle, struct pbuf* p) +{ + +} + +struct tftp_context tftpContext_s = + { + tftp_open, + tftp_close, + tftp_read, + tftp_write + }; + +void tftp_server_init(void) +{ + tftp_init(&tftpContext_s); +} \ No newline at end of file