1#
2# Copyright (c) 2020 Siddharth Chandrasekaran <siddharth@embedjournal.com>
3#
4# SPDX-License-Identifier: Apache-2.0
5#
6
7menuconfig OSDP
8	bool "Open Supervised Device Protocol (OSDP) driver"
9	select RING_BUFFER
10	imply SERIAL_SUPPORT_INTERRUPT
11	imply UART_INTERRUPT_DRIVEN
12	imply UART_USE_RUNTIME_CONFIGURE
13	select CRC
14	help
15	  Add support for Open Supervised Device Protocol (OSDP)
16
17if OSDP
18
19choice
20	prompt "OSDP Mode of Operation"
21
22config OSDP_MODE_PD
23	bool "Configure OSDP in Peripheral Device mode"
24	help
25	  Configure this device to operate as a PD (Peripheral Device)
26
27config OSDP_MODE_CP
28	bool "Configure OSDP in Control Panel mode"
29	help
30	  Configure this device to operate as a CP (Control Panel)
31
32endchoice
33
34config OSDP_UART_BAUD_RATE
35	int "OSDP UART baud rate"
36	default 115200
37	help
38	  OSDP defines that baud rate can be either 9600 or 38400 or
39	  115200.
40
41config OSDP_LOG_LEVEL
42	int "OSDP Logging Level"
43	default 1
44	help
45	  Set the logging level for the OSDP driver
46
47config OSDP_UART_BUFFER_LENGTH
48	int "OSDP UART buffer length"
49	default 256
50	help
51	  OSDP RX and TX buffer FIFO length.
52
53config OSDP_THREAD_STACK_SIZE
54	int "OSDP Thread stack size"
55	default 1024
56	help
57	  Thread stack size for osdp refresh thread
58
59config OSDP_PACKET_TRACE
60	bool "Print bytes sent/received over OSDP to console"
61	help
62	  Prints bytes sent/received over OSDP to console for debugging.
63	  LOG_HEXDUMP_DBG() is used to achieve this and can be very verbose.
64
65config OSDP_SKIP_MARK_BYTE
66	bool "Skip sending the initial marking byte (0xFF)"
67	help
68	  As per the OSDP specification, the first byte in the channel has
69	  to be a MARK byte which is 0xFF. Since this is not stated in the
70	  packet structure definition, some commercial CPs and PDs do not
71	  handle the initial mark byte correctly. This option can be used to
72	  completely disable sending/expecting a mark byte to work with
73	  such non-conforming devices.
74
75config OSDP_SC_ENABLED
76	bool "OSDP Secure Channel"
77	depends on ENTROPY_NODE_ENABLED
78	default y
79	select CRYPTO
80	select CRYPTO_MBEDTLS_SHIM
81	help
82	  Secure the OSDP communication channel with encryption and mutual
83	  authentication.
84
85if OSDP_SC_ENABLED
86
87config OSDP_SC_RETRY_WAIT_SEC
88	int "Retry wait time in seconds after a Secure Channel error"
89	default 600
90	help
91	  Time in seconds to wait after a secure channel failure, and before
92	  retrying to establish it.
93
94config OSDP_CRYPTO_DRV_NAME
95	string "Crypto driver to use with OSDP"
96	default "CRYPTO_MTLS"
97	help
98	  OSDP Secure Channel uses AES-128 to secure communication between
99	  CP and PD. Provide an available crypto driver name here.
100
101endif # OSDP_SC_ENABLED
102
103if OSDP_MODE_PD
104source "subsys/mgmt/osdp/Kconfig.pd"
105endif
106
107if OSDP_MODE_CP
108source "subsys/mgmt/osdp/Kconfig.cp"
109endif
110
111endif # OSDP
112