From 4061bda9b3de4f90635383b648966f41f2467051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simen=20S=2E=20R=C3=B8stad?= Date: Mon, 23 Oct 2023 08:32:12 +0200 Subject: [PATCH] applications: asset_tracker_v2: Replace hardcoded value with `HW_ID_LEN` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace hardcoded client ID with `HW_ID_LEN` to avoid truncating if HW ID library is configured to output IDs longer than 15 characters. Fixes NCSDK-24219 Signed-off-by: Simen S. Røstad --- applications/asset_tracker_v2/src/cloud/aws_iot_integration.c | 2 +- .../src/cloud/lwm2m_integration/lwm2m_integration.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/asset_tracker_v2/src/cloud/aws_iot_integration.c b/applications/asset_tracker_v2/src/cloud/aws_iot_integration.c index e3bf04ddb2fd..4141c7e3b91d 100644 --- a/applications/asset_tracker_v2/src/cloud/aws_iot_integration.c +++ b/applications/asset_tracker_v2/src/cloud/aws_iot_integration.c @@ -15,7 +15,7 @@ LOG_MODULE_REGISTER(MODULE, CONFIG_CLOUD_INTEGRATION_LOG_LEVEL); #if !defined(CONFIG_CLOUD_CLIENT_ID_USE_CUSTOM) -#define AWS_CLOUD_CLIENT_ID_LEN 15 +#define AWS_CLOUD_CLIENT_ID_LEN (HW_ID_LEN - 1) #else #define AWS_CLOUD_CLIENT_ID_LEN (sizeof(CONFIG_CLOUD_CLIENT_ID) - 1) #endif diff --git a/applications/asset_tracker_v2/src/cloud/lwm2m_integration/lwm2m_integration.c b/applications/asset_tracker_v2/src/cloud/lwm2m_integration/lwm2m_integration.c index 2f1d62c95bf5..a6c79ed33f6d 100644 --- a/applications/asset_tracker_v2/src/cloud/lwm2m_integration/lwm2m_integration.c +++ b/applications/asset_tracker_v2/src/cloud/lwm2m_integration/lwm2m_integration.c @@ -22,7 +22,7 @@ LOG_MODULE_REGISTER(MODULE, CONFIG_CLOUD_INTEGRATION_LOG_LEVEL); #if !defined(CONFIG_CLOUD_CLIENT_ID_USE_CUSTOM) -#define LWM2M_INTEGRATION_CLIENT_ID_LEN 15 +#define LWM2M_INTEGRATION_CLIENT_ID_LEN (HW_ID_LEN - 1) #else #define LWM2M_INTEGRATION_CLIENT_ID_LEN (sizeof(CONFIG_CLOUD_CLIENT_ID) - 1) #endif