#
# Copyright (c) 2022 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_MOSH_CLOUD_LWM2M=y
CONFIG_MOSH_LOCATION=y

# Heap size needs to be increased due to LwM2M A-GNSS data buffer
CONFIG_HEAP_MEM_POOL_SIZE=10240
CONFIG_LWM2M_ENGINE_STACK_SIZE=3072

# Handle Location library GNSS data and cellular location requests in the application
CONFIG_LOCATION_SERVICE_EXTERNAL=y

# Set the LwM2M pre-shared key (PSK) here
#CONFIG_MOSH_LWM2M_PSK="000102030405060708090a0b0c0d0e0f"

# LwM2M client utils library
CONFIG_LWM2M_CLIENT_UTILS=y
CONFIG_LWM2M_CLIENT_UTILS_SECURITY_OBJ_SUPPORT=y
CONFIG_LWM2M_CLIENT_UTILS_CONN_MON_OBJ_SUPPORT=y
CONFIG_LWM2M_CLIENT_UTILS_LOCATION_OBJ_SUPPORT=y
CONFIG_LWM2M_CLIENT_UTILS_FIRMWARE_UPDATE_OBJ_SUPPORT=n
CONFIG_LWM2M_CLIENT_UTILS_SIGNAL_MEAS_INFO_OBJ_SUPPORT=y
CONFIG_LWM2M_CLIENT_UTILS_GROUND_FIX_OBJ_SUPPORT=y
CONFIG_LWM2M_CLIENT_UTILS_GNSS_ASSIST_OBJ_SUPPORT=y
CONFIG_LWM2M_CLIENT_UTILS_LOCATION_ASSIST_AGNSS=y
CONFIG_LWM2M_CLIENT_UTILS_LOCATION_ASSIST_CELL=y

# LwM2M and IPSO
CONFIG_LWM2M=y
CONFIG_LWM2M_COAP_BLOCK_SIZE=512
CONFIG_LWM2M_COAP_MAX_MSG_SIZE=1280
CONFIG_LWM2M_ENGINE_MAX_OBSERVER=15
CONFIG_LWM2M_ENGINE_MAX_MESSAGES=15
CONFIG_LWM2M_ENGINE_MAX_PENDING=15
CONFIG_LWM2M_ENGINE_MAX_REPLIES=15
CONFIG_LWM2M_ENGINE_DEFAULT_LIFETIME=30
CONFIG_LWM2M_DNS_SUPPORT=y
CONFIG_LWM2M_RW_JSON_SUPPORT=n
CONFIG_LWM2M_RW_OMA_TLV_SUPPORT=y
CONFIG_LWM2M_SERVER_DEFAULT_PMIN=1
CONFIG_LWM2M_SERVER_DEFAULT_PMAX=300
CONFIG_LWM2M_IPSO_SUPPORT=y
# Enable LwM2M 1.1
CONFIG_LWM2M_VERSION_1_1=y
CONFIG_LWM2M_COMPOSITE_PATH_LIST_SIZE=10
# Enable SenML-CBOR content format
CONFIG_LWM2M_RW_SENML_CBOR_SUPPORT=y
CONFIG_ZCBOR=y
CONFIG_ZCBOR_CANONICAL=y
CONFIG_LWM2M_RW_SENML_CBOR_RECORDS=35

# IPSO v1.1
CONFIG_LWM2M_SERVER_OBJECT_VERSION_1_1=y

# DTLS settings
CONFIG_LWM2M_DTLS_SUPPORT=y

# Enable LwM2M Queue Mode
CONFIG_LWM2M_QUEUE_MODE_ENABLED=y
# Enable TLS session caching to prevent doing a full TLS handshake for every send.
CONFIG_LWM2M_TLS_SESSION_CACHING=y
# Socket close is skipped at RX off idle state to optimize power consumption.
# Socket close call activates RCC connection to send Alert message to the server.
# Alert is now sent before opening a new connection.
CONFIG_LWM2M_RD_CLIENT_SUSPEND_SOCKET_AT_IDLE=y
# Sets the duration that the LwM2M engine will poll for data after transmission before
# the socket is closed.
CONFIG_LWM2M_QUEUE_MODE_UPTIME=30
# Lifetime 12 hours.
CONFIG_LWM2M_ENGINE_DEFAULT_LIFETIME=43200
# Send registration update 10 minutes before connection lifetime expiration.
CONFIG_LWM2M_SECONDS_TO_UPDATE_EARLY=600

# Support HEX style PSK values (double the size + NULL char)
CONFIG_LWM2M_SECURITY_KEY_SIZE=33

# Extend CoAP retry timeout to 4 seconds for LTE/LTE-M
CONFIG_COAP_INIT_ACK_TIMEOUT_MS=4000

# Enable CoAP extended option length
CONFIG_COAP_EXTENDED_OPTIONS_LEN=y
CONFIG_COAP_EXTENDED_OPTIONS_LEN_VALUE=40

# Enable shell
CONFIG_LWM2M_SHELL=y
