diff --git a/pkg/Kconfig b/pkg/Kconfig index e07b0b27fa..58775f3ebc 100644 --- a/pkg/Kconfig +++ b/pkg/Kconfig @@ -7,5 +7,6 @@ menu "Packages" rsource "tinydtls/Kconfig" +rsource "wakaama/Kconfig" endmenu # Packages diff --git a/pkg/wakaama/Kconfig b/pkg/wakaama/Kconfig new file mode 100644 index 0000000000..7ce41dbb8b --- /dev/null +++ b/pkg/wakaama/Kconfig @@ -0,0 +1,129 @@ +# 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. +# +menuconfig KCONFIG_PKG_WAKAAMA + bool "Configure Wakaama LwM2M" + depends on PKG_WAKAAMA + help + Configure Wakaama package via Kconfig. + +if KCONFIG_PKG_WAKAAMA + +menu "Remote server" + +config LWM2M_STANDARD_PORT + string "CoAP default port of the LwM2M server" + default "5683" + +config LWM2M_DTLS_PORT + string "CoAPS default port of the LwM2M server" + default "5684" + +config LWM2M_SERVER_URI + string "LwM2M server URI to register/bootstrap with" + default "coap://[fd00:dead:beef::1]" + help + The host part of the URI MUST be a valid IPv6 address. Host names can + not be resolved at this time. + +config LWM2M_SERVER_ID + int "Numeric ID of the Server URI" + default 10 + help + This numeric ID corresponds to the server URI specified in the + previous option. + +config LWM2M_BOOTSTRAP + bool "Is a bootstrap server" + help + The specified server is a LwM2M bootstrap server. + +endmenu # Remote server + +menu "Device" + +choice + bool "Device binding and queue mode" + default LWM2M_DEVICE_BINDING_U + +config LWM2M_DEVICE_BINDING_U + bool "UDP" + +config LWM2M_DEVICE_BINDING_UQ + bool "UDP with Queue mode" + +config LWM2M_DEVICE_BINDING_S + bool "SMS" + +config LWM2M_DEVICE_BINDING_SQ + bool "SMS with Queue mode" + +config LWM2M_DEVICE_BINDING_US + bool "UDP and SMS" + +config LWM2M_DEVICE_BINDING_UQS + bool "UDP with Queue mode and SMS" + +endchoice + +config LWM2M_DEVICE_NAME + string "Device name" + default "testRIOTDevice" + help + This is the device name used to register at the LwM2M server. + +config LWM2M_DEVICE_MANUFACTURER + string "Device manufacturer" + default "A RIOT maker" + +config LWM2M_DEVICE_MODEL + string "Device model" + default "$(BOARD)" + +config LWM2M_DEVICE_TYPE + string "Device type" + default "RIOT device" + +config LWM2M_DEVICE_SERIAL + string "Device serial number" + default "undefined" + +config LWM2M_DEVICE_FW_VERSION + string "Device firmware version" + default "" + +config LWM2M_DEVICE_HW_VERSION + string "Device hardware version" + default "$(BOARD)" + +config LWM2M_DEVICE_SW_VERSION + string "Device software version" + default "" + +endmenu # Device + +config LWM2M_DEVICE_TTL + int "Lifetime of the device" + default 300 + help + Lifetime of the device on the LwM2M server, expressed in seconds. + +config LWM2M_LOCAL_PORT + string "Default port for the local LwM2M instance" + default "5683" + +config LWM2M_ALT_PATH + string "Alternate path to place LwM2M resources" + default "/" + +config LWM2M_WITH_LOGS + bool "Debug logs" + +config LWM2M_TLSF_BUFFER + int "Allocation buffer size" + default 5120 + +endif # KCONFIG_PKG_WAKAAMA diff --git a/pkg/wakaama/Makefile.include b/pkg/wakaama/Makefile.include index 2432725672..f5e74f55c0 100644 --- a/pkg/wakaama/Makefile.include +++ b/pkg/wakaama/Makefile.include @@ -7,11 +7,11 @@ INCLUDES += -I$(PKGDIRBASE)/wakaama CFLAGS += -DLWM2M_CLIENT_MODE # Translate 'CONFIG_' options to package specific flags. This checks if the -# option is set via CFLAGS -ifneq (,$(filter -DCONFIG_LWM2M_BOOTSTRAP=1,$(CFLAGS))) +# option is being set via Kconfig or CFLAGS +ifneq (,$(or $(CONFIG_LWM2M_BOOTSTRAP),$(filter -DCONFIG_LWM2M_BOOTSTRAP=1,$(CFLAGS)))) CFLAGS += -DLWM2M_BOOTSTRAP=1 endif -ifdef (,$(filter -DCONFIG_LWM2M_WITH_LOGS=1,$(CFLAGS))) +ifneq (,$(or $(CONFIG_LWM2M_WITH_LOGS),$(filter -DCONFIG_LWM2M_WITH_LOGS=1,$(CFLAGS)))) CFLAGS += -DLWM2M_WITH_LOGS=1 endif