Add doc to writ function
This commit is contained in:
2023-11-09 16:55:30 +01:00
parent b2345b66a0
commit 73f9228afe

View File

@@ -57,9 +57,9 @@ void tftp_close(void* handle) {
* then the file is trying to get read from the llfs * then the file is trying to get read from the llfs
* *
* @param handle File handle returned by open() * @param handle File handle returned by open()
* @param buf Target buffer to copy read data to * @param buf Target buffer to copy read data to
* @param bytes Number of bytes to copy to buf * @param bytes Number of bytes to copy to buf
* @return int >= 0: Success; < 0: Error * @return int >= 0: Success; < 0: Error
*/ */
int tftp_read(void* handle, void* buf, int bytes) { int tftp_read(void* handle, void* buf, int bytes) {
LOG_INFO(TAG, "reading file"); LOG_INFO(TAG, "reading file");
@@ -86,6 +86,14 @@ int tftp_read(void* handle, void* buf, int bytes) {
return 0; 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) { int tftp_write(void* handle, struct pbuf* p) {
LOG_INFO(TAG, "Writing file"); LOG_INFO(TAG, "Writing file");
LOG_DEBUG(TAG, "Not implemented yet"); LOG_DEBUG(TAG, "Not implemented yet");