#
# Copyright (c) 2017 Linaro Limited
#
# SPDX-License-Identifier: Apache-2.0
#

menuconfig LWM2M
	bool "OMA LWM2M protocol stack"
	default n
	select COAP
	select NET_APP_CLIENT
	select HTTP_PARSER_URL
	help
	  This option adds logic for managing OMA LWM2M data

if LWM2M

config SYS_LOG_LWM2M_LEVEL
	int "LWM2M log level"
	depends on SYS_LOG
	default 1
	range 0 4
	help
	  Set the log level for the LWM2M library.

config LWM2M_ENGINE_STACK_SIZE
	int "LWM2M engine stack size"
	default 1024
	default 1536 if NET_LOG_GLOBAL
	help
	 Set the stack size for the LWM2M library engine (used for handling
	 OBSERVE and NOTIFY events)

config LWM2M_ENGINE_MAX_MESSAGES
	int "LWM2M engine max. message object"
	default 10
	help
	  Set the maximum message objects for the LWM2M library client

config LWM2M_ENGINE_MAX_PENDING
	int "LWM2M engine max. pending objects"
	default 5
	help
	  Set the maximum pending objects for the LWM2M library client

config LWM2M_ENGINE_MAX_REPLIES
	int "LWM2M engine max. reply objects"
	default 5
	help
	  Set the maximum reply objects for the LWM2M library client

config LWM2M_ENGINE_MAX_OBSERVER
	int "Maximum # of observable LWM2M resources"
	default 10
	range 5 200
	help
	  This value sets the maximum number of resources which can be
	  added to the observe notification list.

config LWM2M_ENGINE_DEFAULT_LIFETIME
	int "LWM2M engine default server connection lifetime"
	default 30
	range 15 65535
	help
	  Set the default lifetime (in seconds) for the LWM2M library engine

config LWM2M_LOCAL_PORT
	int "LWM2M client port"
	default 0
	help
	  This is the client port for LWM2M communication.  The default
	  setting of 0 sets a random port for the client to be used for
	  outgoing communication.

config LWM2M_SECURITY_INSTANCE_COUNT
	int "Maximum # of LWM2M Security object instances"
	default 1
	range 1 10
	help
	  This setting establishes the total count of LWM2M Security instances
	  available to the client.

config LWM2M_SERVER_INSTANCE_COUNT
	int "Maximum # of LWM2M Server object instances"
	default 1
	range 1 10
	help
	  This setting establishes the total count of LWM2M Server instances
	  available to the client (including: bootstrap and regular servers).

config LWM2M_RD_CLIENT_SUPPORT
	bool "support for LWM2M client bootstrap/registration state machine"
	default y
	help
	  Client will use registration state machine to locate and connect to
	  LWM2M servers (including bootstrap server support)

config LWM2M_PEER_PORT
	int "LWM2M server port"
	depends on LWM2M_RD_CLIENT_SUPPORT
	default 5683
	help
	  This is the server port to connect to for LWM2M communication

config LWM2M_FIRMWARE_UPDATE_OBJ_SUPPORT
	bool "Firmware Update object support"
	default y
	help
	  Include support for LWM2M Firmware Update Object (ID 5)

config LWM2M_FIRMWARE_UPDATE_PULL_SUPPORT
	bool "Firmware Update object pull support"
	default y
	depends on LWM2M_FIRMWARE_UPDATE_OBJ_SUPPORT
	depends on (HTTP_PARSER || HTTP_PARSER_URL)
	help
	  Include support for pulling a file from a remote server via
	  block transfer and "FIRMWARE PACKAGE URI" resource.  This option
	  adds another UDP context and packet handling.

config LWM2M_FIRMWARE_UPDATE_PULL_LOCAL_PORT
	int "LWM2M client firmware pull local port"
	default 0
	depends on LWM2M_FIRMWARE_UPDATE_PULL_SUPPORT
	help
	  This is the client port for LWM2M firmware download.  The default
	  setting of 0 sets a random port for the client to be used for
	  outgoing communication.

config LWM2M_COAP_BLOCK_SIZE
	int "LWM2M CoAP block-wise transfer size"
	default 256
	default 64 if NET_L2_BT
	default 64 if NET_L2_IEEE802154
	range 16 1024
	help
	  CoAP block size used by LWM2M when performing block-wise
	  transfers. Possible values: 16, 32, 64, 128, 256, 512 and 1024.

config LWM2M_NUM_BLOCK1_CONTEXT
	int "Maximum # of LWM2M block1 contexts"
	default 3
	help
	  This value sets up the maximum number of block1 contexts for
	  CoAP block-wise transfer we can handle at the same time.

config LWM2M_FIRMWARE_UPDATE_PULL_COAP_PROXY_SUPPORT
	bool "Firmware Update object pull via CoAP-CoAP/HTTP proxy support"
	depends on LWM2M_FIRMWARE_UPDATE_PULL_SUPPORT
	default n
	help
	  Include support for pulling firmware file via a CoAP-CoAP/HTTP proxy.

if LWM2M_FIRMWARE_UPDATE_PULL_COAP_PROXY_SUPPORT

config LWM2M_FIRMWARE_UPDATE_PULL_COAP_PROXY_ADDR
	string "CoAP proxy network address"
	help
	  Network address of the CoAP proxy server.

endif # LWM2M_FIRMWARE_UPDATE_PULL_COAP_PROXY_SUPPORT

config LWM2M_RW_JSON_SUPPORT
	bool "support for JSON writer"
	default y
	help
	  Include support for writing JSON data

config LWM2M_DEVICE_PWRSRC_MAX
	int "Maximum # of device power source records"
	default 5
	range 1 20
	help
	  This value sets the maximum number of power source data that a device
	  can store.  These are displayed via the "Device" object /3/0/6,
	  /3/0/7 and /3/0/8 resources.

config LWM2M_DEVICE_ERROR_CODE_MAX
	int "Maximum # of device obj error codes to store"
	default 10
	range 1 20
	help
	  This value sets the maximum number of error codes that the device
	  object will store before ignoring new values.

config LWM2M_NUM_ATTR
	int "Maximum # of LWM2M attributes"
	default 20
	help
	  This value sets up the maximum number of LwM2M attributes that
	  we can handle at the same time.

menu "IPSO Alliance Smart Object Support"

source "subsys/net/lib/lwm2m/Kconfig.ipso"

endmenu

endif # LWM2M
