Skip to content

Commit

Permalink
Kconfig: Expose pkg/wakaama configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrolanzieri committed Apr 7, 2020
1 parent a3f9b2b commit e5729ae
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 3 deletions.
1 change: 1 addition & 0 deletions pkg/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
menu "Packages"

rsource "tinydtls/Kconfig"
rsource "wakaama/Kconfig"

endmenu # Packages
129 changes: 129 additions & 0 deletions pkg/wakaama/Kconfig
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions pkg/wakaama/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e5729ae

Please sign in to comment.