-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nrfcloud coap: use downloader library #19908
Conversation
CI InformationTo view the history of this post, clich the 'edited' button above Inputs:Sources:sdk-nrf: PR head: 09b000c8cdaf47c17ac88e22b205d52c8da11329 more detailssdk-nrf:
Github labels
List of changed files detected by CI (20)
Outputs:ToolchainVersion: 342151af73 Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
You can find the documentation preview for this PR at this link. Note: This comment is automatically posted by the Documentation Publish GitHub Action. |
ff29a72
to
48a0dae
Compare
note: |
575a09a
to
c6ee5da
Compare
c6ee5da
to
2b2c4d8
Compare
2b2c4d8
to
f9b7ac7
Compare
44bc70a
to
41264ac
Compare
include/net/fota_download.h
Outdated
int fota_download_with_host_cfg(const char *host, const char *file, | ||
int sec_tag, uint8_t pdn_id, size_t fragment_size, | ||
const enum dfu_target_image_type expected_type, const struct downloader_host_cfg *host_cfg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should define a struct for the host config in fota_download.h
instead of reusing it from the downloader. On one hand it saves a struct definition and copy of fields when calling the downloader. On the other hand it makes it harder to get the overview of the interface. Now one has to navigate both this header, downloader.h
and dfu_target.h
to know what arguments to fill in. Perhaps this is a bigger task than what is in the scope of this PR.
Replace some magic numbers in downloader:coap with macros. This also makes it look more similar to the http transport code. Signed-off-by: Maximilian Deubel <[email protected]>
41264ac
to
cbe25ae
Compare
doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst
Outdated
Show resolved
Hide resolved
cbe25ae
to
1aae103
Compare
doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst
Outdated
Show resolved
Hide resolved
1aae103
to
13eb271
Compare
doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst
Outdated
Show resolved
Hide resolved
fc60568
to
920fc62
Compare
920fc62
to
f3fa476
Compare
include/net/fota_download.h
Outdated
@@ -145,13 +138,38 @@ int fota_download_init(fota_download_callback_t client_callback); | |||
* @retval 0 If download has started successfully. | |||
* @retval -EALREADY If download is already ongoing. | |||
* @retval -E2BIG If sec_tag_count is larger than | |||
* @kconfig{CONFIG_FOTA_DOWNLOAD_SEC_TAG_LIST_SIZE_MAX} | |||
* `CONFIG_FOTA_DOWNLOAD_SEC_TAG_LIST_SIZE_MAX` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the change? The old way should create a direct link in the generated documentation which goes to the Kconfig page, why would you want to remove that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to @peknis these are not supported anymore in the docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment from Gerard:
the Doxygen macro still exists and should be used. It now renders a verbatim block, but that may change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With Breathe now removed, this notation does not produce a link in doxygen docs anymore and renders weirdly. Therefore, suggesting to dump that notation and use single backticks only to make it look cleaner.
(from Gerard's comment in one of the JIRAs): breathe, the extension we used, had a poor performance (with removal CI went from ~40min to ~15min in NCS) and was not maintained properly. Upstream Zephyr proceeded with the removal of it and so NCS followed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping the macro has some advantages:
- When reading code, it's clear this is a Kconfig
- Allows us to tweak it in the future to, maybe, link somewhere
- We can also tweak the style
So please, keep using @kconfig
even if it just renders a verbatim block. Upstream Zephyr also does this, so let's be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the docs are broken and IMO we should not continue making weird-looking docs just because upstream does it for whatever reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's because of that hideous zoom thing though, it looks absolutely fine without it https://ncsdoc.z6.web.core.windows.net/latest/nrf/doxygen/html/group__lte__lc_ga4c137ae6b3b1c7006dd730458958fb77.html#ga4c137ae6b3b1c7006dd730458958fb77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll open a PR just for that change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds like an argument that we can't adopt everything from upstream and need to make adaptations in NCS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f3fa476
to
12b3157
Compare
12b3157
to
9b2c66a
Compare
Add support for Proxy-URI options to downloader. This is defined in RFC7252 and we need it for nRF Cloud. Signed-off-by: Maximilian Deubel <[email protected]>
Add support for an authentication callback to the downloader library. The callback is called after connecting and allows to authenticate the current socket. nRF Cloud uses authentication in this way for their CoAP backend. Signed-off-by: Maximilian Deubel <[email protected]>
CoAP URLs were parsed twice, leading to errors. Now, the backend doesn't try to treat the file name as a URL anymore. Signed-off-by: Maximilian Deubel <[email protected]>
Integrate the improved downloader library into nRF Cloud. Instead of using a custom downloader backend, use downloader for coap downloads. Also, remove external_download_client support since it isn't used anymore. Signed-off-by: Maximilian Deubel <[email protected]>
9b2c66a
to
09b000c
Compare
Rework the implementation for nRF Cloud CoAP downloads to use downloader instead of a custom implementation. This also adds some missing features to downloader and cleans up the previous code from fota_download and nrf_cloud_download.
The old implementation had issues with resumption which should be resolved by this. Also, by reducing custom code, maintainability should be improved.