Skip to content
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

nRF Cloud CoAP Client Library #11535

Merged
merged 8 commits into from
Jul 20, 2023
Merged

Conversation

plskeggs
Copy link
Contributor

@plskeggs plskeggs commented Jun 14, 2023

This PR adds a library to use CoAP for communicating with the new nRF Cloud CoAP server and underlying services.

Limitations:

  • The device must have a specially formatted set of root CA certs in slot 0 of the configured sectag. This needs to have two root CA certs, one for the CoAP server, and one for AWS (for access to HTTPS requests for P-GPS and FOTA images).
  • Unit tests are not yet written.

@github-actions github-actions bot added changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. doc-required PR must not be merged without tech writer approval. labels Jun 14, 2023
@plskeggs plskeggs marked this pull request as draft June 14, 2023 23:35
@plskeggs plskeggs force-pushed the feature-dtls-coap branch 5 times, most recently from e1d00de to 0647d23 Compare June 15, 2023 01:27
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Jun 15, 2023

Test specification

CI/Jenkins/NRF

  • Integration Platforms

CI/Jenkins/integration

Test Module File based changes Manually selected West overwrite
test-ci-nrfconnect-boot-fw-update X
test-fw-nrfconnect-nrf-iot_cloud X
test-fw-nrfconnect-nrf-iot_mosh X
test-fw-nrfconnect-nrf-iot_positioning X
test-fw-nrfconnect-nrf-iot_serial_lte_modem X
test-fw-nrfconnect-nrf-iot_thingy91 X

Detailed information of selected test modules

Note: This message is automatically posted and updated by the CI

@plskeggs plskeggs force-pushed the feature-dtls-coap branch 4 times, most recently from db70dc9 to 3970bca Compare June 15, 2023 21:18
subsys/net/lib/nrf_cloud/coap/src/dtls.c Outdated Show resolved Hide resolved
subsys/net/lib/nrf_cloud/coap/src/dtls.c Outdated Show resolved Hide resolved
subsys/net/lib/nrf_cloud/coap/src/dtls.c Outdated Show resolved Hide resolved
include/net/nrf_cloud_defs.h Show resolved Hide resolved
include/net/nrf_cloud_coap.h Outdated Show resolved Hide resolved
include/net/nrf_cloud_coap.h Outdated Show resolved Hide resolved
include/net/nrf_cloud_coap.h Show resolved Hide resolved
subsys/net/lib/nrf_cloud/coap/src/nrf_cloud_coap.c Outdated Show resolved Hide resolved
subsys/net/lib/nrf_cloud/coap/src/nrf_cloud_coap.c Outdated Show resolved Hide resolved
subsys/net/lib/nrf_cloud/coap/src/nrf_cloud_coap.c Outdated Show resolved Hide resolved
subsys/net/lib/nrf_cloud/coap/src/nrf_cloud_coap.c Outdated Show resolved Hide resolved
subsys/net/lib/nrf_cloud/coap/src/dtls.c Outdated Show resolved Hide resolved
subsys/net/lib/nrf_cloud/coap/src/dtls.c Outdated Show resolved Hide resolved
@plskeggs
Copy link
Contributor Author

@peknis I've made your changes, except for one as I mention here:
#11535 (comment)

@plskeggs
Copy link
Contributor Author

@wiba-nordic since Pekka is now on vacation, can you approve my changes resulting from his review? We ran out of time to close the final loop on that.

Copy link
Contributor

@wiba-nordic wiba-nordic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for Pekka.

Copy link
Contributor

@tony-le-24 tony-le-24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Great work!

Define strings related to encoding a device message
in JSON.

Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
Copy link
Contributor

@glarsennordic glarsennordic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

include/net/nrf_cloud.h Outdated Show resolved Hide resolved
subsys/net/lib/nrf_cloud/coap/src/nrfc_dtls.c Outdated Show resolved Hide resolved
@plskeggs plskeggs added the DNM label Jul 18, 2023
Add a general purpose JSON message encoder,
nrf_cloud_encode_message().

Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
When encoding the shadow, let the caller determine if
the reported object should be included.

Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
Split out update function so it can be used for CoAP.

Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
This was incorrectly using the ++ operator when atomic_inc()
would be better.

Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
Modem sec tags are unsigned, so use that representation
instead of plain int.

Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
plskeggs and others added 2 commits July 19, 2023 18:12
Uses the Zephyr coap_client library. Sends and receives
data with nRF Cloud using CBOR and sometimes JSON.

Supports most nRF Cloud services - FOTA, data messaging,
location services (cellular, Wi-Fi, A-GPS, P-GPS).

Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
Document the new nrf_cloud_coap library.

Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
Co-authored-by: Pekka Niskanen <pekka.niskanen@nordicsemi.no>
@rlubos rlubos merged commit 6b1edd4 into nrfconnect:main Jul 20, 2023
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-required PR must not be merged without tech writer approval.
Projects
None yet
Development

Successfully merging this pull request may close these issues.