2019-11-29 17:54:08 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 HAW Hamburg
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @{
|
|
|
|
* @ingroup lwm2m_client
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Helper functions to interact with the basic objects provided by
|
|
|
|
* Wakaama from a LwM2M client.
|
|
|
|
*
|
|
|
|
* @author Leandro Lanzieri <leandro.lanzieri@haw-hamburg.de>
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "kernel_defines.h"
|
|
|
|
|
|
|
|
#include "lwm2m_client.h"
|
2021-03-23 11:50:57 +01:00
|
|
|
#include "objects/device.h"
|
2019-11-29 17:54:08 +01:00
|
|
|
#include "lwm2m_client_config.h"
|
|
|
|
#include "lwm2m_client_objects.h"
|
|
|
|
|
2021-03-11 15:12:27 +01:00
|
|
|
/* These functions are defined by the objects (object_server.c is implemented by
|
|
|
|
* the Wakaama package. security.c and device.c can be found in
|
|
|
|
* 'contrib/objects') */
|
2019-11-29 17:54:08 +01:00
|
|
|
lwm2m_object_t *get_server_object(int server_id, const char *binding,
|
|
|
|
int lifetime, bool storing);
|
|
|
|
|
2021-03-19 11:34:33 +01:00
|
|
|
lwm2m_object_t *lwm2m_client_get_server_object(lwm2m_client_data_t *client_data,
|
|
|
|
int server_id)
|
2019-11-29 17:54:08 +01:00
|
|
|
{
|
|
|
|
(void)client_data;
|
|
|
|
lwm2m_object_t *ret;
|
2019-12-17 13:57:01 +01:00
|
|
|
int lifetime = CONFIG_LWM2M_DEVICE_TTL;
|
2019-11-29 17:54:08 +01:00
|
|
|
|
2019-12-17 13:57:01 +01:00
|
|
|
ret = get_server_object(server_id, CONFIG_LWM2M_DEVICE_BINDINGS, lifetime,
|
|
|
|
false);
|
2019-11-29 17:54:08 +01:00
|
|
|
return ret;
|
|
|
|
}
|