From 1a86962110f074b5189a7f7caa55d138c36bd8d3 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Sat, 23 Nov 2024 16:21:51 +0100 Subject: [PATCH] pkg/wakaama: update lwm2m_uri_t usage --- pkg/wakaama/contrib/lwm2m_client.c | 12 ++++++------ pkg/wakaama/contrib/lwm2m_client_connection.c | 10 +++++----- pkg/wakaama/contrib/objects/ipso_sensor_base.c | 3 +-- pkg/wakaama/contrib/objects/light_control.c | 1 + 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pkg/wakaama/contrib/lwm2m_client.c b/pkg/wakaama/contrib/lwm2m_client.c index e2f8d8deea..77c0f864db 100644 --- a/pkg/wakaama/contrib/lwm2m_client.c +++ b/pkg/wakaama/contrib/lwm2m_client.c @@ -117,9 +117,9 @@ static credman_tag_t _get_credential(const sock_udp_ep_t *ep, uint8_t security_m } /* prepare query */ - lwm2m_uri_t query_uri = { - .objectId = LWM2M_SECURITY_OBJECT_ID, - }; + lwm2m_uri_t query_uri; + LWM2M_URI_RESET(&query_uri); + query_uri.objectId = LWM2M_SECURITY_OBJECT_ID; lwm2m_list_t *instance = sec->instanceList; @@ -409,9 +409,9 @@ void lwm2m_client_refresh_dtls_credentials(void) } /* prepare query */ - lwm2m_uri_t query_uri = { - .objectId = LWM2M_SECURITY_OBJECT_ID, - }; + lwm2m_uri_t query_uri; + LWM2M_URI_RESET(&query_uri); + query_uri.objectId = LWM2M_SECURITY_OBJECT_ID; lwm2m_list_t *instance = sec->instanceList; int64_t val; diff --git a/pkg/wakaama/contrib/lwm2m_client_connection.c b/pkg/wakaama/contrib/lwm2m_client_connection.c index 2d3a8f02a0..506289b97c 100644 --- a/pkg/wakaama/contrib/lwm2m_client_connection.c +++ b/pkg/wakaama/contrib/lwm2m_client_connection.c @@ -280,11 +280,11 @@ static lwm2m_client_connection_t *_connection_create(uint16_t sec_obj_inst_id, DEBUG("Creating connection\n"); /* prepare Server URI query */ - lwm2m_uri_t resource_uri = { - .objectId = LWM2M_SECURITY_URI_ID, - .instanceId = sec_obj_inst_id, - .resourceId = LWM2M_SECURITY_URI_ID, - }; + lwm2m_uri_t resource_uri; + LWM2M_URI_RESET(&resource_uri); + resource_uri.objectId = LWM2M_SECURITY_URI_ID; + resource_uri.instanceId = sec_obj_inst_id; + resource_uri.resourceId = LWM2M_SECURITY_URI_ID; int res = lwm2m_get_string(client_data, &resource_uri, uri, &uri_len); if (res < 0) { diff --git a/pkg/wakaama/contrib/objects/ipso_sensor_base.c b/pkg/wakaama/contrib/objects/ipso_sensor_base.c index 4cff9cb04b..b73b823f4e 100644 --- a/pkg/wakaama/contrib/objects/ipso_sensor_base.c +++ b/pkg/wakaama/contrib/objects/ipso_sensor_base.c @@ -380,13 +380,12 @@ static void _mark_resource_as_changed(const lwm2m_object_t *object, uint16_t ins uint16_t resource_id) { lwm2m_uri_t uri; + LWM2M_URI_RESET(&uri); uri.objectId = object->objID; uri.instanceId = instance_id; uri.resourceId = resource_id; - uri.flag = LWM2M_URI_FLAG_OBJECT_ID | LWM2M_URI_FLAG_INSTANCE_ID | LWM2M_URI_FLAG_RESOURCE_ID; - lwm2m_resource_value_changed(lwm2m_client_get_ctx(object->userData), &uri); } diff --git a/pkg/wakaama/contrib/objects/light_control.c b/pkg/wakaama/contrib/objects/light_control.c index 867c8122cf..3d0b71e4fc 100644 --- a/pkg/wakaama/contrib/objects/light_control.c +++ b/pkg/wakaama/contrib/objects/light_control.c @@ -343,6 +343,7 @@ free_out: static void _mark_resource_changed(uint16_t instance_id, uint16_t resource_id) { lwm2m_uri_t uri; + LWM2M_URI_RESET(&uri); uri.objectId = LWM2M_LIGHT_CONTROL_OBJECT_ID; uri.instanceId = instance_id; uri.resourceId = resource_id;