Skip to content

Commit 87aaaa1

Browse files
maxd-nordicjtguggedal
authored andcommitted
lib: nrf_cloud_info: properly print sec tags for CoAP
Sectags on nRF91 platforms must be handled as unsigned integers. Signed-off-by: Maximilian Deubel <[email protected]>
1 parent 78fd52d commit 87aaaa1

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

subsys/net/lib/nrf_cloud/common/src/nrf_cloud_info.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,11 @@ int nrf_cloud_print_details(void)
151151
LOG_INF("Sec tag: %d", nrf_cloud_sec_tag_get());
152152
#endif /* defined(CONFIG_NRF_MODEM_LIB) */
153153
#if defined(CONFIG_NRF_CLOUD_COAP)
154+
#if defined(CONFIG_NRF_MODEM_LIB)
155+
LOG_INF("CoAP JWT Sec tag: %u", (uint32_t) nrf_cloud_sec_tag_coap_jwt_get());
156+
#else
154157
LOG_INF("CoAP JWT Sec tag: %d", nrf_cloud_sec_tag_coap_jwt_get());
158+
#endif /* defined(CONFIG_NRF_MODEM_LIB) */
155159
#endif
156160
LOG_INF("Host name: %s", host_name);
157161

subsys/net/lib/nrf_cloud/common/src/nrf_cloud_sec_tag.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ static sec_tag_t coap_jwt_sec_tag = CONFIG_NRF_CLOUD_COAP_JWT_SEC_TAG;
3333
void nrf_cloud_sec_tag_coap_jwt_set(const sec_tag_t sec_tag)
3434
{
3535
coap_jwt_sec_tag = sec_tag;
36-
LOG_DBG("CoAP JWT sec tag updated: %d", coap_jwt_sec_tag);
36+
37+
#if defined(CONFIG_NRF_MODEM_LIB)
38+
LOG_DBG("CoAP JWT Sec tag updated: %u", (uint32_t) coap_jwt_sec_tag);
39+
#else
40+
LOG_DBG("CoAP JWT Sec tag updated: %d", coap_jwt_sec_tag);
41+
#endif /* defined(CONFIG_NRF_MODEM_LIB) */
3742
}
3843

3944
sec_tag_t nrf_cloud_sec_tag_coap_jwt_get(void)

0 commit comments

Comments
 (0)