1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

pkg/wakaama: update lwm2m_uri_t usage

This commit is contained in:
Leandro Lanzieri 2024-11-23 16:21:51 +01:00
parent a9108a40dd
commit 1a86962110
4 changed files with 13 additions and 13 deletions

View File

@ -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;

View File

@ -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) {

View File

@ -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);
}

View File

@ -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;