From 73f9228afeba704a3907986d468f4bf34d2ab8e5 Mon Sep 17 00:00:00 2001 From: Sander Speetjens Date: Thu, 9 Nov 2023 16:55:30 +0100 Subject: [PATCH] TFTP Add doc to writ function --- project/Core/Src/tftp.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/project/Core/Src/tftp.c b/project/Core/Src/tftp.c index 1cc52dd..61ba699 100644 --- a/project/Core/Src/tftp.c +++ b/project/Core/Src/tftp.c @@ -57,9 +57,9 @@ void tftp_close(void* handle) { * then the file is trying to get read from the llfs * * @param handle File handle returned by open() - * @param buf Target buffer to copy read data to - * @param bytes Number of bytes to copy to buf - * @return int >= 0: Success; < 0: Error + * @param buf Target buffer to copy read data to + * @param bytes Number of bytes to copy to buf + * @return int >= 0: Success; < 0: Error */ int tftp_read(void* handle, void* buf, int bytes) { LOG_INFO(TAG, "reading file"); @@ -86,6 +86,14 @@ int tftp_read(void* handle, void* buf, int bytes) { return 0; } +/** + * @brief This function is called when a file is written + * + * @param handle File handle returned by open() + * @param p PBUF adjusted such that payload pointer points to the beginning of write data. + * In other words, TFTP headers are stripped off. + * @return int >= 0: Success; < 0: Error + */ int tftp_write(void* handle, struct pbuf* p) { LOG_INFO(TAG, "Writing file"); LOG_DEBUG(TAG, "Not implemented yet");