# Simcom sim7080 driver options

# Copyright (C) 2021 metraTec GmbH
# SPDX-License-Identifier: Apache-2.0

config MODEM_SIM7080
	bool "Sim7080 Driver"
	select MODEM_CONTEXT
	select MODEM_CMD_HANDLER
	select MODEM_IFACE_UART
	select MODEM_SOCKET
	select NET_OFFLOAD
	select NET_SOCKETS_OFFLOAD
	imply GPIO
	help
	  Enables the driver for the Sim7080 modem.

if MODEM_SIM7080

config MODEM_SIMCOM_SIM7080_RX_STACK_SIZE
	int "Stack size for the simcom sim7080 modem driver rx thread"
	default 1028
	help
	  This stack is used by the simcom SIM7080 RX thread.

config MODEM_SIMCOM_SIM7080_RX_WORKQ_STACK_SIZE
	int "Stack size for the simcom sim7080 modem driver work queue"
	default 2048
	help
		This stack is used by the work queue.

config MODEM_SIMCOM_SIM7080_INIT_PRIORITY
	int "simcom sim7080 driver init priority"
	default 80
	help
	  simcom sim7080 driver initialization priority.

config MODEM_SIMCOM_SIM7080_LTE_BANDS_M1
	hex "Default LTE bands for CAT-M1"
	default 0x8820
	help
		Bitmap of channels the modem can use for CAT-M1.
		Refer to enum sim7080_lte_chan.

config MODEM_SIMCOM_SIM7080_LTE_BANDS_NB1
	hex "Default LTE bands for NB-IoT"
	default 0x8820
	help
		Bitmap of channels the modem can use for NB-IoT.
		Refer to enum sim7080_lte_chan.

config MODEM_SIMCOM_SIM7080_APN
	string "APN for establishing a network connection"
	default "internet"
	help
	  This setting is used to set the APN name for the network connection
	  context. This value is specific to the network provider and may
	  need to be changed.

config MODEM_SIMCOM_SIM7080_BAUDRATE
	int "Baudrate for modem UART"
	default 115200
	help
		Set this to the baudrate the uart is using. On first startup
		the modem is configured to use autobaud. The driver will then
		configure the modem to use a fixed baudrate for faster startups.

config MODEM_SIMCOM_SIM7080_DNS_DEFAULT_RECOUNT
	int "Retry count for a DNS query"
	range 0 10
	default 10
	help
		The number of retries for a DNS lookup

config MODEM_SIMCOM_SIM7080_DNS_DEFAULT_TIMEOUT
	int "Timeout for a DNS query"
	range 0 60000
	default 20000
	help
		The timeout for DNS queries in milliseconds

config MODEM_SIMCOM_SIM7080_SOCKETS_SOCKOPT_TLS
	bool "TLS for sockets"
	help
	  This option enables TLS (Transport Layer Security) for sockets
	  on the SIM7080 modem.

config MODEM_SIMCOM_SIM7080_TLS_BUFFER_SIZE
	int "Size of the tls certificate copy buffer"
	depends on MODEM_SIMCOM_SIM7080_SOCKETS_SOCKOPT_TLS
	default 256

choice MODEM_SIMCOM_SIM7080_RAT
	bool "Default Radio Access Technology Mode"
	default MODEM_SIMCOM_SIM7080_RAT_NB1

config MODEM_SIMCOM_SIM7080_RAT_NB1
	bool "NB-IoT"
	help
		Enable LTE NB-IoT mode.

config MODEM_SIMCOM_SIM7080_RAT_M1
	bool "Cat-M1"
	help
		Enable Cat-M1 mode.

config MODEM_SIMCOM_SIM7080_RAT_LTE_AUTO
	bool "Automatic selection of NB-IoT or Cat-M1"
	help
		Enable automatic LTE technology selection.

config MODEM_SIMCOM_SIM7080_RAT_GSM
	bool "GSM"
	help
	  Enable GSM mode.

endchoice

choice
	bool "Modem Boot Type"
	default MODEM_SIMCOM_SIM7080_BOOT_TYPE_NORMAL

config MODEM_SIMCOM_SIM7080_BOOT_TYPE_NORMAL
	bool "Normal boot"
	help
		Boot the modem and attach to network

config MODEM_SIMCOM_SIM7080_BOOT_TYPE_CONSTRAINED
	bool "Constrained boot"
	help
		Check if the modem is operational and then power off

endchoice

endif # MODEM_SIM7080
