diff --git a/Components/Network/Interface/FTP_Client_FS.c b/Components/Network/Interface/FTP_Client_FS.c index e422746b..0df8b7e6 100644 --- a/Components/Network/Interface/FTP_Client_FS.c +++ b/Components/Network/Interface/FTP_Client_FS.c @@ -10,21 +10,21 @@ #include "rl_net.h" // Open local file for reading or writing in FTP client. -__WEAK void *netFTPc_fopen (const char *fname, const char *mode) { +void *netFTPc_fopen (const char *fname, const char *mode) { return (fopen (fname, mode)); } // Close local file previously open in FTP client. -__WEAK void netFTPc_fclose (void *file) { +void netFTPc_fclose (void *file) { fclose (file); } // Read block of data from local file in FTP client. -__WEAK uint32_t netFTPc_fread (void *file, uint8_t *buf, uint32_t len) { +uint32_t netFTPc_fread (void *file, uint8_t *buf, uint32_t len) { return (fread (buf, 1, len, file)); } // Write block of data to local file in FTP client. -__WEAK uint32_t netFTPc_fwrite (void *file, const uint8_t *buf, uint32_t len) { +uint32_t netFTPc_fwrite (void *file, const uint8_t *buf, uint32_t len) { return (fwrite (buf, 1, len, file)); } diff --git a/Components/Network/Interface/FTP_Server_FS.c b/Components/Network/Interface/FTP_Server_FS.c index 97ee1403..fb794fbf 100644 --- a/Components/Network/Interface/FTP_Server_FS.c +++ b/Components/Network/Interface/FTP_Server_FS.c @@ -9,18 +9,14 @@ #include #include #include "rl_net.h" - -#ifdef RTE_FileSystem_Core #include "rl_fs.h" -static fsFileInfo info; - #ifndef NET_FTP_SERVER_VBUF_SIZE #define NET_FTP_SERVER_VBUF_SIZE 0 #endif // Open a file for reading or writing on FTP server. -__WEAK void *netFTPs_fopen (const char *fname, const char *mode) { +void *netFTPs_fopen (const char *fname, const char *mode) { FILE *f = fopen (fname, mode); #if (NET_FTP_SERVER_VBUF_SIZE > 512) if (f != NULL) { @@ -31,22 +27,22 @@ __WEAK void *netFTPs_fopen (const char *fname, const char *mode) { } // Close a file previously open on FTP server. -__WEAK void netFTPs_fclose (void *file) { +void netFTPs_fclose (void *file) { fclose (file); } // Read block of data from a file on FTP server. -__WEAK uint32_t netFTPs_fread (void *file, uint8_t *buf, uint32_t len) { +uint32_t netFTPs_fread (void *file, uint8_t *buf, uint32_t len) { return (fread (buf, 1, len, file)); } // Write block of data to a file on FTP server. -__WEAK uint32_t netFTPs_fwrite (void *file, const uint8_t *buf, uint32_t len) { +uint32_t netFTPs_fwrite (void *file, const uint8_t *buf, uint32_t len) { return (fwrite (buf, 1, len, file)); } // Delete a file on FTP server. -__WEAK bool netFTPs_fdelete (const char *fname) { +bool netFTPs_fdelete (const char *fname) { if (fdelete (fname, NULL) == fsOK) { return (true); } @@ -54,7 +50,7 @@ __WEAK bool netFTPs_fdelete (const char *fname) { } // Rename a file or directory on FTP server. -__WEAK bool netFTPs_frename (const char *fname, const char *newname) { +bool netFTPs_frename (const char *fname, const char *newname) { if (frename (fname, newname) == fsOK) { return (true); } @@ -62,7 +58,7 @@ __WEAK bool netFTPs_frename (const char *fname, const char *newname) { } // Make a new directory on FTP server. -__WEAK bool netFTPs_mkdir (const char *path) { +bool netFTPs_mkdir (const char *path) { if (fmkdir (path) == fsOK) { return (true); } @@ -70,7 +66,7 @@ __WEAK bool netFTPs_mkdir (const char *path) { } // Remove an empty directory on FTP server. -__WEAK bool netFTPs_rmdir (const char *path) { +bool netFTPs_rmdir (const char *path) { if (frmdir (path, NULL) == fsOK) { return (true); } @@ -78,7 +74,7 @@ __WEAK bool netFTPs_rmdir (const char *path) { } // Verify that the directory path exists on FTP server. -__WEAK bool netFTPs_chdir (const char *path) { +bool netFTPs_chdir (const char *path) { if (fchdir (path) == fsOK) { return (true); } @@ -86,8 +82,10 @@ __WEAK bool netFTPs_chdir (const char *path) { } // Search the file system directory for matching files. -__WEAK int32_t netFTPs_ffind (const char *mask, char *fname, - uint32_t *fsize, NET_FS_TIME *ftime, bool first) { +int32_t netFTPs_ffind (const char *mask, char *fname, + uint32_t *fsize, NET_FS_TIME *ftime, bool first) { + static fsFileInfo info; + if (first) { /* First call, initialize the info. */ info.fileID = 0; @@ -114,4 +112,3 @@ __WEAK int32_t netFTPs_ffind (const char *mask, char *fname, } return (0); } -#endif diff --git a/Components/Network/Interface/HTTP_Server_FS.c b/Components/Network/Interface/HTTP_Server_FS.c index 31aba06a..174cb734 100644 --- a/Components/Network/Interface/HTTP_Server_FS.c +++ b/Components/Network/Interface/HTTP_Server_FS.c @@ -10,42 +10,36 @@ #include "../Source/net_lib.h" #include "rl_fs.h" -#ifdef __clang__ - #pragma clang diagnostic ignored "-Wcast-align" -#endif - // Open a file for reading on HTTP server. -__WEAK void *netHTTPs_fopen (const char *fname) { +void *netHTTPs_fopen (const char *fname) { return (fopen (fname, "r")); } // Close a file previously open on HTTP server. -__WEAK void netHTTPs_fclose (void *file) { +void netHTTPs_fclose (void *file) { fclose (file); } // Read block of data from a file on HTTP server. -__WEAK uint32_t netHTTPs_fread (void *file, uint8_t *buf, uint32_t len) { +uint32_t netHTTPs_fread (void *file, uint8_t *buf, uint32_t len) { return (fread (buf, 1, len, file)); } // Read a string from a file on HTTP server. -__WEAK char *netHTTPs_fgets (void *file, char *buf, uint32_t size) { +char *netHTTPs_fgets (void *file, char *buf, uint32_t size) { return (fgets (buf, (int32_t)size, file)); } // Retrieve size and last modification time of a file. -__WEAK void netHTTPs_fstat (const char *fname, uint32_t *fsize, uint32_t *ftime) { - fsFileInfo *info; +void netHTTPs_fstat (const char *fname, uint32_t *fsize, uint32_t *ftime) { + static fsFileInfo info; - info = (fsFileInfo *)net_mem_alloc (sizeof (fsFileInfo)); - info->fileID = 0; - if (ffind (fname, info) == fsOK) { + info.fileID = 0; + if (ffind (fname, &info) == fsOK) { // File found, return size - *fsize = info->size; + *fsize = info.size; // Convert creation time to UTC format. - *ftime = net_http_time (info->time.hr, info->time.min, info->time.sec, - info->time.day, info->time.mon, info->time.year); + *ftime = net_http_time (info.time.hr, info.time.min, info.time.sec, + info.time.day, info.time.mon, info.time.year); } - net_mem_free ((NET_FRAME *)info); } diff --git a/Components/Network/Interface/SMTP_Client_FS.c b/Components/Network/Interface/SMTP_Client_FS.c index 83bb1667..a7db83ce 100644 --- a/Components/Network/Interface/SMTP_Client_FS.c +++ b/Components/Network/Interface/SMTP_Client_FS.c @@ -10,16 +10,16 @@ #include "rl_net.h" // Open a file for reading in SMTP client. -__WEAK void *netSMTPc_fopen (const char *fname) { +void *netSMTPc_fopen (const char *fname) { return (fopen (fname, "r")); } // Close a file previously open in SMTP client. -__WEAK void netSMTPc_fclose (void *file) { +void netSMTPc_fclose (void *file) { fclose (file); } // Read block of data from a file in SMTP client. -__WEAK uint32_t netSMTPc_fread (void *file, uint8_t *buf, uint32_t len) { +uint32_t netSMTPc_fread (void *file, uint8_t *buf, uint32_t len) { return (fread (buf, 1, len, file)); } diff --git a/Components/Network/Interface/TFTP_Client_FS.c b/Components/Network/Interface/TFTP_Client_FS.c index 2ee183b3..155b250f 100644 --- a/Components/Network/Interface/TFTP_Client_FS.c +++ b/Components/Network/Interface/TFTP_Client_FS.c @@ -10,21 +10,21 @@ #include "rl_net.h" // Open local file for reading or writing in TFTP client. -__WEAK void *netTFTPc_fopen (const char *fname, const char *mode) { +void *netTFTPc_fopen (const char *fname, const char *mode) { return (fopen (fname, mode)); } // Close local file previously open in TFTP client. -__WEAK void netTFTPc_fclose (void *file) { +void netTFTPc_fclose (void *file) { fclose (file); } // Read block of data from local file in TFTP client. -__WEAK uint32_t netTFTPc_fread (void *file, uint8_t *buf, uint32_t len) { +uint32_t netTFTPc_fread (void *file, uint8_t *buf, uint32_t len) { return (fread (buf, 1, len, file)); } // Write block of data to local file in TFTP client. -__WEAK uint32_t netTFTPc_fwrite (void *file, const uint8_t *buf, uint32_t len) { +uint32_t netTFTPc_fwrite (void *file, const uint8_t *buf, uint32_t len) { return (fwrite (buf, 1, len, file)); } diff --git a/Components/Network/Interface/TFTP_Server_FS.c b/Components/Network/Interface/TFTP_Server_FS.c index c1a22dd3..2121d874 100644 --- a/Components/Network/Interface/TFTP_Server_FS.c +++ b/Components/Network/Interface/TFTP_Server_FS.c @@ -10,21 +10,21 @@ #include "rl_net.h" // Open a file for reading or writing on TFTP server. -__WEAK void *netTFTPs_fopen (const char *fname, const char *mode) { +void *netTFTPs_fopen (const char *fname, const char *mode) { return (fopen (fname, mode)); } // Close a file previously open on TFTP server. -__WEAK void netTFTPs_fclose (void *file) { +void netTFTPs_fclose (void *file) { fclose (file); } // Read block of data from a file on TFTP server. -__WEAK uint32_t netTFTPs_fread (void *file, uint8_t *buf, uint32_t len) { +uint32_t netTFTPs_fread (void *file, uint8_t *buf, uint32_t len) { return (fread (buf, 1, len, file)); } // Write block of data to a file on TFTP server. -__WEAK uint32_t netTFTPs_fwrite (void *file, const uint8_t *buf, uint32_t len) { +uint32_t netTFTPs_fwrite (void *file, const uint8_t *buf, uint32_t len) { return (fwrite (buf, 1, len, file)); } diff --git a/Components/Network/Source/net_rtos2.h b/Components/Network/Source/net_rtos2.h index 2bad7522..83bbf44c 100644 --- a/Components/Network/Source/net_rtos2.h +++ b/Components/Network/Source/net_rtos2.h @@ -9,12 +9,6 @@ #include "cmsis_os2.h" #include "net_lib.h" -/* Avoid syntax-checker errors in editor */ -#ifndef NET_THREAD_STACK_SIZE - #define NET_THREAD_STACK_SIZE 1024 - #define NET_THREAD_PRIORITY osPriorityNormal -#endif - /* Network core resources */ #ifdef RTE_CMSIS_RTOS2_RTX5 #include "rtx_os.h" diff --git a/Documentation/Doxygen/Network/src/ref_net_services.txt b/Documentation/Doxygen/Network/src/ref_net_services.txt index d5eed534..7d6687c4 100644 --- a/Documentation/Doxygen/Network/src/ref_net_services.txt +++ b/Documentation/Doxygen/Network/src/ref_net_services.txt @@ -759,10 +759,10 @@ enable a list of users, you need to adapt the following functions that are inclu \ingroup netHTTP_Func \brief HTTP server functions that work with a File System. \details -All File System Interface functions are located in \b %HTTP_Server_FS.c, which will be automatically added to your project's -\b Network folder. The file is preconfigured for the \url{MW-FileSystem}, so no modifications are -required. If you wish to use another type of file system, you need to override these weak procedures with your required -functionality. +All functions of the File System Interface are located in \b HTTP_Server_FS.c, which is automatically added to the +\b Network folder of your project. The file is preconfigured for the \url{MW-FileSystem}, so no changes are required. +If you want to use a different type of file system, you must add a similar file to your project and implement +the interface functions yourself. The following functions are implemented in this module: - \ref netHTTPs_fopen - open a file for reading or writing. @@ -1218,10 +1218,10 @@ The Network Component's FTP server supports only a subset of standard FTP comman \brief FTP server functions that work with a File System. \details -All File System Interface functions are located in \b %FTP_Server_FS.c, which will be automatically added to your project's -\b Network folder. The file is preconfigured for the \url{MW-FileSystem} component, so no modifications are -required. If you wish to use another type of file system, you need to override these weak procedures with your required -functionality. +All functions of the File System Interface are located in \b FTP_Server_FS.c, which is automatically added to the +\b Network folder of your project. The file is preconfigured for the \url{MW-FileSystem}, so no changes are required. +If you want to use a different type of file system, you must add a similar file to your project and implement +the interface functions yourself. The following functions are implemented in this module: - \ref netFTPs_fopen - open a file for reading or writing. @@ -1338,9 +1338,10 @@ the file \b %FTP_Client_UIF.c module as well. You need to adapt the function to \ingroup netFTPc_Func \brief FTP client functions that work with a File System. \details -All File System Interface functions are located in \b %FTP_Client_FS.c, which will be automatically added to your project's -\b Network folder. The file is preconfigured for the File System Component, so no modifications are required. -If you wish to use another type of file system, you need to add a similar file to your project. +All functions of the File System Interface are located in \b FTP_Client_FS.c, which is automatically added to the +\b Network folder of your project. The file is preconfigured for the \url{MW-FileSystem}, so no changes are required. +If you want to use a different type of file system, you must add a similar file to your project and implement +the interface functions yourself. The following functions are implemented in this module: - \ref netFTPc_fopen - open a file for reading or writing. @@ -1444,10 +1445,10 @@ access. \ingroup netTFTPs_Func \brief TFTP server functions that work with a File System. \details -All File System Interface functions are located in \b %TFTP_Server_FS.c, which will be automatically added to your project's -\b Network folder. The file is preconfigured for the \url{MW-FileSystem} component, so no modifications are -required. If you wish to use another type of file system, you need to override these weak procedures with your required -functionality. +All functions of the File System Interface are located in \b TFTP_Server_FS.c, which is automatically added to the +\b Network folder of your project. The file is preconfigured for the \url{MW-FileSystem}, so no changes are required. +If you want to use a different type of file system, you must add a similar file to your project and implement +the interface functions yourself. The following functions are implemented in this module: - \ref netTFTPs_fopen - open a file for reading or writing. @@ -1532,10 +1533,10 @@ and scroll in the template files list until you find the TFTP Client User Int \ingroup netTFTPc_Func \brief TFTP client functions that work with a File System. \details -All File System Interface functions are located in \b %TFTP_Client_FS.c, which will be automatically added to your project's -\b Network folder. The file is preconfigured for the File System Component, so no modifications are required. -If you wish to use another type of file system or to use a different storage media such as a hard disk, you need to add a -similar file to your project. +All functions of the File System Interface are located in \b TFTP_Client_FS.c, which is automatically added to the +\b Network folder of your project. The file is preconfigured for the \url{MW-FileSystem}, so no changes are required. +If you want to use a different type of file system, you must add a similar file to your project and implement +the interface functions yourself. The following functions are implemented in this module: - \ref netTFTPc_fopen - open a file for reading or writing. @@ -2409,9 +2410,10 @@ The following functions are available: \ingroup netSMTPc_Func \brief SMTP client functions that work with a File System. \details -All File System Interface functions are located in \b %SMTP_Client_FS.c, which will be automatically added to your project's -\b Network folder. The file is preconfigured for the File System Component, so no modifications are required. -If you wish to use another type of file system, you need to add a similar file to your project. +All functions of the File System Interface are located in \b SMTP_Client_FS.c, which is automatically added to the +\b Network folder of your project. The file is preconfigured for the \url{MW-FileSystem}, so no changes are required. +If you want to use a different type of file system, you must add a similar file to your project and implement +the interface functions yourself. The following functions are implemented in this module: - \ref netSMTPc_fopen - open a file for reading. diff --git a/Keil.MDK-Middleware.pdsc b/Keil.MDK-Middleware.pdsc index c8827a0f..a54c121a 100644 --- a/Keil.MDK-Middleware.pdsc +++ b/Keil.MDK-Middleware.pdsc @@ -982,7 +982,7 @@ - + @@ -1007,7 +1007,7 @@ - + @@ -1044,7 +1044,7 @@ - + @@ -1059,7 +1059,7 @@ - + @@ -1074,7 +1074,7 @@ - + @@ -1091,7 +1091,7 @@ - + @@ -1120,7 +1120,7 @@ - + @@ -1139,7 +1139,7 @@ - +