Skip to content

Commit

Permalink
feature/wakaama: updated Makefile.ci
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzholzer committed Oct 25, 2024
1 parent 27ce0e2 commit 863f0f6
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 14 deletions.
20 changes: 20 additions & 0 deletions examples/lwm2m/Makefile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,30 @@ BOARD_INSUFFICIENT_MEMORY := \
airfy-beacon \
arduino-mkr1000 \
b-l072z-lrwan1 \
bastwan \
blackpill-stm32f103c8 \
blackpill-stm32f103cb \
bluepill-stm32f030c8 \
bluepill-stm32f103c8 \
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 \
Expand All @@ -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 \
Expand Down
13 changes: 8 additions & 5 deletions pkg/wakaama/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions pkg/wakaama/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)))
Expand Down
12 changes: 7 additions & 5 deletions pkg/wakaama/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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))))
Expand All @@ -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
2 changes: 1 addition & 1 deletion pkg/wakaama/contrib/objects/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/wakaama/contrib/objects/security.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
33 changes: 33 additions & 0 deletions pkg/wakaama/patches/0005-fixed-format-specifier.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 85072c812957133c02899e2e1f25dd46f5d576f1 Mon Sep 17 00:00:00 2001
From: Moritz <[email protected]>
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 <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <inttypes.h>

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

0 comments on commit 863f0f6

Please sign in to comment.