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");