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