diff --git a/examples/lwm2m/Makefile.ci b/examples/lwm2m/Makefile.ci index dde0c7ef7a5b..bab3493af59e 100644 --- a/examples/lwm2m/Makefile.ci +++ b/examples/lwm2m/Makefile.ci @@ -2,6 +2,7 @@ BOARD_INSUFFICIENT_MEMORY := \ airfy-beacon \ arduino-mkr1000 \ b-l072z-lrwan1 \ + bastwan \ blackpill-stm32f103c8 \ blackpill-stm32f103cb \ bluepill-stm32f030c8 \ @@ -9,16 +10,22 @@ BOARD_INSUFFICIENT_MEMORY := \ bluepill-stm32f103cb \ calliope-mini \ cc1350-launchpad \ + cc2538dk \ cc2650-launchpad \ cc2650stk \ e104-bt5010a-tb \ e104-bt5011a-tb \ + feather-m0-lora \ feather-m0-wifi \ + firefly \ gd32vf103c-start \ + generic-cc2538-cc2592-dk \ + hamilton \ hifive1 \ hifive1b \ i-nucleo-lrwan1 \ im880b \ + lobaro-lorabox \ lsn50 \ maple-mini \ microbit \ @@ -34,16 +41,29 @@ BOARD_INSUFFICIENT_MEMORY := \ nucleo-f302r8 \ nucleo-f303k8 \ nucleo-f334r8 \ + nucleo-f410rb \ + nucleo-g070rb \ + nucleo-g071rb \ + nucleo-g431rb \ nucleo-l011k4 \ nucleo-l031k6 \ nucleo-l053r8 \ nucleo-l073rz \ + nucleo-l412kb \ olimexino-stm32 \ + omote \ opencm904 \ openmote-b \ + openmote-cc2538 \ + pba-d-01-kw2x \ + remote-pa \ + remote-reva \ + remote-revb \ samd10-xmini \ saml10-xpro \ saml11-xpro \ + samr21-xpro \ + samr30-xpro \ seeedstudio-gd32 \ sipeed-longan-nano \ sipeed-longan-nano-tft \ diff --git a/pkg/wakaama/Kconfig b/pkg/wakaama/Kconfig index 1a3c773dd216..3144e0b5cedf 100644 --- a/pkg/wakaama/Kconfig +++ b/pkg/wakaama/Kconfig @@ -27,11 +27,14 @@ config LWM2M_DEVICE_TTL help Lifetime of the device on the LwM2M server, expressed in seconds. -config LWM2M_COAP_DEFAULT_BLOCK_SIZE - int "CoAP block size" - default 1024 - help - Block transfer options support only power-of-two block sizes, from 2**4 (16) to 2**10 (1024) bytes. + +config LWM2M_COAP_DEFAULT_BLOCK_SIZE + int "CoAP block size" + range 4 10 + default 10 + help + Block transfer options support only power-of-two block sizes, from 2**4 (16) to 2**10 (1024) bytes. + This option represents the exponent of 2, which will be used for the block size. config LWM2M_LOCAL_PORT string "Port for the local LwM2M CoAP" diff --git a/pkg/wakaama/Makefile.dep b/pkg/wakaama/Makefile.dep index d47c384a3b4c..3876b808097e 100644 --- a/pkg/wakaama/Makefile.dep +++ b/pkg/wakaama/Makefile.dep @@ -12,7 +12,6 @@ USEMODULE += wakaama_objects USEMODULE += wakaama_objects_device USEMODULE += wakaama_objects_security - ifneq (,$(filter wakaama_objects_barometer,$(USEMODULE))) USEMODULE += wakaama_objects_ipso_sensor_base endif @@ -39,8 +38,9 @@ endif USEMODULE += ztimer USEMODULE += ztimer_sec +USEMODULE += random USEPKG += tlsf -USEPKG += random + # If logs for the package are active, we need fmt ifneq (,$(filter -DLWM2M_WITH_LOGS,$(CFLAGS))) diff --git a/pkg/wakaama/Makefile.include b/pkg/wakaama/Makefile.include index a08ef80767b2..69ca42848e4f 100644 --- a/pkg/wakaama/Makefile.include +++ b/pkg/wakaama/Makefile.include @@ -9,11 +9,6 @@ INCLUDES += -I$(PKGDIRBASE)/wakaama/coap/er-coap-13 # NOTE: Use wakaama in client mode CFLAGS += -DLWM2M_CLIENT_MODE -# NOTE: "Default CoAP block size; Used if not set on a per-target basis" -ifneq (,$(CONFIG_LWM2M_COAP_DEFAULT_BLOCK_SIZE)) - CFLAGS += -DLWM2M_COAP_DEFAULT_BLOCK_SIZE=1024 -endif - # Translate 'CONFIG_' options to package specific flags. This checks if the # option is being set via Kconfig or CFLAGS ifneq (,$(or $(CONFIG_LWM2M_BOOTSTRAP),$(filter -DCONFIG_LWM2M_BOOTSTRAP=1,$(CFLAGS)))) @@ -24,5 +19,12 @@ ifneq (,$(or $(CONFIG_LWM2M_WITH_LOGS),$(filter -DCONFIG_LWM2M_WITH_LOGS=1,$(CFL CFLAGS += -DLWM2M_WITH_LOGS=1 endif +# NOTE: "Default CoAP block size; Used if not set on a per-target basis" +ifeq (,$(CONFIG_LWM2M_COAP_DEFAULT_BLOCK_SIZE)) + CFLAGS += -DLWM2M_COAP_DEFAULT_BLOCK_SIZE=1024 +else + CFLAGS += -DLWM2M_COAP_DEFAULT_BLOCK_SIZE='1<<$(CONFIG_LWM2M_COAP_DEFAULT_BLOCK_SIZE)' +endif + PSEUDOMODULES += wakaama PSEUDOMODULES += wakaama_client_dtls diff --git a/pkg/wakaama/contrib/objects/common.c b/pkg/wakaama/contrib/objects/common.c index 40814d0d02da..a32c5f8eb805 100644 --- a/pkg/wakaama/contrib/objects/common.c +++ b/pkg/wakaama/contrib/objects/common.c @@ -245,7 +245,7 @@ static int _set_resource_data(lwm2m_client_data_t *client_data, const lwm2m_uri_ } /* write the resource of the specified instance */ - uint8_t res = object->writeFunc(client_data->lwm2m_ctx, uri->instanceId, 1, data, object,LWM2M_WRITE_PARTIAL_UPDATE); + uint8_t res = object->writeFunc(client_data->lwm2m_ctx, uri->instanceId, 1, data, object, LWM2M_WRITE_PARTIAL_UPDATE); lwm2m_resource_value_changed(client_data->lwm2m_ctx, uri); if (res != COAP_204_CHANGED) { diff --git a/pkg/wakaama/contrib/objects/security.c b/pkg/wakaama/contrib/objects/security.c index 5d9b47eb1e13..3cddee7a01d1 100644 --- a/pkg/wakaama/contrib/objects/security.c +++ b/pkg/wakaama/contrib/objects/security.c @@ -733,7 +733,7 @@ static uint8_t _create_cb(lwm2m_context_t * context, uint16_t instance_id, int n object->instanceList = LWM2M_LIST_ADD(object->instanceList, instance); /* write incoming data to the instance */ - result = _write_cb(context, instance_id, num_data, data_array, object,LWM2M_WRITE_PARTIAL_UPDATE); + result = _write_cb(context, instance_id, num_data, data_array, object, LWM2M_WRITE_PARTIAL_UPDATE); if (result != COAP_204_CHANGED) { _delete_cb(context,instance_id, object); diff --git a/pkg/wakaama/patches/0005-fixed-format-specifier.patch b/pkg/wakaama/patches/0005-fixed-format-specifier.patch new file mode 100644 index 000000000000..dba3b6b15b25 --- /dev/null +++ b/pkg/wakaama/patches/0005-fixed-format-specifier.patch @@ -0,0 +1,33 @@ +From 85072c812957133c02899e2e1f25dd46f5d576f1 Mon Sep 17 00:00:00 2001 +From: Moritz +Date: Wed, 23 Oct 2024 16:51:12 +0200 +Subject: [PATCH] fixed format specifier + +--- + examples/client/object_server.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/examples/client/object_server.c b/examples/client/object_server.c +index a6a05bc..a19516d 100644 +--- a/examples/client/object_server.c ++++ b/examples/client/object_server.c +@@ -51,6 +51,7 @@ + #include + #include + #include ++#include + + typedef struct _server_instance_ + { +@@ -908,7 +909,7 @@ void display_server_object(lwm2m_object_t * object) + server_instance_t * serverInstance = (server_instance_t *)object->instanceList; + while (serverInstance != NULL) + { +- fprintf(stdout, " /%u/%u: instanceId: %u, shortServerId: %u, lifetime: %u, storing: %s, binding: %s", ++ fprintf(stdout, " /%u/%u: instanceId: %u, shortServerId: %u, lifetime: %" PRIu32 ", storing: %s, binding: %s", + object->objID, serverInstance->instanceId, + serverInstance->instanceId, serverInstance->shortServerId, serverInstance->lifetime, + serverInstance->storing ? "true" : "false", serverInstance->binding); +-- +2.34.1 +