net: lib: ftp_client: Add FTP client library #104316
net: lib: ftp_client: Add FTP client library #104316aescolar merged 3 commits intozephyrproject-rtos:mainfrom
Conversation
3ee8014 to
44c74ef
Compare
d1887bc to
f75671d
Compare
include/zephyr/net/ftp_client.h
Outdated
| FTP_CODE_110 = 110, | ||
| /** Service ready in nnn minutes */ | ||
| FTP_CODE_120 = 120, | ||
| /** Data connection already open; transfer starting */ | ||
| FTP_CODE_125 = 125, | ||
| /** File status okay; about to open data connection */ | ||
| FTP_CODE_150 = 150, |
There was a problem hiding this comment.
TBH, I don't see the benefit of using FTP_CODE_XXX instead of using XXX directly. I'd prefer to have some actual code names.
There was a problem hiding this comment.
I can update the names, something like FTP_CODE_150_FILE_STATUS_OK etc. would work, or do you think we should drop the number from the name entirely?
There was a problem hiding this comment.
I'd like to have descriptive names, both with or without number is fine for me.
|
@rlubos do you plan to fix those sonarqube warnings like |
Yes, I have them fixed locally already (at least I hope so), will push soon. However, I must admit I am pretty confused with the |
The issue lies here: #if defined(CONFIG_FTP_CLIENT)
#define FTP_BUFFER_SIZE CONFIG_FTP_CLIENT_BUF_SIZE
#else
#define FTP_BUFFER_SIZE 0
#endifSo |
Ah, thanks for the tip! Maybe just changing 0 to 1 will be enough then. I'll try that |
Add FTP client library, based on the FTP client library from nRF Connect SDK. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add FTP shell module covering basic FTP client operations. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add a minimal FTP client sample, exposing FTP operations via network shell. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
f75671d to
8a958dc
Compare
|
In latest push:
|
|
| break; | ||
| } | ||
|
|
||
| if (client->ctrl_len >= sizeof(client->ctrl_buf) - 1) { |
There was a problem hiding this comment.
Can you also handle this line in the case where CONFIG_FTP_CLIENT is not set? Also, if CONFIG_FTP_CLIENT is not set, why is this being tested/included? Sounds unreal scenario.
There was a problem hiding this comment.
But this whole file won't even be compiled if CONFIG_FTP_CLIENT is unset. Other thing is the header file, which may be included unconditionally (like in the shell module introduced in other commit), so we need those safeguards for undefined symbols.
I guess sonarqube just don't understand CMake/Kconfig dependencies, hence it assumes the file could be compiled anyway...
sylvioalves
left a comment
There was a problem hiding this comment.
@rlubos I forgot to ask. Should it have some kind of test case or only the sample would be enough?
For the initial release I've only considered the sample, as verifying FTP in ztest would be tricky w/o a FTP server to test against. |



Add FTP client library, based on Nordic's FTP client library from NCS, along with FTP shell module and a minimal sample.