From daf550d508fe2bed264513c9f508844c2f3e9741 Mon Sep 17 00:00:00 2001 From: Moritz Date: Thu, 22 Aug 2024 17:46:57 +0200 Subject: [PATCH] wakaama: changed signature of callback function to new one wakaama: changed signature of callback function to new one --- pkg/wakaama/contrib/objects/device.c | 36 ++++++++------------- pkg/wakaama/contrib/objects/light_control.c | 9 ------ pkg/wakaama/contrib/objects/security.c | 4 --- 3 files changed, 14 insertions(+), 35 deletions(-) diff --git a/pkg/wakaama/contrib/objects/device.c b/pkg/wakaama/contrib/objects/device.c index 8c6079ebacdd..da3d16dfc89f 100644 --- a/pkg/wakaama/contrib/objects/device.c +++ b/pkg/wakaama/contrib/objects/device.c @@ -35,7 +35,8 @@ static bool reboot; /** * @brief 'Execute' callback for the Device object. - * + * + * @param[in] context Lwm2m Context. * @param[in] instance_id Instance ID. Should be 0 as a single instance exists. * @param[in] resource_id ID of the resource to execute. * @param[in] buffer Information needed for the execution. @@ -70,6 +71,7 @@ static uint8_t _read_cb(lwm2m_context_t *context, uint16_t instance_id, int *num /** * @brief 'Discover' callback for the Device object. * + * @param[in] context Lwm2m Context. * @param[in] instance_id Instance ID. Should be 0 as a single instance exists. * @param[in, out] num_data Number of resources requested. 0 means all. * @param[in, out] data_array Initialized data array to determine if the resource exists, @@ -80,29 +82,21 @@ static uint8_t _read_cb(lwm2m_context_t *context, uint16_t instance_id, int *num * @return COAP_404_NOT_FOUND when a resource is not supported * @return COAP_500_INTERNAL_SERVER_ERROR otherwise */ -static uint8_t _discover_cb(lwm2m_context_t *context, uint16_t instance_id, int *num_data, - lwm2m_data_t **data_array, lwm2m_object_t *object); +static uint8_t _discover_cb(lwm2m_context_t * context, uint16_t instance_id, int * num_data, typedef struct { - lwm2m_list_t list; /**< Linked list handle */ -} lwm2m_obj_device_inst_t; - -static const lwm2m_obj_device_inst_t _instance; - -/** - * @brief Implementation of the object interface for the Device Object. */ static lwm2m_object_t _device_object = { - .next = NULL, - .objID = LWM2M_DEVICE_OBJECT_ID, - .instanceList = (lwm2m_list_t *)&_instance, - .readFunc = _read_cb, - .executeFunc = _execute_cb, - .discoverFunc = _discover_cb, - .writeFunc = NULL, - .deleteFunc = NULL, - .createFunc = NULL, - .userData = NULL + .next = NULL, + .objID = LWM2M_DEVICE_OBJECT_ID, + .instanceList = (lwm2m_list_t *)&_instance, + .readFunc = _read_cb, + .executeFunc = _execute_cb, + .discoverFunc = _discover_cb, + .writeFunc = NULL, + .deleteFunc = NULL, + .createFunc = NULL, + .userData = NULL }; static uint8_t _discover_cb(lwm2m_context_t *context, uint16_t instance_id, int *num_data, @@ -272,8 +266,6 @@ static uint8_t _execute_cb(lwm2m_context_t *context, uint16_t instance_id, uint1 { (void)context; (void)buffer; - (void)object; - /* single instance object */ if (instance_id != 0) { return COAP_404_NOT_FOUND; diff --git a/pkg/wakaama/contrib/objects/light_control.c b/pkg/wakaama/contrib/objects/light_control.c index cd10b7ee47d0..3417f60348a5 100644 --- a/pkg/wakaama/contrib/objects/light_control.c +++ b/pkg/wakaama/contrib/objects/light_control.c @@ -76,10 +76,6 @@ static uint8_t _write_cb(lwm2m_context_t *context, uint16_t instance_id, int num lwm2m_data_t *data_array, lwm2m_object_t *object, lwm2m_write_type_t write_type); -/** - * @brief Gets the current value of a given @p instance. - * - * @param[in, out] data Initialized data structure. * @param[in] instance Pointer to the instance to get the value from. * * @return COAP_205_CONTENT on success @@ -220,11 +216,6 @@ static uint8_t _read_cb(lwm2m_context_t *context, uint16_t instance_id, int *num static uint8_t _write_cb(lwm2m_context_t *context, uint16_t instance_id, int num_data, lwm2m_data_t *data_array, lwm2m_object_t *object, lwm2m_write_type_t write_type) -{ - (void)context; - (void)write_type; - - lwm2m_obj_light_control_inst_t *instance; uint8_t result = COAP_204_CHANGED; bool call_cb = false; diff --git a/pkg/wakaama/contrib/objects/security.c b/pkg/wakaama/contrib/objects/security.c index db19b48a15db..82c67198c635 100644 --- a/pkg/wakaama/contrib/objects/security.c +++ b/pkg/wakaama/contrib/objects/security.c @@ -693,10 +693,6 @@ static uint8_t _delete_cb(lwm2m_context_t *context, uint16_t instance_id, static uint8_t _create_cb(lwm2m_context_t *context, uint16_t instance_id, int num_data, lwm2m_data_t *data_array, lwm2m_object_t *object) { - (void)context; - - lwm2m_obj_security_inst_t *instance; - uint8_t result; mutex_lock(&_security_object.lock);