1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:32:45 +01:00

pkg/wakaama: changes on config and OS services

This commit is contained in:
Moritz 2024-08-22 18:50:58 +02:00 committed by Moritz Holzer
parent 4d2d10bc95
commit 68db9992e0
4 changed files with 21 additions and 4 deletions

View File

@ -26,6 +26,14 @@ config LWM2M_DEVICE_TTL
default 300 default 300
help help
Lifetime of the device on the LwM2M server, expressed in seconds. Lifetime of the device on the LwM2M server, expressed in seconds.
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 config LWM2M_LOCAL_PORT
string "Port for the local LwM2M CoAP" string "Port for the local LwM2M CoAP"

View File

@ -12,7 +12,6 @@ USEMODULE += wakaama_objects
USEMODULE += wakaama_objects_device USEMODULE += wakaama_objects_device
USEMODULE += wakaama_objects_security USEMODULE += wakaama_objects_security
ifneq (,$(filter wakaama_objects_barometer,$(USEMODULE))) ifneq (,$(filter wakaama_objects_barometer,$(USEMODULE)))
USEMODULE += wakaama_objects_ipso_sensor_base USEMODULE += wakaama_objects_ipso_sensor_base
endif endif
@ -39,6 +38,7 @@ endif
USEMODULE += ztimer USEMODULE += ztimer
USEMODULE += ztimer_sec USEMODULE += ztimer_sec
USEMODULE += random
USEPKG += tlsf USEPKG += tlsf
# If logs for the package are active, we need fmt # If logs for the package are active, we need fmt

View File

@ -9,9 +9,6 @@ INCLUDES += -I$(PKGDIRBASE)/wakaama/coap/er-coap-13
# NOTE: Use wakaama in client mode # NOTE: Use wakaama in client mode
CFLAGS += -DLWM2M_CLIENT_MODE CFLAGS += -DLWM2M_CLIENT_MODE
# NOTE: "Default CoAP block size; Used if not set on a per-target basis"
CFLAGS += -DLWM2M_COAP_DEFAULT_BLOCK_SIZE=1024
# Translate 'CONFIG_' options to package specific flags. This checks if the # Translate 'CONFIG_' options to package specific flags. This checks if the
# option is being set via Kconfig or CFLAGS # option is being set via Kconfig or CFLAGS
ifneq (,$(or $(CONFIG_LWM2M_BOOTSTRAP),$(filter -DCONFIG_LWM2M_BOOTSTRAP=1,$(CFLAGS)))) ifneq (,$(or $(CONFIG_LWM2M_BOOTSTRAP),$(filter -DCONFIG_LWM2M_BOOTSTRAP=1,$(CFLAGS))))
@ -22,5 +19,12 @@ ifneq (,$(or $(CONFIG_LWM2M_WITH_LOGS),$(filter -DCONFIG_LWM2M_WITH_LOGS=1,$(CFL
CFLAGS += -DLWM2M_WITH_LOGS=1 CFLAGS += -DLWM2M_WITH_LOGS=1
endif 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
PSEUDOMODULES += wakaama_client_dtls PSEUDOMODULES += wakaama_client_dtls

View File

@ -36,6 +36,7 @@
#include "ztimer.h" #include "ztimer.h"
#include "tlsf.h" #include "tlsf.h"
#include "random.h"
#include "lwm2m_platform.h" #include "lwm2m_platform.h"
#include "lwm2m_client_config.h" #include "lwm2m_client_config.h"
@ -106,6 +107,10 @@ time_t lwm2m_gettime(void)
return (time_t)(ztimer_now(ZTIMER_SEC)); return (time_t)(ztimer_now(ZTIMER_SEC));
} }
int lwm2m_seed(void) {
return random_uint32();
}
/* For clang we need to specify that the first argument will be a format string /* For clang we need to specify that the first argument will be a format string
* for print * for print
*/ */