1if BLE_MESH
2
3    config BLE_MESH_HCI_5_0
4        bool "Support sending 20ms non-connectable adv packets"
5        default y
6        help
7            It is a temporary solution and needs further modifications.
8
9    config BLE_MESH_USE_DUPLICATE_SCAN
10        bool "Support Duplicate Scan in BLE Mesh"
11        depends on BT_BLUEDROID_ENABLED
12        select BTDM_BLE_SCAN_DUPL if IDF_TARGET_ESP32
13        select BTDM_BLE_MESH_SCAN_DUPL_EN if IDF_TARGET_ESP32
14        select BT_CTRL_BLE_SCAN_DUPL if IDF_TARGET_ESP32C3
15        select BT_CTRL_BLE_MESH_SCAN_DUPL_EN if IDF_TARGET_ESP32C3
16        default y
17        help
18            Enable this option to allow using specific duplicate scan filter
19            in BLE Mesh, and Scan Duplicate Type must be set by choosing the
20            option in the Bluetooth Controller section in menuconfig, which is
21            "Scan Duplicate By Device Address and Advertising Data".
22
23    choice BLE_MESH_MEM_ALLOC_MODE
24        prompt "Memory allocation strategy"
25        default BLE_MESH_MEM_ALLOC_MODE_INTERNAL
26        help
27            Allocation strategy for BLE Mesh stack, essentially provides ability to
28            allocate all required dynamic allocations from,
29
30            - Internal DRAM memory only
31            - External SPIRAM memory only
32            - Either internal or external memory based on default malloc()
33              behavior in ESP-IDF
34            - Internal IRAM memory wherever applicable else internal DRAM
35
36            Recommended mode here is always internal (*), since that is most preferred
37            from security perspective. But if application requirement does not
38            allow sufficient free internal memory then alternate mode can be
39            selected.
40
41            (*) In case of ESP32-S2/ESP32-S3, hardware allows encryption of external
42            SPIRAM contents provided hardware flash encryption feature is enabled.
43            In that case, using external SPIRAM allocation strategy is also safe choice
44            from security perspective.
45
46        config BLE_MESH_MEM_ALLOC_MODE_INTERNAL
47            bool "Internal DRAM"
48
49        config BLE_MESH_MEM_ALLOC_MODE_EXTERNAL
50            bool "External SPIRAM"
51            depends on SPIRAM_USE_CAPS_ALLOC || SPIRAM_USE_MALLOC
52
53        config BLE_MESH_MEM_ALLOC_MODE_DEFAULT
54            bool "Default alloc mode"
55            help
56                Enable this option to use the default memory allocation strategy when
57                external SPIRAM is enabled. See the SPIRAM options for more details.
58
59        config BLE_MESH_MEM_ALLOC_MODE_IRAM_8BIT
60            bool "Internal IRAM"
61            depends on ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY
62            help
63                Allows to use IRAM memory region as 8bit accessible region. Every
64                unaligned (8bit or 16bit) access will result in an exception and
65                incur penalty of certain clock cycles per unaligned read/write.
66
67    endchoice # BLE_MESH_MEM_ALLOC_MODE
68
69    config BLE_MESH_FREERTOS_STATIC_ALLOC
70        bool "Enable FreeRTOS static allocation"
71        depends on FREERTOS_SUPPORT_STATIC_ALLOCATION && (ESP32_SPIRAM_SUPPORT || ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY)
72        default n
73        help
74            Enable this option to use FreeRTOS static allocation APIs for BLE Mesh,
75            which provides the ability to use different dynamic memory (i.e. SPIRAM
76            or IRAM) for FreeRTOS objects.
77            If this option is disabled, the FreeRTOS static allocation APIs will not
78            be used, and internal DRAM will be allocated for FreeRTOS objects.
79
80    choice BLE_MESH_FREERTOS_STATIC_ALLOC_MODE
81        prompt "Memory allocation for FreeRTOS objects"
82        depends on BLE_MESH_FREERTOS_STATIC_ALLOC
83        help
84            Choose the memory to be used for FreeRTOS objects.
85
86        config BLE_MESH_FREERTOS_STATIC_ALLOC_EXTERNAL
87            bool "External SPIRAM"
88            depends on ESP32_SPIRAM_SUPPORT
89            help
90                If enabled, BLE Mesh allocates dynamic memory from external SPIRAM for
91                FreeRTOS objects, i.e. mutex, queue, and task stack. External SPIRAM
92                can only be used for task stack when SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY
93                is enabled. See the SPIRAM options for more details.
94
95        config BLE_MESH_FREERTOS_STATIC_ALLOC_IRAM_8BIT
96            bool "Internal IRAM"
97            depends on ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY
98            help
99                If enabled, BLE Mesh allocates dynamic memory from internal IRAM for
100                FreeRTOS objects, i.e. mutex, queue. Note: IRAM region cannot be used
101                as task stack.
102
103    endchoice # BLE_MESH_FREERTOS_STATIC_ALLOC_MODE
104
105    config BLE_MESH_DEINIT
106        bool "Support de-initialize BLE Mesh stack"
107        default y
108        help
109            If enabled, users can use the function esp_ble_mesh_deinit() to de-initialize
110            the whole BLE Mesh stack.
111
112    menu "BLE Mesh and BLE coexistence support"
113
114        config BLE_MESH_SUPPORT_BLE_ADV
115            bool "Support sending normal BLE advertising packets"
116            default n
117            help
118                When selected, users can send normal BLE advertising packets
119                with specific API.
120
121        if BLE_MESH_SUPPORT_BLE_ADV
122
123            config BLE_MESH_BLE_ADV_BUF_COUNT
124                int "Number of advertising buffers for BLE advertising packets"
125                default 3
126                range 1 255
127                help
128                    Number of advertising buffers for BLE packets available.
129
130        endif # BLE_MESH_SUPPORT_BLE_ADV
131
132        config BLE_MESH_SUPPORT_BLE_SCAN
133            bool "Support scanning normal BLE advertising packets"
134            default n
135            help
136                When selected, users can register a callback and receive normal BLE
137                advertising packets in the application layer.
138
139    endmenu # BLE Mesh and BLE coexistence support
140
141    config BLE_MESH_FAST_PROV
142        bool "Enable BLE Mesh Fast Provisioning"
143        select BLE_MESH_NODE
144        select BLE_MESH_PROVISIONER
145        select BLE_MESH_PB_ADV
146        default n
147        help
148            Enable this option to allow BLE Mesh fast provisioning solution to be used.
149            When there are multiple unprovisioned devices around, fast provisioning can
150            greatly reduce the time consumption of the whole provisioning process.
151            When this option is enabled, and after an unprovisioned device is provisioned
152            into a node successfully, it can be changed to a temporary Provisioner.
153
154    config BLE_MESH_NODE
155        bool "Support for BLE Mesh Node"
156        help
157            Enable the device to be provisioned into a node. This option should be
158            enabled when an unprovisioned device is going to be provisioned into a
159            node and communicate with other nodes in the BLE Mesh network.
160
161    config BLE_MESH_PROVISIONER
162        bool "Support for BLE Mesh Provisioner"
163        help
164            Enable the device to be a Provisioner. The option should be enabled when
165            a device is going to act as a Provisioner and provision unprovisioned
166            devices into the BLE Mesh network.
167
168    if BLE_MESH_PROVISIONER
169
170        config BLE_MESH_WAIT_FOR_PROV_MAX_DEV_NUM
171            int "Maximum number of unprovisioned devices that can be added to device queue"
172            default 10
173            range 1 100
174            help
175                This option specifies how many unprovisioned devices can be added to device
176                queue for provisioning. Users can use this option to define the size of the
177                queue in the bottom layer which is used to store unprovisioned device
178                information (e.g. Device UUID, address).
179
180        config BLE_MESH_MAX_PROV_NODES
181            int "Maximum number of devices that can be provisioned by Provisioner"
182            default 10
183            range 1 1000
184            help
185                This option specifies how many devices can be provisioned by a Provisioner.
186                This value indicates the maximum number of unprovisioned devices which can be
187                provisioned by a Provisioner. For instance, if the value is 6, it means the
188                Provisioner can provision up to 6 unprovisioned devices.
189                Theoretically a Provisioner without the limitation of its memory can provision
190                up to 32766 unprovisioned devices, here we limit the maximum number to 100
191                just to limit the memory used by a Provisioner. The bigger the value is, the
192                more memory it will cost by a Provisioner to store the information of nodes.
193
194        if BLE_MESH_PB_ADV
195            config BLE_MESH_PBA_SAME_TIME
196                int "Maximum number of PB-ADV running at the same time by Provisioner"
197                default 2
198                range 1 10
199                help
200                    This option specifies how many devices can be provisioned at the same time
201                    using PB-ADV. For examples, if the value is 2, it means a Provisioner can
202                    provision two unprovisioned devices with PB-ADV at the same time.
203
204        endif # BLE_MESH_PB_ADV
205
206        if BLE_MESH_PB_GATT
207            config BLE_MESH_PBG_SAME_TIME
208                int "Maximum number of PB-GATT running at the same time by Provisioner"
209                default 1
210                range 1 5
211                help
212                    This option specifies how many devices can be provisioned at the same
213                    time using PB-GATT. For example, if the value is 2, it means a Provisioner
214                    can provision two unprovisioned devices with PB-GATT at the same time.
215
216        endif # BLE_MESH_PB_GATT
217
218        config BLE_MESH_PROVISIONER_SUBNET_COUNT
219            int "Maximum number of mesh subnets that can be created by Provisioner"
220            default 3
221            range 1 4096
222            help
223                This option specifies how many subnets per network a Provisioner can create.
224                Indeed, this value decides the number of network keys which can be added by a Provisioner.
225
226        config BLE_MESH_PROVISIONER_APP_KEY_COUNT
227            int "Maximum number of application keys that can be owned by Provisioner"
228            default 3
229            range 1 4096
230            help
231                This option specifies how many application keys the Provisioner can have.
232                Indeed, this value decides the number of the application keys which can be added by a Provisioner.
233
234        config BLE_MESH_PROVISIONER_RECV_HB
235            bool "Support receiving Heartbeat messages"
236            default n
237            help
238                When this option is enabled, Provisioner can call specific functions to enable
239                or disable receiving Heartbeat messages and notify them to the application layer.
240
241        if BLE_MESH_PROVISIONER_RECV_HB
242
243            config BLE_MESH_PROVISIONER_RECV_HB_FILTER_SIZE
244                int "Maximum number of filter entries for receiving Heartbeat messages"
245                default 3
246                range 1 1000
247                help
248                    This option specifies how many heartbeat filter entries Provisioner supports.
249                    The heartbeat filter (acceptlist or rejectlist) entries are used to store a
250                    list of SRC and DST which can be used to decide if a heartbeat message will
251                    be processed and notified to the application layer by Provisioner.
252                    Note: The filter is an empty rejectlist by default.
253
254        endif # BLE_MESH_PROVISIONER_RECV_HB
255
256    endif # BLE_MESH_PROVISIONER
257
258    # Virtual option enabled whenever Generic Provisioning layer is needed
259    config BLE_MESH_PROV
260        bool "BLE Mesh Provisioning support"
261        default y
262        help
263            Enable this option to support BLE Mesh Provisioning functionality. For
264            BLE Mesh, this option should be always enabled.
265
266    config BLE_MESH_PB_ADV
267        bool "Provisioning support using the advertising bearer (PB-ADV)"
268        select BLE_MESH_PROV
269        default y
270        help
271            Enable this option to allow the device to be provisioned over the
272            advertising bearer. This option should be enabled if PB-ADV is
273            going to be used during provisioning procedure.
274
275    config BLE_MESH_UNPROVISIONED_BEACON_INTERVAL
276        int "Interval between two consecutive Unprovisioned Device Beacon"
277        depends on BLE_MESH_NODE && BLE_MESH_PB_ADV
278        default 5
279        default 3 if BLE_MESH_FAST_PROV
280        range 1 100
281        help
282            This option specifies the interval of sending two consecutive unprovisioned
283            device beacon, users can use this option to change the frequency of sending
284            unprovisioned device beacon. For example, if the value is 5, it means the
285            unprovisioned device beacon will send every 5 seconds. When the option of
286            BLE_MESH_FAST_PROV is selected, the value is better to be 3 seconds, or less.
287
288    config BLE_MESH_PB_GATT
289        bool "Provisioning support using GATT (PB-GATT)"
290        select BLE_MESH_PROXY
291        select BLE_MESH_PROV
292        help
293            Enable this option to allow the device to be provisioned over GATT.
294            This option should be enabled if PB-GATT is going to be used during
295            provisioning procedure.
296
297            # Virtual option enabled whenever any Proxy protocol is needed
298    config BLE_MESH_PROXY
299        bool "BLE Mesh Proxy protocol support"
300        default y
301        help
302            Enable this option to support BLE Mesh Proxy protocol used by PB-GATT
303            and other proxy pdu transmission.
304
305    config BLE_MESH_GATT_PROXY_SERVER
306        bool "BLE Mesh GATT Proxy Server"
307        select BLE_MESH_PROXY
308        depends on BLE_MESH_NODE
309        default y
310        help
311            This option enables support for Mesh GATT Proxy Service, i.e. the
312            ability to act as a proxy between a Mesh GATT Client and a Mesh network.
313            This option should be enabled if a node is going to be a Proxy Server.
314
315    config BLE_MESH_NODE_ID_TIMEOUT
316        int "Node Identity advertising timeout"
317        depends on BLE_MESH_GATT_PROXY_SERVER
318        range 1 60
319        default 60
320        help
321            This option determines for how long the local node advertises using
322            Node Identity. The given value is in seconds. The specification limits
323            this to 60 seconds and lists it as the recommended value as well.
324            So leaving the default value is the safest option.
325            When an unprovisioned device is provisioned successfully and becomes a
326            node, it will start to advertise using Node Identity during the time
327            set by this option. And after that, Network ID will be advertised.
328
329    config BLE_MESH_PROXY_FILTER_SIZE
330        int "Maximum number of filter entries per Proxy Client"
331        depends on BLE_MESH_GATT_PROXY_SERVER
332        default 4
333        range 1 32767
334        help
335            This option specifies how many Proxy Filter entries the local node supports.
336            The entries of Proxy filter (whitelist or blacklist) are used to store a
337            list of addresses which can be used to decide which messages will be forwarded
338            to the Proxy Client by the Proxy Server.
339
340    config BLE_MESH_GATT_PROXY_CLIENT
341        bool "BLE Mesh GATT Proxy Client"
342        select BLE_MESH_PROXY
343        default n
344        help
345            This option enables support for Mesh GATT Proxy Client. The Proxy Client
346            can use the GATT bearer to send mesh messages to a node that supports the
347            advertising bearer.
348
349    config BLE_MESH_NET_BUF_POOL_USAGE
350        bool
351        default y
352        help
353            Enable BLE Mesh net buffer pool tracking. This option is used to introduce another
354            variable in the bottom layer to record the usage of advertising buffers of BLE Mesh
355            devices. Recommend to enable this option as default.
356
357    config BLE_MESH_SETTINGS
358        bool "Store BLE Mesh configuration persistently"
359        default n
360        help
361            When selected, the BLE Mesh stack will take care of storing/restoring the BLE
362            Mesh configuration persistently in flash.
363            If the device is a BLE Mesh node, when this option is enabled, the configuration
364            of the device will be stored persistently, including unicast address, NetKey,
365            AppKey, etc.
366            And if the device is a BLE Mesh Provisioner, the information of the device will
367            be stored persistently, including the information of provisioned nodes, NetKey,
368            AppKey, etc.
369
370    if BLE_MESH_SETTINGS
371
372        config BLE_MESH_STORE_TIMEOUT
373            int "Delay (in seconds) before storing anything persistently"
374            range 0 1000000
375            default 0
376            help
377                This value defines in seconds how soon any pending changes are actually
378                written into persistent storage (flash) after a change occurs.
379                The option allows nodes to delay a certain period of time to save proper
380                information to flash. The default value is 0, which means information
381                will be stored immediately once there are updates.
382
383        config BLE_MESH_SEQ_STORE_RATE
384            int "How often the sequence number gets updated in storage"
385            range 0 1000000
386            default 0
387            help
388                This value defines how often the local sequence number gets updated in
389                persistent storage (i.e. flash). e.g. a value of 100 means that the
390                sequence number will be stored to flash on every 100th increment.
391                If the node sends messages very frequently a higher value makes more
392                sense, whereas if the node sends infrequently a value as low as 0
393                (update storage for every increment) can make sense. When the stack
394                gets initialized it will add sequence number to the last stored one,
395                so that it starts off with a value that's guaranteed to be larger than
396                the last one used before power off.
397
398        config BLE_MESH_RPL_STORE_TIMEOUT
399            int "Minimum frequency that the RPL gets updated in storage"
400            range 0 1000000
401            default 0
402            help
403                This value defines in seconds how soon the RPL (Replay Protection List)
404                gets written to persistent storage after a change occurs. If the node
405                receives messages frequently, then a large value is recommended. If the
406                node receives messages rarely, then the value can be as low as 0 (which
407                means the RPL is written into the storage immediately).
408                Note that if the node operates in a security-sensitive case, and there is
409                a risk of sudden power-off, then a value of 0 is strongly recommended.
410                Otherwise, a power loss before RPL being written into the storage may
411                introduce message replay attacks and system security will be in a
412                vulnerable state.
413
414        config BLE_MESH_SETTINGS_BACKWARD_COMPATIBILITY
415            bool "A specific option for settings backward compatibility"
416            depends on BLE_MESH_NODE
417            default n
418            help
419                This option is created to solve the issue of failure in recovering
420                node information after mesh stack updates. In the old version mesh
421                stack, there is no key of "mesh/role" in nvs. In the new version
422                mesh stack, key of "mesh/role" is added in nvs, recovering node
423                information needs to check "mesh/role" key in nvs and implements
424                selective recovery of mesh node information. Therefore, there may
425                be failure in recovering node information during node restarting
426                after OTA.
427
428                The new version mesh stack adds the option of "mesh/role" because
429                we have added the support of storing Provisioner information, while
430                the old version only supports storing node information.
431
432                If users are updating their nodes from old version to new version,
433                we recommend enabling this option, so that system could set the flag
434                in advance before recovering node information and make sure the node
435                information recovering could work as expected.
436
437        config BLE_MESH_SPECIFIC_PARTITION
438            bool "Use a specific NVS partition for BLE Mesh"
439            default n
440            help
441                When selected, the mesh stack will use a specified NVS partition instead of
442                default NVS partition. Note that the specified partition must be registered
443                with NVS using nvs_flash_init_partition() API, and the partition must exists
444                in the csv file.
445                When Provisioner needs to store a large amount of nodes' information in the
446                flash (e.g. more than 20), this option is recommended to be enabled.
447
448        config BLE_MESH_PARTITION_NAME
449            string "Name of the NVS partition for BLE Mesh"
450            depends on BLE_MESH_SPECIFIC_PARTITION
451            default "ble_mesh"
452            help
453                This value defines the name of the specified NVS partition used by the
454                mesh stack.
455
456        config BLE_MESH_USE_MULTIPLE_NAMESPACE
457            bool "Support using multiple NVS namespaces by Provisioner"
458            depends on BLE_MESH_PROVISIONER
459            default n
460            help
461                When selected, Provisioner can use different NVS namespaces to store
462                different instances of mesh information.
463                For example, if in the first room, Provisioner uses NetKey A, AppKey
464                A and provisions three devices, these information will be treated as
465                mesh information instance A. When the Provisioner moves to the second
466                room, it uses NetKey B, AppKey B and provisions two devices, then the
467                information will be treated as mesh information instance B.
468                Here instance A and instance B will be stored in different namespaces.
469                With this option enabled, Provisioner needs to use specific functions
470                to open the corresponding NVS namespace, restore the mesh information,
471                release the mesh information or erase the mesh information.
472
473        config BLE_MESH_MAX_NVS_NAMESPACE
474            int "Maximum number of NVS namespaces"
475            depends on BLE_MESH_USE_MULTIPLE_NAMESPACE
476            default 2
477            range 1 255
478            help
479                This option specifies the maximum NVS namespaces supported by Provisioner.
480
481    endif  # if BLE_MESH_SETTINGS
482
483    config BLE_MESH_SUBNET_COUNT
484        int "Maximum number of mesh subnets per network"
485        default 3
486        range 1 4096
487        help
488            This option specifies how many subnets a Mesh network can have at the same time.
489            Indeed, this value decides the number of the network keys which can be owned by a node.
490
491    config BLE_MESH_APP_KEY_COUNT
492        int "Maximum number of application keys per network"
493        default 3
494        range 1 4096
495        help
496            This option specifies how many application keys the device can store per network.
497            Indeed, this value decides the number of the application keys which can be owned by a node.
498
499    config BLE_MESH_MODEL_KEY_COUNT
500        int "Maximum number of application keys per model"
501        default 3
502        range 1 4096
503        help
504            This option specifies the maximum number of application keys to which each model
505            can be bound.
506
507    config BLE_MESH_MODEL_GROUP_COUNT
508        int "Maximum number of group address subscriptions per model"
509        default 3
510        range 1 4096
511        help
512            This option specifies the maximum number of addresses to which each model can
513            be subscribed.
514
515    config BLE_MESH_LABEL_COUNT
516        int "Maximum number of Label UUIDs used for Virtual Addresses"
517        default 3
518        range 0 4096
519        help
520            This option specifies how many Label UUIDs can be stored.
521            Indeed, this value decides the number of the Virtual Addresses can be supported by a node.
522
523    config BLE_MESH_CRPL
524        int "Maximum capacity of the replay protection list"
525        default 10
526        range 2 65535
527        help
528            This option specifies the maximum capacity of the replay protection list.
529            It is similar to Network message cache size, but has a different purpose.
530            The replay protection list is used to prevent a node from replay attack,
531            which will store the source address and sequence number of the received
532            mesh messages.
533            For Provisioner, the replay protection list size should not be smaller than
534            the maximum number of nodes whose information can be stored. And the element
535            number of each node should also be taken into consideration. For example, if
536            Provisioner can provision up to 20 nodes and each node contains two elements,
537            then the replay protection list size of Provisioner should be at least 40.
538
539    config BLE_MESH_MSG_CACHE_SIZE
540        int "Network message cache size"
541        default 10
542        range 2 65535
543        help
544            Number of messages that are cached for the network. This helps prevent
545            unnecessary decryption operations and unnecessary relays. This option
546            is similar to Replay protection list, but has a different purpose.
547            A node is not required to cache the entire Network PDU and may cache
548            only part of it for tracking, such as values for SRC/SEQ or others.
549
550    config BLE_MESH_ADV_BUF_COUNT
551        int "Number of advertising buffers"
552        default 60
553        range 6 256
554        help
555            Number of advertising buffers available. The transport layer reserves
556            ADV_BUF_COUNT - 3 buffers for outgoing segments. The maximum outgoing
557            SDU size is 12 times this value (out of which 4 or 8 bytes are used
558            for the Transport Layer MIC). For example, 5 segments means the maximum
559            SDU size is 60 bytes, which leaves 56 bytes for application layer data
560            using a 4-byte MIC, or 52 bytes using an 8-byte MIC.
561
562    config BLE_MESH_IVU_DIVIDER
563        int "Divider for IV Update state refresh timer"
564        default 4
565        range 2 96
566        help
567            When the IV Update state enters Normal operation or IV Update
568            in Progress, we need to keep track of how many hours has passed
569            in the state, since the specification requires us to remain in
570            the state at least for 96 hours (Update in Progress has an
571            additional upper limit of 144 hours).
572
573            In order to fulfill the above requirement, even if the node might
574            be powered off once in a while, we need to store persistently
575            how many hours the node has been in the state. This doesn't
576            necessarily need to happen every hour (thanks to the flexible
577            duration range). The exact cadence will depend a lot on the
578            ways that the node will be used and what kind of power source it
579            has.
580
581            Since there is no single optimal answer, this configuration
582            option allows specifying a divider, i.e. how many intervals
583            the 96 hour minimum gets split into. After each interval the
584            duration that the node has been in the current state gets
585            stored to flash. E.g. the default value of 4 means that the
586            state is saved every 24 hours (96 / 4).
587
588    config BLE_MESH_TX_SEG_MSG_COUNT
589        int "Maximum number of simultaneous outgoing segmented messages"
590        default 1
591        range 1 BLE_MESH_ADV_BUF_COUNT
592        help
593            Maximum number of simultaneous outgoing multi-segment and/or reliable messages.
594            The default value is 1, which means the device can only send one segmented
595            message at a time. And if another segmented message is going to be sent, it
596            should wait for the completion of the previous one.
597            If users are going to send multiple segmented messages at the same time, this
598            value should be configured properly.
599
600    config BLE_MESH_RX_SEG_MSG_COUNT
601        int "Maximum number of simultaneous incoming segmented messages"
602        default 1
603        range 1 255
604        help
605            Maximum number of simultaneous incoming multi-segment and/or reliable messages.
606            The default value is 1, which means the device can only receive one segmented
607            message at a time. And if another segmented message is going to be received,
608            it should wait for the completion of the previous one.
609            If users are going to receive multiple segmented messages at the same time, this
610            value should be configured properly.
611
612    config BLE_MESH_RX_SDU_MAX
613        int "Maximum incoming Upper Transport Access PDU length"
614        default 384
615        range 36 384
616        help
617            Maximum incoming Upper Transport Access PDU length. Leave this to the default
618            value, unless you really need to optimize memory usage.
619
620    config BLE_MESH_TX_SEG_MAX
621        int "Maximum number of segments in outgoing messages"
622        default 32
623        range 2 32
624        help
625            Maximum number of segments supported for outgoing messages.
626            This value should typically be fine-tuned based on what
627            models the local node supports, i.e. what's the largest
628            message payload that the node needs to be able to send.
629            This value affects memory and call stack consumption, which
630            is why the default is lower than the maximum that the
631            specification would allow (32 segments).
632
633            The maximum outgoing SDU size is 12 times this number (out of
634            which 4 or 8 bytes is used for the Transport Layer MIC). For
635            example, 5 segments means the maximum SDU size is 60 bytes,
636            which leaves 56 bytes for application layer data using a
637            4-byte MIC and 52 bytes using an 8-byte MIC.
638
639            Be sure to specify a sufficient number of advertising buffers
640            when setting this option to a higher value. There must be at
641            least three more advertising buffers (BLE_MESH_ADV_BUF_COUNT)
642            as there are outgoing segments.
643
644    config BLE_MESH_RELAY
645        bool "Relay support"
646        depends on BLE_MESH_NODE
647        default y
648        help
649            Support for acting as a Mesh Relay Node. Enabling this option will allow
650            a node to support the Relay feature, and the Relay feature can still
651            be enabled or disabled by proper configuration messages. Disabling this
652            option will let a node not support the Relay feature.
653
654    if BLE_MESH_RELAY
655
656        config BLE_MESH_RELAY_ADV_BUF
657            bool "Use separate advertising buffers for relay packets"
658            default n
659            help
660                When selected, self-send packets will be put in a high-priority
661                queue and relay packets will be put in a low-priority queue.
662
663        if BLE_MESH_RELAY_ADV_BUF
664
665            config BLE_MESH_RELAY_ADV_BUF_COUNT
666                int "Number of advertising buffers for relay packets"
667                default 60
668                range 6 256
669                help
670                    Number of advertising buffers for relay packets available.
671
672        endif # BLE_MESH_RELAY_ADV_BUF
673
674    endif # BLE_MESH_RELAY
675
676    config BLE_MESH_LOW_POWER
677        bool "Support for Low Power features"
678        depends on BLE_MESH_NODE
679        help
680            Enable this option to operate as a Low Power Node. If low power consumption
681            is required by a node, this option should be enabled. And once the node
682            enters the mesh network, it will try to find a Friend node and establish a
683            friendship.
684
685    if BLE_MESH_LOW_POWER
686
687        config BLE_MESH_LPN_ESTABLISHMENT
688            bool "Perform Friendship establishment using low power"
689            default n
690            help
691                Perform the Friendship establishment using low power with the help of a
692                reduced scan duty cycle. The downside of this is that the node may miss
693                out on messages intended for it until it has successfully set up Friendship
694                with a Friend node.
695                When this option is enabled, the node will stop scanning for a period of
696                time after a Friend Request or Friend Poll is sent, so as to reduce more
697                power consumption.
698
699        config BLE_MESH_LPN_AUTO
700            bool "Automatically start looking for Friend nodes once provisioned"
701            default n
702            help
703                Once provisioned, automatically enable LPN functionality and start looking
704                for Friend nodes. If this option is disabled LPN mode needs to be manually
705                enabled by calling bt_mesh_lpn_set(true).
706                When an unprovisioned device is provisioned successfully and becomes a node,
707                enabling this option will trigger the node starts to send Friend Request at
708                a certain period until it finds a proper Friend node.
709
710        config BLE_MESH_LPN_AUTO_TIMEOUT
711            int "Time from last received message before going to LPN mode"
712            default 15
713            range 0 3600
714            depends on BLE_MESH_LPN_AUTO
715            help
716                Time in seconds from the last received message, that the node waits out
717                before starting to look for Friend nodes.
718
719        config BLE_MESH_LPN_RETRY_TIMEOUT
720            int "Retry timeout for Friend requests"
721            default 6
722            range 1 3600
723            help
724                Time in seconds between Friend Requests, if a previous Friend Request did
725                not yield any acceptable Friend Offers.
726
727        config BLE_MESH_LPN_RSSI_FACTOR
728            int "RSSIFactor, used in Friend Offer Delay calculation"
729            range 0 3
730            default 0
731            help
732                The contribution of the RSSI, measured by the Friend node, used in Friend
733                Offer Delay calculations. 0 = 1, 1 = 1.5, 2 = 2, 3 = 2.5.
734                RSSIFactor, one of the parameters carried by Friend Request sent by Low Power
735                node, which is used to calculate the Friend Offer Delay.
736
737        config BLE_MESH_LPN_RECV_WIN_FACTOR
738            int "ReceiveWindowFactor, used in Friend Offer Delay calculation"
739            range 0 3
740            default 0
741            help
742                The contribution of the supported Receive Window used in Friend Offer
743                Delay calculations. 0 = 1, 1 = 1.5, 2 = 2, 3 = 2.5.
744                ReceiveWindowFactor, one of the parameters carried by Friend Request sent by
745                Low Power node, which is used to calculate the Friend Offer Delay.
746
747        config BLE_MESH_LPN_MIN_QUEUE_SIZE
748            int "Minimum size of the acceptable friend queue (MinQueueSizeLog)"
749            range 1 7
750            default 1
751            help
752                The MinQueueSizeLog field is defined as log_2(N), where N is the minimum
753                number of maximum size Lower Transport PDUs that the Friend node can store
754                in its Friend Queue. As an example, MinQueueSizeLog value 1 gives N = 2,
755                and value 7 gives N = 128.
756
757        config BLE_MESH_LPN_RECV_DELAY
758            int "Receive delay requested by the local node"
759            range 10 255
760            default 100
761            help
762                The ReceiveDelay is the time between the Low Power node sending a
763                request and listening for a response. This delay allows the Friend
764                node time to prepare the response. The value is in units of milliseconds.
765
766        config BLE_MESH_LPN_POLL_TIMEOUT
767            int "The value of the PollTimeout timer"
768            range 10 244735
769            default 300
770            help
771                PollTimeout timer is used to measure time between two consecutive
772                requests sent by a Low Power node. If no requests are received
773                the Friend node before the PollTimeout timer expires, then the
774                friendship is considered terminated. The value is in units of 100
775                milliseconds, so e.g. a value of 300 means 30 seconds.
776                The smaller the value, the faster the Low Power node tries to get
777                messages from corresponding Friend node and vice versa.
778
779        config BLE_MESH_LPN_INIT_POLL_TIMEOUT
780            int "The starting value of the PollTimeout timer"
781            range 10 BLE_MESH_LPN_POLL_TIMEOUT
782            default BLE_MESH_LPN_POLL_TIMEOUT
783            help
784                The initial value of the PollTimeout timer when Friendship is to be
785                established for the first time. After this, the timeout gradually
786                grows toward the actual PollTimeout, doubling in value for each iteration.
787                The value is in units of 100 milliseconds, so e.g. a value of 300 means
788                30 seconds.
789
790        config BLE_MESH_LPN_SCAN_LATENCY
791            int "Latency for enabling scanning"
792            range 0 50
793            default 10
794            help
795                Latency (in milliseconds) is the time it takes to enable scanning. In
796                practice, it means how much time in advance of the Receive Window, the
797                request to enable scanning is made.
798
799        config BLE_MESH_LPN_GROUPS
800            int "Number of groups the LPN can subscribe to"
801            range 0 16384
802            default 8
803            help
804                Maximum number of groups to which the LPN can subscribe.
805
806    endif # BLE_MESH_LOW_POWER
807
808    config BLE_MESH_FRIEND
809        bool "Support for Friend feature"
810        help
811            Enable this option to be able to act as a Friend Node.
812
813    if BLE_MESH_FRIEND
814
815        config BLE_MESH_FRIEND_RECV_WIN
816            int "Friend Receive Window"
817            range 1 255
818            default 255
819            help
820                Receive Window in milliseconds supported by the Friend node.
821
822        config BLE_MESH_FRIEND_QUEUE_SIZE
823            int "Minimum number of buffers supported per Friend Queue"
824            range 2 65536
825            default 16
826            help
827                Minimum number of buffers available to be stored for each local Friend Queue.
828                This option decides the size of each buffer which can be used by a Friend node
829                to store messages for each Low Power node.
830
831        config BLE_MESH_FRIEND_SUB_LIST_SIZE
832            int "Friend Subscription List Size"
833            range 0 1023
834            default 3
835            help
836                Size of the Subscription List that can be supported by a Friend node for a
837                Low Power node. And Low Power node can send Friend Subscription List Add or
838                Friend Subscription List Remove messages to the Friend node to add or remove
839                subscription addresses.
840
841        config BLE_MESH_FRIEND_LPN_COUNT
842            int "Number of supported LPN nodes"
843            range 1 1000
844            default 2
845            help
846                Number of Low Power Nodes with which a Friend can have Friendship simultaneously.
847                A Friend node can have friendship with multiple Low Power nodes at the same time,
848                while a Low Power node can only establish friendship with only one Friend node at
849                the same time.
850
851        config BLE_MESH_FRIEND_SEG_RX
852            int "Number of incomplete segment lists per LPN"
853            range 1 1000
854            default 1
855            help
856                Number of incomplete segment lists tracked for each Friends' LPN.
857                In other words, this determines from how many elements can segmented
858                messages destined for the Friend queue be received simultaneously.
859
860    endif # BLE_MESH_FRIEND
861
862    config BLE_MESH_NO_LOG
863        bool "Disable BLE Mesh debug logs (minimize bin size)"
864        depends on BLE_MESH
865        default n
866        help
867            Select this to save the BLE Mesh related rodata code size. Enabling this option
868            will disable the output of BLE Mesh debug log.
869
870    menu "BLE Mesh STACK DEBUG LOG LEVEL"
871        depends on BLE_MESH && !BLE_MESH_NO_LOG
872
873        choice BLE_MESH_STACK_TRACE_LEVEL
874            prompt "BLE_MESH_STACK"
875            default BLE_MESH_TRACE_LEVEL_WARNING
876            depends on BLE_MESH && !BLE_MESH_NO_LOG
877            help
878                Define BLE Mesh trace level for BLE Mesh stack.
879
880            config BLE_MESH_TRACE_LEVEL_NONE
881                bool "NONE"
882            config BLE_MESH_TRACE_LEVEL_ERROR
883                bool "ERROR"
884            config BLE_MESH_TRACE_LEVEL_WARNING
885                bool "WARNING"
886            config BLE_MESH_TRACE_LEVEL_INFO
887                bool "INFO"
888            config BLE_MESH_TRACE_LEVEL_DEBUG
889                bool "DEBUG"
890            config BLE_MESH_TRACE_LEVEL_VERBOSE
891                bool "VERBOSE"
892        endchoice
893
894        config BLE_MESH_STACK_TRACE_LEVEL
895            int
896            depends on BLE_MESH
897            default 0 if BLE_MESH_TRACE_LEVEL_NONE
898            default 1 if BLE_MESH_TRACE_LEVEL_ERROR
899            default 2 if BLE_MESH_TRACE_LEVEL_WARNING
900            default 3 if BLE_MESH_TRACE_LEVEL_INFO
901            default 4 if BLE_MESH_TRACE_LEVEL_DEBUG
902            default 5 if BLE_MESH_TRACE_LEVEL_VERBOSE
903            default 2
904
905    endmenu #BLE Mesh DEBUG LOG LEVEL
906
907    menu "BLE Mesh NET BUF DEBUG LOG LEVEL"
908        depends on BLE_MESH && !BLE_MESH_NO_LOG
909
910        choice BLE_MESH_NET_BUF_TRACE_LEVEL
911            prompt "BLE_MESH_NET_BUF"
912            default BLE_MESH_NET_BUF_TRACE_LEVEL_WARNING
913            depends on BLE_MESH && !BLE_MESH_NO_LOG
914            help
915                Define BLE Mesh trace level for BLE Mesh net buffer.
916
917            config BLE_MESH_NET_BUF_TRACE_LEVEL_NONE
918                bool "NONE"
919            config BLE_MESH_NET_BUF_TRACE_LEVEL_ERROR
920                bool "ERROR"
921            config BLE_MESH_NET_BUF_TRACE_LEVEL_WARNING
922                bool "WARNING"
923            config BLE_MESH_NET_BUF_TRACE_LEVEL_INFO
924                bool "INFO"
925            config BLE_MESH_NET_BUF_TRACE_LEVEL_DEBUG
926                bool "DEBUG"
927            config BLE_MESH_NET_BUF_TRACE_LEVEL_VERBOSE
928                bool "VERBOSE"
929        endchoice
930
931        config BLE_MESH_NET_BUF_TRACE_LEVEL
932            int
933            depends on BLE_MESH
934            default 0 if BLE_MESH_NET_BUF_TRACE_LEVEL_NONE
935            default 1 if BLE_MESH_NET_BUF_TRACE_LEVEL_ERROR
936            default 2 if BLE_MESH_NET_BUF_TRACE_LEVEL_WARNING
937            default 3 if BLE_MESH_NET_BUF_TRACE_LEVEL_INFO
938            default 4 if BLE_MESH_NET_BUF_TRACE_LEVEL_DEBUG
939            default 5 if BLE_MESH_NET_BUF_TRACE_LEVEL_VERBOSE
940            default 2
941
942    endmenu #BLE Mesh NET BUF DEBUG LOG LEVEL
943
944    config BLE_MESH_CLIENT_MSG_TIMEOUT
945        int "Timeout(ms) for client message response"
946        range 100 1200000
947        default 4000
948        help
949            Timeout value used by the node to get response of the acknowledged
950            message which is sent by the client model.
951            This value indicates the maximum time that a client model waits for
952            the response of the sent acknowledged messages. If a client model
953            uses 0 as the timeout value when sending acknowledged messages, then
954            the default value will be used which is four seconds.
955
956    menu "Support for BLE Mesh Foundation models"
957
958        config BLE_MESH_CFG_CLI
959            bool "Configuration Client model"
960            help
961                Enable support for Configuration Client model.
962
963        config BLE_MESH_HEALTH_CLI
964            bool "Health Client model"
965            help
966                Enable support for Health Client model.
967
968        config BLE_MESH_HEALTH_SRV
969            bool "Health Server model"
970            default y
971            help
972                Enable support for Health Server model.
973
974    endmenu #Support for BLE Mesh Foundation models
975
976    menu "Support for BLE Mesh Client/Server models"
977
978        config BLE_MESH_GENERIC_ONOFF_CLI
979            bool "Generic OnOff Client model"
980            help
981                Enable support for Generic OnOff Client model.
982
983        config BLE_MESH_GENERIC_LEVEL_CLI
984            bool "Generic Level Client model"
985            help
986                Enable support for Generic Level Client model.
987
988        config BLE_MESH_GENERIC_DEF_TRANS_TIME_CLI
989            bool "Generic Default Transition Time Client model"
990            help
991                Enable support for Generic Default Transition Time Client model.
992
993        config BLE_MESH_GENERIC_POWER_ONOFF_CLI
994            bool "Generic Power OnOff Client model"
995            help
996                Enable support for Generic Power OnOff Client model.
997
998        config BLE_MESH_GENERIC_POWER_LEVEL_CLI
999            bool "Generic Power Level Client model"
1000            help
1001                Enable support for Generic Power Level Client model.
1002
1003        config BLE_MESH_GENERIC_BATTERY_CLI
1004            bool "Generic Battery Client model"
1005            help
1006                Enable support for Generic Battery Client model.
1007
1008        config BLE_MESH_GENERIC_LOCATION_CLI
1009            bool "Generic Location Client model"
1010            help
1011                Enable support for Generic Location Client model.
1012
1013        config BLE_MESH_GENERIC_PROPERTY_CLI
1014            bool "Generic Property Client model"
1015            help
1016                Enable support for Generic Property Client model.
1017
1018        config BLE_MESH_SENSOR_CLI
1019            bool "Sensor Client model"
1020            help
1021                Enable support for Sensor Client model.
1022
1023        config BLE_MESH_TIME_CLI
1024            bool "Time Client model"
1025            help
1026                Enable support for Time Client model.
1027
1028        config BLE_MESH_SCENE_CLI
1029            bool "Scene Client model"
1030            help
1031                Enable support for Scene Client model.
1032
1033        config BLE_MESH_SCHEDULER_CLI
1034            bool "Scheduler Client model"
1035            help
1036                Enable support for Scheduler Client model.
1037
1038        config BLE_MESH_LIGHT_LIGHTNESS_CLI
1039            bool "Light Lightness Client model"
1040            help
1041                Enable support for Light Lightness Client model.
1042
1043        config BLE_MESH_LIGHT_CTL_CLI
1044            bool "Light CTL Client model"
1045            help
1046                Enable support for Light CTL Client model.
1047
1048        config BLE_MESH_LIGHT_HSL_CLI
1049            bool "Light HSL Client model"
1050            help
1051                Enable support for Light HSL Client model.
1052
1053        config BLE_MESH_LIGHT_XYL_CLI
1054            bool "Light XYL Client model"
1055            help
1056                Enable support for Light XYL Client model.
1057
1058        config BLE_MESH_LIGHT_LC_CLI
1059            bool "Light LC Client model"
1060            help
1061                Enable support for Light LC Client model.
1062
1063        config BLE_MESH_GENERIC_SERVER
1064            bool "Generic server models"
1065            default y
1066            help
1067                Enable support for Generic server models.
1068
1069        config BLE_MESH_SENSOR_SERVER
1070            bool "Sensor server models"
1071            default y
1072            help
1073                Enable support for Sensor server models.
1074
1075        config BLE_MESH_TIME_SCENE_SERVER
1076            bool "Time and Scenes server models"
1077            default y
1078            help
1079                Enable support for Time and Scenes server models.
1080
1081        config BLE_MESH_LIGHTING_SERVER
1082            bool "Lighting server models"
1083            default y
1084            help
1085                Enable support for Lighting server models.
1086
1087    endmenu #Support for BLE Mesh Client/Server models
1088
1089    config BLE_MESH_IV_UPDATE_TEST
1090        bool "Test the IV Update Procedure"
1091        default n
1092        help
1093            This option removes the 96 hour limit of the IV Update Procedure and
1094            lets the state to be changed at any time.
1095            If IV Update test mode is going to be used, this option should be enabled.
1096
1097    menu "BLE Mesh specific test option"
1098
1099        config BLE_MESH_SELF_TEST
1100            bool "Perform BLE Mesh self-tests"
1101            default n
1102            help
1103                This option adds extra self-tests which are run every time BLE Mesh
1104                networking is initialized.
1105
1106        if BLE_MESH_SELF_TEST
1107
1108            config BLE_MESH_TEST_AUTO_ENTER_NETWORK
1109                bool "Unprovisioned device enters mesh network automatically"
1110                default y
1111                help
1112                    With this option enabled, an unprovisioned device can automatically
1113                    enters mesh network using a specific test function without the pro-
1114                    visioning procedure. And on the Provisioner side, a test function
1115                    needs to be invoked to add the node information into the mesh stack.
1116
1117            config BLE_MESH_TEST_USE_WHITE_LIST
1118                bool "Use white list to filter mesh advertising packets"
1119                default n
1120                help
1121                    With this option enabled, users can use white list to filter mesh
1122                    advertising packets while scanning.
1123
1124        endif # BLE_MESH_SELF_TEST
1125
1126        config BLE_MESH_SHELL
1127            bool "Enable BLE Mesh shell"
1128            default n
1129            help
1130                Activate shell module that provides BLE Mesh commands to the console.
1131
1132        config BLE_MESH_DEBUG
1133            bool "Enable BLE Mesh debug logs"
1134            default n
1135            help
1136                Enable debug logs for the BLE Mesh functionality.
1137
1138        if BLE_MESH_DEBUG
1139
1140            config BLE_MESH_DEBUG_NET
1141                bool "Network layer debug"
1142                help
1143                    Enable Network layer debug logs for the BLE Mesh functionality.
1144
1145            config BLE_MESH_DEBUG_TRANS
1146                bool "Transport layer debug"
1147                help
1148                    Enable Transport layer debug logs for the BLE Mesh functionality.
1149
1150            config BLE_MESH_DEBUG_BEACON
1151                bool "Beacon debug"
1152                help
1153                    Enable Beacon-related debug logs for the BLE Mesh functionality.
1154
1155            config BLE_MESH_DEBUG_CRYPTO
1156                bool "Crypto debug"
1157                help
1158                    Enable cryptographic debug logs for the BLE Mesh functionality.
1159
1160            config BLE_MESH_DEBUG_PROV
1161                bool "Provisioning debug"
1162                help
1163                    Enable Provisioning debug logs for the BLE Mesh functionality.
1164
1165            config BLE_MESH_DEBUG_ACCESS
1166                bool "Access layer debug"
1167                help
1168                    Enable Access layer debug logs for the BLE Mesh functionality.
1169
1170            config BLE_MESH_DEBUG_MODEL
1171                bool "Foundation model debug"
1172                help
1173                    Enable Foundation Models debug logs for the BLE Mesh functionality.
1174
1175            config BLE_MESH_DEBUG_ADV
1176                bool "Advertising debug"
1177                help
1178                    Enable advertising debug logs for the BLE Mesh functionality.
1179
1180            config BLE_MESH_DEBUG_LOW_POWER
1181                bool "Low Power debug"
1182                help
1183                    Enable Low Power debug logs for the BLE Mesh functionality.
1184
1185            config BLE_MESH_DEBUG_FRIEND
1186                bool "Friend debug"
1187                help
1188                    Enable Friend debug logs for the BLE Mesh functionality.
1189
1190            config BLE_MESH_DEBUG_PROXY
1191                bool "Proxy debug"
1192                depends on BLE_MESH_PROXY
1193                help
1194                    Enable Proxy protocol debug logs for the BLE Mesh functionality.
1195
1196        endif # BLE_MESH_DEBUG
1197
1198    endmenu
1199
1200endif # BLE_MESH
1201