File tree Expand file tree Collapse file tree 4 files changed +30
-11
lines changed
doc/nrf/releases_and_maturity/releases
nrf_cloud_rest_cell_location/src
nrf_cloud_rest_device_message/src Expand file tree Collapse file tree 4 files changed +30
-11
lines changed Original file line number Diff line number Diff line change @@ -265,13 +265,18 @@ Bluetooth Mesh samples
265265Cellular samples
266266----------------
267267
268+ * Updated the :kconfig:option: `CONFIG_NRF_CLOUD_CHECK_CREDENTIALS ` Kconfig option to be optional and enabled by default for the following samples:
269+
270+ * :ref: `nrf_cloud_rest_cell_pos_sample `
271+ * :ref: `nrf_cloud_rest_device_message `
272+ * :ref: `nrf_cloud_rest_fota `
273+
268274* :ref: `location_sample ` sample:
269275
270276 * Updated:
271277
272278 * The Thingy:91 X build to support Wi-Fi by default without overlays.
273279
274-
275280Cryptography samples
276281--------------------
277282
Original file line number Diff line number Diff line change @@ -579,6 +579,7 @@ static void connect_to_network(void)
579579
580580static void check_credentials (void )
581581{
582+ #if defined(CONFIG_NRF_CLOUD_CHECK_CREDENTIALS )
582583 int err = nrf_cloud_credentials_configured_check ();
583584
584585 if ((err == - ENOTSUP ) || (err == - ENOPROTOOPT )) {
@@ -589,6 +590,9 @@ static void check_credentials(void)
589590 LOG_ERR ("nrf_cloud_credentials_configured_check() failed, error: %d" , err );
590591 LOG_WRN ("Continuing without verifying that credentials are installed" );
591592 }
593+ #else
594+ LOG_DBG ("nRF Cloud credentials check not enabled" );
595+ #endif /* defined(CONFIG_NRF_CLOUD_CHECK_CREDENTIALS) */
592596}
593597
594598int main (void )
Original file line number Diff line number Diff line change @@ -236,6 +236,7 @@ static int set_leds_off(void)
236236
237237static bool cred_check (struct nrf_cloud_credentials_status * const cs )
238238{
239+ #if defined(CONFIG_NRF_CLOUD_CHECK_CREDENTIALS )
239240 int ret ;
240241
241242 ret = nrf_cloud_credentials_check (cs );
@@ -248,24 +249,29 @@ static bool cred_check(struct nrf_cloud_credentials_status *const cs)
248249 * - a CA for the TLS connections
249250 * - a private key to sign the JWT
250251 */
252+
253+ if (!cs -> ca || !cs -> ca_aws || !cs -> prv_key ) {
254+ LOG_WRN ("Missing required nRF Cloud credential(s) in sec tag %u:" , cs -> sec_tag );
255+ }
256+ if (!cs -> ca || !cs -> ca_aws ) {
257+ LOG_WRN ("\t-CA Cert" );
258+ }
259+ if (!cs -> prv_key ) {
260+ LOG_WRN ("\t-Private Key" );
261+ }
262+
251263 return (cs -> ca && cs -> ca_aws && cs -> prv_key );
264+ #else
265+ LOG_DBG ("nRF Cloud credentials check not enabled" );
266+ return true;
267+ #endif /* defined(CONFIG_NRF_CLOUD_CHECK_CREDENTIALS) */
252268}
253269
254270static void await_credentials (void )
255271{
256272 struct nrf_cloud_credentials_status cs ;
257273
258274 if (!cred_check (& cs )) {
259- LOG_WRN ("Missing required nRF Cloud credential(s) in sec tag %u:" ,
260- cs .sec_tag );
261-
262- if (!cs .ca ) {
263- LOG_WRN ("\t-CA Cert" );
264- }
265-
266- if (!cs .prv_key ) {
267- LOG_WRN ("\t-Private Key" );
268- }
269275
270276#if defined(CONFIG_NRF_PROVISIONING )
271277 LOG_INF ("Waiting for credentials to be remotely provisioned..." );
Original file line number Diff line number Diff line change @@ -472,6 +472,7 @@ static void sample_reboot(enum nrf_cloud_fota_reboot_status status)
472472
473473static void check_credentials (void )
474474{
475+ #if defined(CONFIG_NRF_CLOUD_CHECK_CREDENTIALS )
475476 int err = nrf_cloud_credentials_configured_check ();
476477
477478 if (err == - ENOTSUP ) {
@@ -485,6 +486,9 @@ static void check_credentials(void)
485486 LOG_ERR ("nrf_cloud_credentials_configured_check() failed, error: %d" , err );
486487 LOG_WRN ("Continuing without verifying that credentials are installed" );
487488 }
489+ #else
490+ LOG_DBG ("nRF Cloud credentials check not enabled" );
491+ #endif /* defined(CONFIG_NRF_CLOUD_CHECK_CREDENTIALS) */
488492}
489493
490494int main (void )
You can’t perform that action at this time.
0 commit comments