1.. _bluetooth_mesh_shell:
2
3Bluetooth Mesh Shell
4####################
5
6The Bluetooth Mesh shell subsystem provides a set of Bluetooth Mesh shell commands for the
7:ref:`shell_api` module. It allows for testing and exploring the Bluetooth Mesh API through an
8interactive interface, without having to write an application.
9
10The Bluetooth Mesh shell interface provides access to most Bluetooth Mesh features, including
11provisioning, configuration, and message sending.
12
13Prerequisites
14*************
15
16The Bluetooth Mesh shell subsystem depends on the application to create the composition data and do
17the mesh initialization.
18
19Application
20***********
21
22The Bluetooth Mesh shell subsystem is most easily used through the Bluetooth Mesh shell application
23under ``tests/bluetooth/mesh_shell``. See :ref:`shell_api` for information on how to connect and
24interact with the Bluetooth Mesh shell application.
25
26Basic usage
27***********
28
29The Bluetooth Mesh shell subsystem adds a single ``mesh`` command, which holds a set of
30sub-commands. Every time the device boots up, make sure to call ``mesh init`` before any of the
31other Bluetooth Mesh shell commands can be called::
32
33	uart:~$ mesh init
34
35This is done to ensure that all available log will be printed to the shell output.
36
37Provisioning
38============
39
40The mesh node must be provisioned to become part of the network. This is only necessary the first
41time the device boots up, as the device will remember its provisioning data between reboots.
42
43The simplest way to provision the device is through self-provisioning. To do this the user must
44provision the device with the default network key and address ``0x0001``, execute::
45
46	uart:~$ mesh prov local 0 0x0001
47
48Since all mesh nodes use the same values for the default network key, this can be done on multiple
49devices, as long as they're assigned non-overlapping unicast addresses. Alternatively, to provision
50the device into an existing network, the unprovisioned beacon can be enabled with
51``mesh prov pb-adv on`` or ``mesh prov pb-gatt on``. The beacons can be picked up by an external
52provisioner, which can provision the node into its network.
53
54Once the mesh node is part of a network, its transmission parameters can be controlled by the
55general configuration commands:
56
57* To set the destination address, call ``mesh target dst <Addr>``.
58* To set the network key index, call ``mesh target net <NetKeyIdx>``.
59* To set the application key index, call ``mesh target app <AppKeyIdx>``.
60
61By default, the transmission parameters are set to send messages to the provisioned address and
62network key.
63
64Configuration
65=============
66
67By setting the destination address to the local unicast address (``0x0001`` in the
68``mesh prov local`` command above), we can perform self-configuration through any of the
69:ref:`bluetooth_mesh_shell_cfg_cli` commands.
70
71A good first step is to read out the node's own composition data::
72
73	uart:~$ mesh models cfg get-comp
74
75This prints a list of the composition data of the node, including a list of its model IDs.
76
77Next, since the device has no application keys by default, it's a good idea to add one::
78
79	uart:~$ mesh models cfg appkey add 0 0
80
81Message sending
82===============
83
84With an application key added (see above), the mesh node's transition parameters are all valid, and
85the Bluetooth Mesh shell can send raw mesh messages through the network.
86
87For example, to send a Generic OnOff Set message, call::
88
89	uart:~$ mesh test net-send 82020100
90
91.. note::
92	All multibyte fields model messages are in little endian, except the opcode.
93
94The message will be sent to the current destination address, using the current network and
95application key indexes. As the destination address points to the local unicast address by default,
96the device will only send packets to itself. To change the destination address to the All Nodes
97broadcast address, call::
98
99	uart:~$ mesh target dst 0xffff
100
101With the destination address set to ``0xffff``, any other mesh nodes in the network with the
102configured network and application keys will receive and process the messages we send.
103
104.. note::
105	To change the configuration of the device, the destination address must be set back to the
106	local unicast address before issuing any configuration commands.
107
108Sending raw mesh packets is a good way to test model message handler implementations during
109development, as it can be done without having to implement the sending model. By default, only the
110reception of the model messages can be tested this way, as the Bluetooth Mesh shell only includes
111the foundation models. To receive a packet in the mesh node, you have to add a model with a valid
112opcode handler list to the composition data in ``subsys/bluetooth/mesh/shell.c``, and print the
113incoming message to the shell in the handler callback.
114
115Parameter formats
116*****************
117
118The Bluetooth Mesh shell commands are parsed with a variety of formats:
119
120.. list-table:: Parameter formats
121	:widths: 1 4 2
122	:header-rows: 1
123
124	* - Type
125	  - Description
126	  - Example
127	* - Integers
128	  - The default format unless something else is specified. Can be either decimal or
129	    hexadecimal.
130	  - ``1234``, ``0xabcd01234``
131	* - Hexstrings
132	  - For raw byte arrays, like UUIDs, key values and message payloads, the parameters should
133	    be formatted as an unbroken string of hexadecimal values without any prefix.
134	  - ``deadbeef01234``
135	* - Booleans
136	  - Boolean values are denoted in the API documentation as ``<val(off, on)>``.
137	  - ``on``, ``off``, ``enabled``, ``disabled``, ``1``, ``0``
138
139Commands
140********
141
142The Bluetooth Mesh shell implements a large set of commands. Some of the commands accept parameters,
143which are mentioned in brackets after the command name. For example,
144``mesh lpn set <value: off, on>``. Mandatory parameters are marked with angle brackets (e.g.
145``<NetKeyIdx>``), and optional parameters are marked with square brackets (e.g. ``[DstAddr]``).
146
147The Bluetooth Mesh shell commands are divided into the following groups:
148
149.. contents::
150	:depth: 1
151	:local:
152
153.. note::
154	Some commands depend on specific features being enabled in the compile time configuration of
155	the application. Not all features are enabled by default. The list of available Bluetooth
156	mesh shell commands can be shown in the shell by calling ``mesh`` without any arguments.
157
158General configuration
159=====================
160
161``mesh init``
162-------------
163
164	Initialize the mesh shell. This command must be run before any other mesh command.
165
166``mesh reset-local``
167--------------------
168
169	Reset the local mesh node to its initial unprovisioned state. This command will also clear
170	the Configuration Database (CDB) if present.
171
172Target
173======
174
175The target commands enables the user to monitor and set the target destination address, network
176index and application index for the shell. These parameters are used by several commands, like
177provisioning, Configuration Client, etc.
178
179``mesh target dst [DstAddr]``
180-----------------------------
181
182	Get or set the message destination address. The destination address determines where mesh
183	packets are sent with the shell, but has no effect on modules outside the shell's control.
184
185	* ``DstAddr``: If present, sets the new 16-bit mesh destination address. If omitted, the current destination address is printed.
186
187
188``mesh target net [NetKeyIdx]``
189-------------------------------
190
191	Get or set the message network index. The network index determines which network key is used
192	to encrypt mesh packets that are sent with the shell, but has no effect on modules outside
193	the shell's control. The network key must already be added to the device, either through
194	provisioning or by a Configuration Client.
195
196	* ``NetKeyIdx``: If present, sets the new network index. If omitted, the current network index is printed.
197
198
199``mesh target app [AppKeyIdx]``
200-------------------------------
201
202	Get or set the message application index. The application index determines which application
203	key is used to encrypt mesh packets that are sent with the shell, but has no effect on
204	modules outside the shell's control. The application key must already be added to the device
205	by a Configuration Client, and must be bound to the current network index.
206
207	* ``AppKeyIdx``: If present, sets the new application index. If omitted, the current application index is printed.
208
209
210Low Power Node
211==============
212
213``mesh lpn set <Val(off, on)>``
214-------------------------------
215
216	Enable or disable Low Power operation. Once enabled, the device will turn off its radio and
217	start polling for friend nodes.
218
219	* ``Val``: Sets whether Low Power operation is enabled.
220
221``mesh lpn poll``
222-----------------
223
224	Perform a poll to the friend node, to receive any pending messages. Only available when LPN
225	is enabled.
226
227Testing
228=======
229
230``mesh test net-send <HexString>``
231-----------------------------------
232
233	Send a raw mesh message with the current destination address, network and application index.
234	The message opcode must be encoded manually.
235
236	* ``HexString`` Raw hexadecimal representation of the message to send.
237
238``mesh test iv-update``
239-----------------------
240
241	Force an IV update.
242
243
244``mesh test iv-update-test <Val(off, on)>``
245-------------------------------------------
246
247	Set the IV update test mode. In test mode, the IV update timing requirements are bypassed.
248
249	* ``Val``: Enable or disable the IV update test mode.
250
251
252``mesh test rpl-clear``
253-----------------------
254
255	Clear the replay protection list, forcing the node to forget all received messages.
256
257.. warning::
258
259	Clearing the replay protection list breaks the security mechanisms of the mesh node, making
260	it susceptible to message replay attacks. This should never be performed in a real
261	deployment.
262
263Health Server Test
264------------------
265
266``mesh test health-srv add-fault <FaultID>``
267^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
268
269	Register a new Health Server Fault for the Linux Foundation Company ID.
270
271	* ``FaultID``: ID of the fault to register (``0x0001`` to ``0xFFFF``)
272
273
274``mesh test health-srv del-fault [FaultID]``
275^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
276
277	Remove registered Health Server faults for the Linux Foundation Company ID.
278
279	* ``FaultID``: If present, the given fault ID will be deleted. If omitted, all registered faults will be cleared.
280
281Provisioning
282============
283
284To allow a device to broadcast connectable unprovisioned beacons, the
285:kconfig:option:`CONFIG_BT_MESH_PROVISIONEE` configuration option must be enabled, along with the
286:kconfig:option:`CONFIG_BT_MESH_PB_GATT` option.
287
288``mesh prov pb-gatt <Val(off, on)>``
289------------------------------------
290
291	Start or stop advertising a connectable unprovisioned beacon. The connectable unprovisioned
292	beacon allows the mesh node to be discovered by nearby GATT based provisioners, and
293	provisioned through the GATT bearer.
294
295	* ``Val``: Enable or disable provisioning with GATT
296
297To allow a device to broadcast unprovisioned beacons, the
298:kconfig:option:`CONFIG_BT_MESH_PROVISIONEE` configuration option must be enabled, along with the
299:kconfig:option:`CONFIG_BT_MESH_PB_ADV` option.
300
301``mesh prov pb-adv <Val(off, on)>``
302-----------------------------------
303
304	Start or stop advertising the unprovisioned beacon. The unprovisioned beacon allows the mesh
305	node to be discovered by nearby advertising-based provisioners, and provisioned through the
306	advertising bearer.
307
308	* ``Val``: Enable or disable provisioning with advertiser
309
310To allow a device to provision devices, the :kconfig:option:`CONFIG_BT_MESH_PROVISIONER` and
311:kconfig:option:`CONFIG_BT_MESH_PB_ADV` configuration options must be enabled.
312
313``mesh prov remote-adv <UUID(1-16 hex)> <NetKeyIdx> <Addr> <AttDur(s)>``
314-----------------------------------------------------------------------------------
315
316	Provision a nearby device into the mesh. The mesh node starts scanning for unprovisioned
317	beacons with the given UUID. Once found, the unprovisioned device will be added to the mesh
318	network with the given unicast address, and given the network key indicated by
319	``NetKeyIdx``.
320
321	* ``UUID``: UUID of the unprovisioned device. Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest.
322	* ``NetKeyIdx``: Index of the network key to pass to the device.
323	* ``Addr``: First unicast address to assign to the unprovisioned device. The device will occupy as many addresses as it has elements, and all must be available.
324	* ``AttDur``: The duration in seconds the unprovisioned device will identify itself for, if supported. See :ref:`bluetooth_mesh_models_health_srv_attention` for details.
325
326To allow a device to provision devices over GATT, the :kconfig:option:`CONFIG_BT_MESH_PROVISIONER`
327and :kconfig:option:`CONFIG_BT_MESH_PB_GATT_CLIENT` configuration options must be enabled.
328
329``mesh prov remote-gatt <UUID(1-16 hex)> <NetKeyIdx> <Addr> <AttDur(s)>``
330-------------------------------------------------------------------------
331
332	Provision a nearby device into the mesh. The mesh node starts scanning for connectable
333	advertising for PB-GATT with the given UUID. Once found, the unprovisioned device will be
334	added to the mesh network with the given unicast address, and given the network key
335	indicated by ``NetKeyIdx``.
336
337	* ``UUID``: UUID of the unprovisioned device. Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest.
338	* ``NetKeyIdx``: Index of the network key to pass to the device.
339	* ``Addr``: First unicast address to assign to the unprovisioned device. The device will occupy as many addresses as it has elements, and all must be available.
340	* ``AttDur``: The duration in seconds the unprovisioned device will identify itself for, if supported. See :ref:`bluetooth_mesh_models_health_srv_attention` for details.
341
342``mesh prov uuid [UUID(1-16 hex)]``
343-----------------------------------
344
345	Get or set the mesh node's UUID, used in the unprovisioned beacons.
346
347	* ``UUID``: If present, new 128-bit UUID value. Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest. If omitted, the current UUID will be printed. To enable this command, the :kconfig:option:`CONFIG_BT_MESH_SHELL_PROV_CTX_INSTANCE` option must be enabled.
348
349
350``mesh prov input-num <Number>``
351--------------------------------
352
353	Input a numeric OOB authentication value. Only valid when prompted by the shell during
354	provisioning. The input number must match the number presented by the other participant in
355	the provisioning.
356
357	* ``Number``: Decimal authentication number.
358
359
360``mesh prov input-str <String>``
361--------------------------------
362
363	Input an alphanumeric OOB authentication value. Only valid when prompted by the shell during
364	provisioning. The input string must match the string presented by the other participant in
365	the provisioning.
366
367	* ``String``: Unquoted alphanumeric authentication string.
368
369
370``mesh prov static-oob [Val(1-32 hex)]``
371----------------------------------------
372
373	Set or clear the static OOB authentication value. The static OOB authentication value must
374	be set before provisioning starts to have any effect. The static OOB value must be same on
375	both participants in the provisioning. To enable this command, the
376	:kconfig:option:`CONFIG_BT_MESH_SHELL_PROV_CTX_INSTANCE` option must be enabled.
377
378	* ``Val``: If present, indicates the new hexadecimal value of the static OOB. Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest. If omitted, the static OOB value is cleared.
379
380
381``mesh prov local <NetKeyIdx> <Addr> [IVI]``
382--------------------------------------------
383
384	Provision the mesh node itself. If the Configuration database is enabled, the network key
385	must be created. Otherwise, the default key value is used.
386
387	* ``NetKeyIdx``: Index of the network key to provision.
388	* ``Addr``: First unicast address to assign to the device. The device will occupy as many addresses as it has elements, and all must be available.
389	* ``IVI``: Indicates the current network IV index. Defaults to 0 if omitted.
390
391
392``mesh prov beacon-listen <Val(off, on)>``
393------------------------------------------
394
395	Enable or disable printing of incoming unprovisioned beacons. Allows a provisioner device to
396	detect nearby unprovisioned devices and provision them. To enable this command, the
397	:kconfig:option:`CONFIG_BT_MESH_SHELL_PROV_CTX_INSTANCE` option must be enabled.
398
399	* ``Val``: Whether to enable the unprovisioned beacon printing.
400
401``mesh prov remote-pub-key <PubKey>``
402-------------------------------------
403	Provide Device public key.
404
405	* ``PubKey`` - Device public key in big-endian.
406
407``mesh prov auth-method input <Action> <Size>``
408-----------------------------------------------
409	From the provisioner device, instruct the unprovisioned device to use the specified Input
410	OOB authentication action.
411
412	* ``Action`` - Input action. Allowed values:
413
414		* ``0`` - No input action.
415		* ``1`` - Push action set.
416		* ``2`` - Twist action set.
417		* ``4`` - Enter number action set.
418		* ``8`` - Enter String action set.
419	* ``Size`` - Authentication size.
420
421``mesh prov auth-method output <Action> <Size>``
422------------------------------------------------
423	From the provisioner device, instruct the unprovisioned device to use the specified Output
424	OOB authentication action.
425
426	* ``Action`` - Output action. Allowed values:
427
428		* ``0`` - No output action.
429		* ``1`` - Blink action set.
430		* ``2`` - Vibrate action set.
431		* ``4`` - Display number action set.
432		* ``8`` - Display String action set.
433	* ``Size`` - Authentication size.
434
435``mesh prov auth-method static <Val(1-16 hex)>``
436------------------------------------------------
437	From the provisioner device, instruct the unprovisioned device to use static OOB
438	authentication, and use the given static authentication value when provisioning.
439
440	* ``Val`` - Static OOB value. Providing a hex-string shorter than 32 bytes will populate the N most significant bytes of the array and zero-pad the rest.
441
442``mesh prov auth-method none``
443------------------------------
444	From the provisioner device, don't use any authentication when provisioning new devices.
445	This is the default behavior.
446
447Proxy
448=====
449
450The Proxy Server module is an optional mesh subsystem that can be enabled through the
451:kconfig:option:`CONFIG_BT_MESH_GATT_PROXY` configuration option.
452
453``mesh proxy identity-enable``
454------------------------------
455
456	Enable the Proxy Node Identity beacon, allowing Proxy devices to connect explicitly to this
457	device. The beacon will run for 60 seconds before the node returns to normal Proxy beacons.
458
459The Proxy Client module is an optional mesh subsystem that can be enabled through the
460:kconfig:option:`CONFIG_BT_MESH_PROXY_CLIENT` configuration option.
461
462``mesh proxy connect <NetKeyIdx>``
463----------------------------------
464
465	Auto-Connect a nearby proxy server into the mesh.
466
467	* ``NetKeyIdx``: Index of the network key to connect.
468
469
470``mesh proxy disconnect <NetKeyIdx>``
471-------------------------------------
472
473	Disconnect the existing proxy connection.
474
475	* ``NetKeyIdx``: Index of the network key to disconnect.
476
477
478``mesh proxy solicit <NetKeyIdx>``
479----------------------------------
480
481	Begin Proxy Solicitation of a subnet. Support of this feature can be enabled through the
482	:kconfig:option:`CONFIG_BT_MESH_PROXY_SOLICITATION` configuration option.
483
484	* ``NetKeyIdx``: Index of the network key to send Solicitation PDUs to.
485
486.. _bluetooth_mesh_shell_cfg_cli:
487
488Models
489======
490
491Configuration Client
492--------------------
493
494The Configuration Client model is an optional mesh subsystem that can be enabled through the
495:kconfig:option:`CONFIG_BT_MESH_CFG_CLI` configuration option. This is implemented as a separate
496module (``mesh models cfg``) inside the ``mesh models`` subcommand list. This module will work on
497any instance of the Configuration Client model if the mentioned shell configuration options is
498enabled, and as long as the Configuration Client model is present in the model composition of the
499application. This shell module can be used for configuring itself and other nodes in the mesh
500network.
501
502The Configuration Client uses general message parameters set by ``mesh target dst`` and ``mesh
503target net`` to target specific nodes. When the Bluetooth Mesh shell node is provisioned, given that
504the :kconfig:option:`CONFIG_BT_MESH_SHELL_PROV_CTX_INSTANCE` option is enabled with the shell
505provisioning context initialized, the Configuration Client model targets itself by default.
506Similarly, when another node has been provisioned by the Bluetooth Mesh shell, the Configuration
507Client model targets the new node. In most common use-cases, the Configuration Client is depending
508on the provisioning features and the Configuration database to be fully functional. The
509Configuration Client always sends messages using the Device key bound to the destination address, so
510it will only be able to configure itself and the mesh nodes it provisioned. The following steps are
511an example of how you can set up a device to start using the Configuration Client commands:
512
513* Initialize the client node (``mesh init``).
514* Create the CDB (``mesh cdb create``).
515* Provision the local device (``mesh prov local``).
516* The shell module should now target itself.
517* Monitor the composition data of the local node (``mesh models cfg get-comp``).
518* Configure the local node as desired with the Configuration Client commands.
519* Provision other devices (``mesh prov beacon-listen``) (``mesh prov remote-adv``)
520  (``mesh prov remote-gatt``).
521* The shell module should now target the newly added node.
522* Monitor the newly provisioned nodes and their addresses (``mesh cdb show``).
523* Monitor the composition data of the target device (``mesh models cfg get-comp``).
524* Configure the node as desired with the Configuration Client commands.
525
526``mesh models cfg target get``
527^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
528
529	Get the target Configuration server for the Configuration Client model.
530
531``mesh models cfg help``
532^^^^^^^^^^^^^^^^^^^^^^^^
533
534	Print information for the Configuration Client shell module.
535
536``mesh models cfg reset``
537^^^^^^^^^^^^^^^^^^^^^^^^^
538
539	Reset the target device.
540
541``mesh models cfg timeout [Timeout(s)]``
542^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
543
544	Get and set the Config Client model timeout used during message sending.
545
546	* ``Timeout``: If present, set the Config Client model timeout in seconds. If omitted, the current timeout is printed.
547
548
549``mesh models cfg get-comp [Page]``
550^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
551
552	Read a composition data page. The full composition data page will be printed. If the target
553	does not have the given page, it will return the last page before it.
554
555	* ``Page``: The composition data page to request. Defaults to 0 if omitted.
556
557
558``mesh models cfg beacon [Val(off, on)]``
559^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
560
561	Get or set the network beacon transmission.
562
563	* ``Val``: If present, enables or disables sending of the network beacon. If omitted, the current network beacon state is printed.
564
565
566``mesh models cfg ttl [TTL]``
567^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
568
569	Get or set the default TTL value.
570
571	* ``TTL``: If present, sets the new default TTL value. Legal TTL values are 0x00 and 0x02-0x7f. If omitted, the current default TTL value is printed.
572
573
574``mesh models cfg friend [Val(off, on)]``
575^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
576
577	Get or set the Friend feature.
578
579	* ``Val``: If present, enables or disables the Friend feature. If omitted, the current Friend feature state is printed:
580
581		* ``0x00``: The feature is supported, but disabled.
582		* ``0x01``: The feature is enabled.
583		* ``0x02``: The feature is not supported.
584
585
586``mesh models cfg gatt-proxy [Val(off, on)]``
587^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
588
589	Get or set the GATT Proxy feature.
590
591	* ``Val``: If present, enables or disables the GATT Proxy feature. If omitted, the current GATT Proxy feature state is printed:
592
593		* ``0x00``: The feature is supported, but disabled.
594		* ``0x01``: The feature is enabled.
595		* ``0x02``: The feature is not supported.
596
597
598``mesh models cfg relay [<Val(off, on)> [<Count> [Int(ms)]]]``
599^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
600
601	Get or set the Relay feature and its parameters.
602
603	* ``Val``: If present, enables or disables the Relay feature. If omitted, the current Relay feature state is printed:
604
605		* ``0x00``: The feature is supported, but disabled.
606		* ``0x01``: The feature is enabled.
607		* ``0x02``: The feature is not supported.
608
609	* ``Count``: Sets the new relay retransmit count if ``val`` is ``on``. Ignored if ``val`` is ``off``. Legal retransmit count is 0-7. Defaults to ``2`` if omitted.
610	* ``Int``: Sets the new relay retransmit interval in milliseconds if ``val`` is ``on``.  Legal interval range is 10-320 milliseconds. Ignored if ``val`` is ``off``.  Defaults to ``20`` if omitted.
611
612``mesh models cfg node-id <NetKeyIdx> [Identity]``
613^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
614
615	Get or Set of current Node Identity state of a subnet.
616
617	* ``NetKeyIdx``: The network key index to Get/Set.
618	* ``Identity``: If present, sets the identity of Node Identity state.
619
620``mesh models cfg polltimeout-get <LPNAddr>``
621^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
622
623	Get current value of the PollTimeout timer of the LPN within a Friend node.
624
625	* ``LPNAddr`` Address of Low Power node.
626
627``mesh models cfg net-transmit-param [<Count> <Int(ms)>]``
628^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
629
630	Get or set the network transmit parameters.
631
632	* ``Count``: Sets the number of additional network transmits for every sent message. Legal retransmit count is 0-7.
633	* ``Int``: Sets the new network retransmit interval in milliseconds. Legal interval range is 10-320 milliseconds.
634
635
636``mesh models cfg netkey add <NetKeyIdx> [Key(1-16 hex)]``
637^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
638
639	Add a network key to the target node. Adds the key to the Configuration Database if enabled.
640
641	* ``NetKeyIdx``: The network key index to add.
642	* ``Key``: If present, sets the key value as a 128-bit hexadecimal value. Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest. Only valid if the key does not already exist in the Configuration Database. If omitted, the default key value is used.
643
644
645``mesh models cfg netkey upd <NetKeyIdx> [Key(1-16 hex)]``
646^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
647
648	Update a network key to the target node.
649
650	* ``NetKeyIdx``: The network key index to updated.
651	* ``Key``: If present, sets the key value as a 128-bit hexadecimal value. Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest. If omitted, the default key value is used.
652
653``mesh models cfg netkey get``
654^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
655
656	Get a list of known network key indexes.
657
658
659``mesh models cfg netkey del <NetKeyIdx>``
660^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
661
662	Delete a network key from the target node.
663
664	* ``NetKeyIdx``: The network key index to delete.
665
666
667``mesh models cfg appkey add <NetKeyIdx> <AppKeyIdx> [Key(1-16 hex)]``
668^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
669
670	Add an application key to the target node. Adds the key to the Configuration Database if
671	enabled.
672
673	* ``NetKeyIdx``: The network key index the application key is bound to.
674	* ``AppKeyIdx``: The application key index to add.
675	* ``Key``: If present, sets the key value as a 128-bit hexadecimal value. Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest. Only valid if the key does not already exist in the Configuration Database. If omitted, the default key value is used.
676
677``mesh models cfg appkey upd <NetKeyIdx> <AppKeyIdx> [Key(1-16 hex)]``
678^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
679
680	Update an application key to the target node.
681
682	* ``NetKeyIdx``: The network key index the application key is bound to.
683	* ``AppKeyIdx``: The application key index to update.
684	* ``Key``: If present, sets the key value as a 128-bit hexadecimal value. Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest. If omitted, the default key value is used.
685
686``mesh models cfg appkey get <NetKeyIdx>``
687^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
688
689	Get a list of known application key indexes bound to the given network key index.
690
691	* ``NetKeyIdx``: Network key indexes to get a list of application key indexes from.
692
693
694``mesh models cfg appkey del <NetKeyIdx> <AppKeyIdx>``
695^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
696
697	Delete an application key from the target node.
698
699	* ``NetKeyIdx``: The network key index the application key is bound to.
700	* ``AppKeyIdx``: The application key index to delete.
701
702
703``mesh models cfg model app-bind <Addr> <AppKeyIdx> <MID> [CID]``
704^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
705
706	Bind an application key to a model. Models can only encrypt and decrypt messages sent with
707	application keys they are bound to.
708
709	* ``Addr``: Address of the element the model is on.
710	* ``AppKeyIdx``: The application key to bind to the model.
711	* ``MID``: The model ID of the model to bind the key to.
712	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.
713
714
715``mesh models cfg model app-unbind <Addr> <AppKeyIdx> <MID> [CID]``
716^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
717
718	Unbind an application key from a model.
719
720	* ``Addr``: Address of the element the model is on.
721	* ``AppKeyIdx``: The application key to unbind from the model.
722	* ``MID``: The model ID of the model to unbind the key from.
723	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.
724
725
726``mesh models cfg model app-get <ElemAddr> <MID> [CID]``
727^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
728
729	Get a list of application keys bound to a model.
730
731	* ``ElemAddr``: Address of the element the model is on.
732	* ``MID``: The model ID of the model to get the bound keys of.
733	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.
734
735
736``mesh models cfg model pub <Addr> <MID> [CID] [<PubAddr> <AppKeyIdx> <Cred(off, on)> <TTL> <PerRes> <PerSteps> <Count> <Int(ms)>]``
737^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
738
739	Get or set the publication parameters of a model. If all publication parameters are
740	included, they become the new publication parameters of the model.  If all publication
741	parameters are omitted, print the current publication parameters of the model.
742
743	* ``Addr``: Address of the element the model is on.
744	* ``MID``: The model ID of the model to get the bound keys of.
745	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.
746
747	Publication parameters:
748
749		* ``PubAddr``: The destination address to publish to.
750		* ``AppKeyIdx``: The application key index to publish with.
751		* ``Cred``: Whether to publish with Friendship credentials when acting as a Low Power Node.
752		* ``TTL``: TTL value to publish with (``0x00`` to ``0x07f``).
753		* ``PerRes``: Resolution of the publication period steps:
754
755			* ``0x00``: The Step Resolution is 100 milliseconds
756			* ``0x01``: The Step Resolution is 1 second
757			* ``0x02``: The Step Resolution is 10 seconds
758			* ``0x03``: The Step Resolution is 10 minutes
759		* ``PerSteps``: Number of publication period steps, or 0 to disable periodic publication.
760		* ``Count``: Number of retransmission for each published message (``0`` to ``7``).
761		* ``Int`` The interval between each retransmission, in milliseconds. Must be a multiple of 50.
762
763``mesh models cfg model pub-va <Addr> <UUID(1-16 hex)> <AppKeyIdx> <Cred(off, on)> <TTL> <PerRes> <PerSteps> <Count> <Int(ms)> <MID> [CID]``
764^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
765
766	Set the publication parameters of a model.
767
768	* ``Addr``: Address of the element the model is on.
769	* ``MID``: The model ID of the model to get the bound keys of.
770	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.
771
772	Publication parameters:
773
774		* ``UUID``: The destination virtual address to publish to. Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest.
775		* ``AppKeyIdx``: The application key index to publish with.
776		* ``Cred``: Whether to publish with Friendship credentials when acting as a Low Power Node.
777		* ``TTL``: TTL value to publish with (``0x00`` to ``0x07f``).
778		* ``PerRes``: Resolution of the publication period steps:
779
780			* ``0x00``: The Step Resolution is 100 milliseconds
781			* ``0x01``: The Step Resolution is 1 second
782			* ``0x02``: The Step Resolution is 10 seconds
783			* ``0x03``: The Step Resolution is 10 minutes
784		* ``PerSteps``: Number of publication period steps, or 0 to disable periodic publication.
785		* ``Count``: Number of retransmission for each published message (``0`` to ``7``).
786		* ``Int`` The interval between each retransmission, in milliseconds. Must be a multiple of 50.
787
788
789``mesh models cfg model sub-add <ElemAddr> <SubAddr> <MID> [CID]``
790^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
791
792	Subscription the model to a group address. Models only receive messages sent to their
793	unicast address or a group or virtual address they subscribe to. Models may subscribe to
794	multiple group and virtual addresses.
795
796	* ``ElemAddr``: Address of the element the model is on.
797	* ``SubAddr``: 16-bit group address the model should subscribe to (``0xc000`` to ``0xFEFF``).
798	* ``MID``: The model ID of the model to add the subscription to.
799	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.
800
801
802``mesh models cfg model sub-del <ElemAddr> <SubAddr> <MID> [CID]``
803^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
804
805	Unsubscribe a model from a group address.
806
807	* ``ElemAddr``: Address of the element the model is on.
808	* ``SubAddr``: 16-bit group address the model should remove from its subscription list (``0xc000`` to ``0xFEFF``).
809	* ``MID``: The model ID of the model to add the subscription to.
810	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.
811
812
813``mesh models cfg model sub-add-va <ElemAddr> <LabelUUID(1-16 hex)> <MID> [CID]``
814^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
815
816	Subscribe the model to a virtual address. Models only receive messages sent to their unicast
817	address or a group or virtual address they subscribe to. Models may subscribe to multiple
818	group and virtual addresses.
819
820	* ``ElemAddr``: Address of the element the model is on.
821	* ``LabelUUID``: 128-bit label UUID of the virtual address to subscribe to. Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest.
822	* ``MID``: The model ID of the model to add the subscription to.
823	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.
824
825
826``mesh models cfg model sub-del-va <ElemAddr> <LabelUUID(1-16 hex)> <MID> [CID]``
827^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
828
829	Unsubscribe a model from a virtual address.
830
831	* ``ElemAddr``: Address of the element the model is on.
832	* ``LabelUUID``: 128-bit label UUID of the virtual address to remove the subscription of.  Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest.
833	* ``MID``: The model ID of the model to add the subscription to.
834	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.
835
836``mesh models cfg model sub-ow <ElemAddr> <SubAddr> <MID> [CID]``
837^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
838
839	Overwrite all model subscriptions with a single new group address.
840
841	* ``ElemAddr``: Address of the element the model is on.
842	* ``SubAddr``: 16-bit group address the model should added to the subscription list (``0xc000`` to ``0xFEFF``).
843	* ``MID``: The model ID of the model to add the subscription to.
844	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.
845
846``mesh models cfg model sub-ow-va <ElemAddr> <LabelUUID(1-16 hex)> <MID> [CID]``
847^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
848
849	Overwrite all model subscriptions with a single new virtual address. Models only receive
850	messages sent to their unicast address or a group or virtual address they subscribe to.
851	Models may subscribe to multiple group and virtual addresses.
852
853	* ``ElemAddr``: Address of the element the model is on.
854	* ``LabelUUID``: 128-bit label UUID of the virtual address as the new Address to be added to the subscription list. Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest.
855	* ``MID``: The model ID of the model to add the subscription to.
856	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.
857
858``mesh models cfg model sub-del-all <ElemAddr> <MID> [CID]``
859^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
860
861	Remove all group and virtual address subscriptions from of a model.
862
863	* ``ElemAddr``: Address of the element the model is on.
864	* ``MID``: The model ID of the model to Unsubscribe all.
865	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.
866
867``mesh models cfg model sub-get <ElemAddr> <MID> [CID]``
868^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
869
870	Get a list of addresses the model subscribes to.
871
872	* ``ElemAddr``: Address of the element the model is on.
873	* ``MID``: The model ID of the model to get the subscription list of.
874	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.
875
876
877``mesh models cfg krp <NetKeyIdx> [Phase]``
878^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
879
880	Get or set the key refresh phase of a subnet.
881
882	* ``NetKeyIdx``: The identified network key used to Get/Set the current Key Refresh Phase state.
883	* ``Phase``: New Key Refresh Phase. Valid phases are:
884
885		* ``0x00``: Normal operation; Key Refresh procedure is not active
886		* ``0x01``: First phase of Key Refresh procedure
887		* ``0x02``: Second phase of Key Refresh procedure
888
889``mesh models cfg hb-sub [<Src> <Dst> <Per>]``
890^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
891
892	Get or set the Heartbeat subscription parameters. A node only receives Heartbeat messages
893	matching the Heartbeat subscription parameters. Sets the Heartbeat subscription parameters
894	if present, or prints the current Heartbeat subscription parameters if called with no
895	parameters.
896
897	* ``Src``: Unicast source address to receive Heartbeat messages from.
898	* ``Dst``: Destination address to receive Heartbeat messages on.
899	* ``Per``: Logarithmic representation of the Heartbeat subscription period:
900
901		* ``0``: Heartbeat subscription will be disabled.
902		* ``1`` to ``17``: The node will subscribe to Heartbeat messages for 2\ :sup:`(period - 1)` seconds.
903
904
905``mesh models cfg hb-pub [<Dst> <Count> <Per> <TTL> <Features> <NetKeyIdx>]``
906^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
907
908	Get or set the Heartbeat publication parameters. Sets the Heartbeat publication parameters
909	if present, or prints the current Heartbeat publication parameters if called with no
910	parameters.
911
912	* ``Dst``: Destination address to publish Heartbeat messages to.
913	* ``Count``: Logarithmic representation of the number of Heartbeat messages to publish periodically:
914
915		* ``0``: Heartbeat messages are not published periodically.
916		* ``1`` to ``17``: The node will periodically publish 2\ :sup:`(count - 1)` Heartbeat messages.
917		* ``255``: Heartbeat messages will be published periodically indefinitely.
918
919	* ``Per``: Logarithmic representation of the Heartbeat publication period:
920
921		* ``0``: Heartbeat messages are not published periodically.
922		* ``1`` to ``17``: The node will publish Heartbeat messages every 2\ :sup:`(period - 1)` seconds.
923
924	* ``TTL``: The TTL value to publish Heartbeat messages with (``0x00`` to ``0x7f``).
925	* ``Features``: Bitfield of features that should trigger a Heartbeat publication when changed:
926
927		* ``Bit 0``: Relay feature.
928		* ``Bit 1``: Proxy feature.
929		* ``Bit 2``: Friend feature.
930		* ``Bit 3``: Low Power feature.
931
932	* ``NetKeyIdx``: Index of the network key to publish Heartbeat messages with.
933
934
935Health Client
936-------------
937
938The Health Client model is an optional mesh subsystem that can be enabled through the
939:kconfig:option:`CONFIG_BT_MESH_HEALTH_CLI` configuration option. This is implemented as a separate
940module (``mesh models health``) inside the ``mesh models`` subcommand list. This module will work on
941any instance of the Health Client model if the mentioned shell configuration options is enabled, and
942as long as one or more Health Client model(s) is present in the model composition of the
943application. This shell module can be used to trigger interaction between Health Clients and Servers
944on devices in a Mesh network.
945
946By default, the module will choose the first Health Client instance in the model composition when
947using the Health Client commands. To choose a specific Health Client instance the user can utilize
948the commands ``mesh models health instance set`` and ``mesh models health instance get-all``.
949
950The Health Client may use the general messages parameters set by ``mesh target dst``,
951``mesh target net`` and ``mesh target app`` to target specific nodes. If the shell target
952destination address is set to zero, the targeted Health Client will attempt to publish messages
953using its configured publication parameters.
954
955``mesh models health instance set <ElemIdx>``
956^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
957
958	Set the Health Client model instance to use.
959
960	* ``ElemIdx``: Element index of Health Client model.
961
962``mesh models health instance get-all``
963^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
964
965	Prints all available Health Client model instances on the device.
966
967``mesh models health fault-get <CID>``
968^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
969
970	Get a list of registered faults for a Company ID.
971
972	* ``CID``: Company ID to get faults for.
973
974
975``mesh models health fault-clear <CID>``
976^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
977
978	Clear the list of faults for a Company ID.
979
980	* ``CID``: Company ID to clear the faults for.
981
982
983``mesh models health fault-clear-unack <CID>``
984^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
985
986	Clear the list of faults for a Company ID without requesting a response.
987
988	* ``CID``: Company ID to clear the faults for.
989
990
991``mesh models health fault-test <CID> <TestID>``
992^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
993
994	Invoke a self-test procedure, and show a list of triggered faults.
995
996	* ``CID``: Company ID to perform self-tests for.
997	* ``TestID``: Test to perform.
998
999
1000``mesh models health fault-test-unack <CID> <TestID>``
1001^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1002
1003	Invoke a self-test procedure without requesting a response.
1004
1005	* ``CID``: Company ID to perform self-tests for.
1006	* ``TestID``: Test to perform.
1007
1008
1009``mesh models health period-get``
1010^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1011
1012	Get the current Health Server publish period divisor.
1013
1014
1015``mesh models health period-set <Divisor>``
1016^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1017
1018	Set the current Health Server publish period divisor. When a fault is detected, the Health
1019	Server will start publishing is fault status with a reduced interval. The reduced interval
1020	is determined by the Health Server publish period divisor: Fault publish period = Publish
1021	period / 2\ :sup:`divisor`.
1022
1023	* ``Divisor``: The new Health Server publish period divisor.
1024
1025
1026``mesh models health period-set-unack <Divisor>``
1027^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1028
1029	Set the current Health Server publish period divisor. When a fault is detected, the Health
1030	Server will start publishing is fault status with a reduced interval. The reduced interval
1031	is determined by the Health Server publish period divisor: Fault publish period = Publish
1032	period / 2\ :sup:`divisor`.
1033
1034	* ``Divisor``: The new Health Server publish period divisor.
1035
1036
1037``mesh models health attention-get``
1038^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1039
1040	Get the current Health Server attention state.
1041
1042
1043``mesh models health attention-set <Time(s)>``
1044^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1045
1046	Enable the Health Server attention state for some time.
1047
1048	* ``Time``: Duration of the attention state, in seconds (``0`` to ``255``)
1049
1050
1051``mesh models health attention-set-unack <Time(s)>``
1052^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1053
1054	Enable the Health Server attention state for some time without requesting a response.
1055
1056	* ``Time``: Duration of the attention state, in seconds (``0`` to ``255``)
1057
1058
1059Binary Large Object (BLOB) Transfer Client model
1060------------------------------------------------
1061
1062The :ref:`bluetooth_mesh_blob_cli` can be added to the mesh shell by enabling the
1063:kconfig:option:`CONFIG_BT_MESH_BLOB_CLI` option, and disabling the
1064:kconfig:option:`CONFIG_BT_MESH_DFU_CLI` option.
1065
1066``mesh models blob cli target <Addr>``
1067^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1068
1069	Add a Target node for the next BLOB transfer.
1070
1071	* ``Addr``: Unicast address of the Target node's BLOB Transfer Server model.
1072
1073
1074``mesh models blob cli caps [<Group> [<TimeoutBase>]]``
1075^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1076
1077	Retrieve transfer capabilities for Target nodes.
1078
1079	* ``Group``: Optional group address to use when communicating with Target nodes. If omitted, the BLOB Transfer Client will address each Target node individually.
1080	* ``TimeoutBase``: Optional time to wait for responses from Target nodes, in 10-second increments.
1081
1082
1083``mesh models blob cli tx <Id> <Size> <BlockSizeLog> <ChunkSize> [<Group> [<Mode(push, pull)>]]``
1084^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1085
1086	Perform a BLOB transfer to Target nodes. The BLOB Transfer Client will send a dummy BLOB to
1087	all Target nodes, then post a message when the transfer is completed. Note that all Target
1088	nodes must first be configured to receive the transfer using the ``mesh models blob srv rx``
1089	command.
1090
1091	* ``Id``: 64-bit BLOB transfer ID.
1092	* ``Size``: Size of the BLOB in bytes.
1093	* ``BlockSizeLog``: Logarithmic representation of the BLOB's block size. The final block size will be ``1 << block size log`` bytes.
1094	* ``ChunkSize``: Chunk size in bytes.
1095	* ``Group``: Optional group address to use when communicating with Target nodes. If omitted or set to 0, the BLOB Transfer Client will address each Target node individually.
1096	* ``Mode``: BLOB transfer mode to use. Must be either ``push`` (Push BLOB Transfer Mode) or ``pull`` (Pull BLOB Transfer Mode). If omitted, ``push`` will be used by default.
1097
1098
1099``mesh models blob cli tx-cancel``
1100^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1101
1102	Cancel an ongoing BLOB transfer.
1103
1104``mesh models blob cli tx-get [Group]``
1105^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1106
1107	Determine the progress of a previously running BLOB transfer. Can be used when not
1108	performing a BLOB transfer.
1109
1110	* ``Group``: Optional group address to use when communicating with Target nodes. If omitted or set to 0, the BLOB Transfer Client will address each Target node individually.
1111
1112
1113``mesh models blob cli tx-suspend``
1114^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1115
1116	Suspend the ongoing BLOB transfer.
1117
1118
1119``mesh models blob cli tx-resume``
1120^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1121
1122	Resume the suspended BLOB transfer.
1123
1124``mesh models blob cli instance-set <ElemIdx>``
1125^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1126
1127	Use the BLOB Transfer Client model instance on the specified element when using the other
1128	BLOB Transfer Client model commands.
1129
1130	* ``ElemIdx``: The element on which to find the BLOB Transfer Client model instance to use.
1131
1132``mesh models blob cli instance-get-all``
1133^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1134
1135	Get a list of all BLOB Transfer Client model instances on the node.
1136
1137
1138BLOB Transfer Server model
1139--------------------------
1140
1141The :ref:`bluetooth_mesh_blob_srv` can be added to the mesh shell by enabling the
1142:kconfig:option:`CONFIG_BT_MESH_BLOB_SRV` option. The BLOB Transfer Server model is capable of
1143receiving any BLOB data, but the implementation in the mesh shell will discard the incoming data.
1144
1145
1146``mesh models blob srv rx <ID> [<TimeoutBase(10s steps)>]``
1147^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1148
1149	Prepare to receive a BLOB transfer.
1150
1151	* ``ID``: 64-bit BLOB transfer ID to receive.
1152	* ``TimeoutBase``: Optional additional time to wait for client messages, in 10-second increments.
1153
1154
1155``mesh models blob srv rx-cancel``
1156^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1157
1158	Cancel an ongoing BLOB transfer.
1159
1160``mesh models blob srv instance-set <ElemIdx>``
1161^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1162
1163	Use the BLOB Transfer Server model instance on the specified element when using the other
1164	BLOB Transfer Server model commands.
1165
1166	* ``ElemIdx``: The element on which to find the BLOB Transfer Server model instance to use.
1167
1168``mesh models blob srv instance-get-all``
1169^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1170
1171	Get a list of all BLOB Transfer Server model instances on the node.
1172
1173
1174Binary Large Object (BLOB) Transfer flash stream
1175------------------------------------------------
1176BLOB flash stream configuration can be added to the mesh shell by enabling the
1177:kconfig:option:`CONFIG_BT_MESH_SHELL_BLOB_IO_FLASH` option. By default, the shell uses a
1178dummy BLOB stream. This option allows the user to specify which area in the flash to use.
1179See :ref:`flash_map_api` for information on how to obtain related parameters.
1180
1181``mesh models blob flash-stream-set <AreaID> [<Offset>]``
1182^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1183
1184	Set the BLOB stream to a specified area.
1185
1186	* ``AreaID``: Flash area ID to write/read the BLOB to/from.
1187	* ``Offset``: Optional offset into the flash area to place the BLOB at (in bytes).
1188
1189``mesh models blob flash-stream-unset``
1190^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1191
1192	Set the BLOB stream back to the dummy stream.
1193
1194
1195Firmware Update Client model
1196----------------------------
1197
1198The Firmware Update Client model can be added to the mesh shell by enabling configuration options
1199:kconfig:option:`CONFIG_BT_MESH_BLOB_CLI` and :kconfig:option:`CONFIG_BT_MESH_DFU_CLI`. The Firmware
1200Update Client demonstrates the firmware update Distributor role by transferring a dummy firmware
1201update to a set of Target nodes.
1202
1203
1204``mesh models dfu slot add <Size> <FwID> [<Metadata>]``
1205^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1206
1207	Add a virtual DFU image slot that can be transferred as a DFU image. The image slot will be
1208	assigned an image slot index, which is printed as a response, and can be used to reference
1209	the slot in other commands. To update the image slot, remove it using the
1210	``mesh models dfu slot del`` shell command and then add it again.
1211
1212	* ``Size``: DFU image slot size in bytes.
1213	* ``FwID``: Firmware ID, formatted as a hexstring.
1214	* ``Metadata``: Optional firmware metadata, formatted as a hexstring.
1215
1216
1217``mesh models dfu slot del <SlotIdx>``
1218^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1219
1220	Delete the DFU image slot at the given index.
1221
1222	* ``SlotIdx``: Index of the slot to delete.
1223
1224
1225``mesh models dfu slot get <SlotIdx>``
1226^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1227
1228	Get all available information about a DFU image slot.
1229
1230	* ``SlotIdx``: Index of the slot to get.
1231
1232
1233``mesh models dfu cli target <Addr> <ImgIdx>``
1234^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1235
1236	Add a Target node.
1237
1238	* ``Addr``: Unicast address of the Target node.
1239	* ``ImgIdx``: Image index to address on the Target node.
1240
1241
1242``mesh models dfu cli target-state``
1243^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1244
1245	Check the DFU Target state of the device at the configured destination address.
1246
1247
1248``mesh models dfu cli target-imgs [<MaxCount>]``
1249^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1250
1251	Get a list of DFU images on the device at the configured destination address.
1252
1253	* ``MaxCount``: Optional maximum number of images to return. If omitted, there's no limit on the number of returned images.
1254
1255
1256``mesh models dfu cli target-check <SlotIdx> <TargetImgIdx>``
1257^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1258
1259	Check whether the device at the configured destination address will accept a DFU transfer
1260	from the given DFU image slot to the Target node's DFU image at the given index, and what
1261	the effect would be.
1262
1263	* ``SlotIdx``: Index of the local DFU image slot to check.
1264	* ``TargetImgIdx``: Index of the Target node's DFU image to check.
1265
1266
1267``mesh models dfu cli send <SlotIdx> [<Group>]``
1268^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1269
1270	Start a DFU transfer to all added Target nodes.
1271
1272	* ``SlotIdx``: Index of the local DFU image slot to send.
1273	* ``Group``: Optional group address to use when communicating with the Target nodes. If omitted, the Firmware Update Client will address each Target node individually.
1274
1275
1276``mesh models dfu cli cancel [<Addr>]``
1277^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1278
1279	Cancel the DFU procedure at any state on a specific Target node or on all Target nodes. When
1280	a Target node address is provided, the Firmware Update Client model will try to cancel the
1281	DFU procedure on the provided Target node. Otherwise, the Firmware Update Client model will
1282	try to cancel the ongoing DFU procedure on all Target nodes.
1283
1284	* ``Addr``: Optional unicast address of a Target node on which to cancel the DFU procedure.
1285
1286
1287``mesh models dfu cli apply``
1288^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1289
1290	Apply the most recent DFU transfer on all Target nodes. Can only be called after a DFU
1291	transfer is completed.
1292
1293
1294``mesh models dfu cli confirm``
1295^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1296
1297	Confirm that the most recent DFU transfer was successfully applied on all Target nodes. Can
1298	only be called after a DFU transfer is completed and applied.
1299
1300
1301``mesh models dfu cli suspend``
1302^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1303
1304	Suspend the ongoing DFU transfer.
1305
1306
1307``mesh models dfu cli resume``
1308^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1309
1310	Resume the suspended DFU transfer.
1311
1312
1313``mesh models dfu cli progress``
1314^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1315
1316	Check the progress of the current transfer.
1317
1318
1319``mesh models dfu cli instance-set <ElemIdx>``
1320^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1321
1322	Use the Firmware Update Client model instance on the specified element when using the other
1323	Firmware Update Client model commands.
1324
1325	* ``ElemIdx``: The element on which to find the Firmware Update Client model instance to use.
1326
1327``mesh models dfu cli instance-get-all``
1328^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1329
1330	Get a list of all Firmware Update Client model instances on the node.
1331
1332
1333Firmware Update Server model
1334----------------------------
1335
1336The Firmware Update Server model can be added to the mesh shell by enabling configuration options
1337:kconfig:option:`CONFIG_BT_MESH_BLOB_SRV` and :kconfig:option:`CONFIG_BT_MESH_DFU_SRV`. The Firmware
1338Update Server demonstrates the firmware update Target role by accepting any firmware update. The
1339mesh shell Firmware Update Server will discard the incoming firmware data, but otherwise behave as a
1340proper firmware update Target node.
1341
1342
1343``mesh models dfu srv applied``
1344^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1345
1346	Mark the most recent DFU transfer as applied. Can only be called after a DFU transfer is
1347	completed, and the Distributor has requested that the transfer is applied.
1348
1349	As the mesh shell Firmware Update Server doesn't actually apply the incoming firmware image,
1350	this command can be used to emulate an applied status, to notify the Distributor that the
1351	transfer was successful.
1352
1353
1354``mesh models dfu srv progress``
1355^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1356
1357	Check the progress of the current transfer.
1358
1359``mesh models dfu srv rx-cancel``
1360^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1361
1362	Cancel incoming DFU transfer.
1363
1364``mesh models dfu srv instance-set <ElemIdx>``
1365^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1366
1367	Use the Firmware Update Server model instance on the specified element when using the other
1368	Firmware Update Server model commands.
1369
1370	* ``ElemIdx``: The element on which to find the Firmware Update Server model instance to use.
1371
1372``mesh models dfu srv instance-get-all``
1373^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1374
1375	Get a list of all Firmware Update Server model instances on the node.
1376
1377
1378.. _bluetooth_mesh_shell_dfd_server:
1379
1380Firmware Distribution Server model
1381----------------------------------
1382
1383The Firmware Distribution Server model commands can be added to the mesh shell by enabling the
1384:kconfig:option:`CONFIG_BT_MESH_DFD_SRV` configuration option. The shell commands for this model
1385mirror the messages sent to the server by a Firmware Distribution Client model. To use these
1386commands, a Firmware Distribution Server must be instantiated by the application.
1387
1388``mesh models dfd receivers-add <Addr>,<FwIdx>[;<Addr>,<FwIdx>]...``
1389^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1390
1391	Add receivers to the Firmware Distribution Server. Supply receivers as a list of
1392	comma-separated addr,fw_idx pairs, separated by semicolons, for example,
1393	``0x0001,0;0x0002,0;0x0004,1``.  Do not use spaces in the receiver list. Repeated calls to
1394	this command will continue populating the receivers list until
1395	``mesh models dfd receivers-delete-all`` is called.
1396
1397	* ``Addr``: Address of the receiving node(s).
1398	* ``FwIdx``: Index of the firmware slot to send to ``Addr``.
1399
1400``mesh models dfd receivers-delete-all``
1401^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1402
1403	Delete all receivers from the server.
1404
1405``mesh models dfd receivers-get <First> <Count>``
1406^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1407
1408	Get a list of info about firmware receivers.
1409
1410	* ``First``: Index of the first receiver to get from the receiver list.
1411	* ``Count``: The number of receivers for which to get info.
1412
1413``mesh models dfd capabilities-get``
1414^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1415
1416	Get the capabilities of the server.
1417
1418``mesh models dfd get``
1419^^^^^^^^^^^^^^^^^^^^^^^
1420
1421	Get information about the current distribution state, phase and the transfer parameters.
1422
1423``mesh models dfd start <AppKeyIdx> <SlotIdx> [<Group> [<PolicyApply> [<TTL> [<TimeoutBase> [<XferMode>]]]]]``
1424^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1425
1426	Start the firmware distribution.
1427
1428	* ``AppKeyIdx``: Application index to use for sending. The common application key should be bound to the Firmware Update and BLOB Transfer models on the Distributor and Target nodes.
1429	* ``SlotIdx``: Index of the local image slot to send.
1430	* ``Group``: Optional group address to use when communicating with the Target nodes. If omitted, the Firmware Distribution Server will address each Target node individually. To keep addressing each Target node individually while changing other arguments, set this argument value to 0.
1431	* ``PolicyApply``: Optional field that corresponds to the update policy. Setting this to ``true`` will make the Firmware Distribution Server apply the image immediately after the transfer is completed.
1432	* ``TTL``: Optional. TTL value to use when sending. Defaults to configured default TTL.
1433	* ``TimeoutBase``: Optional additional value used to calculate timeout values in the firmware distribution process, in 10-second increments.. See :ref:`bluetooth_mesh_blob_timeout` for information about how ``timeout_base`` is used to calculate the transfer timeout. Defaults to 0.
1434	* ``XferMode``: Optional BLOB transfer mode. 1 = Push mode (Push BLOB Transfer Mode), 2 = Pull mode (Pull BLOB Transfer Mode). Defaults to Push mode.
1435
1436``mesh models dfd suspend``
1437^^^^^^^^^^^^^^^^^^^^^^^^^^^
1438
1439	Suspends the ongoing distribution.
1440
1441``mesh models dfd cancel``
1442^^^^^^^^^^^^^^^^^^^^^^^^^^
1443
1444	Cancel the ongoing distribution.
1445
1446``mesh models dfd apply``
1447^^^^^^^^^^^^^^^^^^^^^^^^^
1448
1449	Apply the distributed firmware.
1450
1451``mesh models dfd fw-get <FwID>``
1452^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1453
1454	Get information about the firmware image uploaded to the server.
1455
1456	* ``FwID``: Firmware ID of the image to get.
1457
1458``mesh models dfd fw-get-by-idx <Idx>``
1459^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1460
1461	Get information about the firmware image uploaded to the server in a specific slot.
1462
1463	* ``Idx``: Index of the slot to get the image from.
1464
1465``mesh models dfd fw-delete <FwID>``
1466^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1467
1468	Delete a firmware image from the server.
1469
1470	* ``FwID``: Firmware ID of the image to delete.
1471
1472``mesh models dfd fw-delete-all``
1473^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1474
1475	Delete all firmware images from the server.
1476
1477``mesh models dfd instance-set <ElemIdx>``
1478^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1479
1480	Use the Firmware Distribution Server model instance on the specified element when using the
1481	other Firmware Distribution Server model commands.
1482
1483	* ``ElemIdx``: The element on which to find the Firmware Distribution Server model instance to use.
1484
1485``mesh models dfd instance-get-all``
1486^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1487
1488	Get a list of all Firmware Distribution Server model instances on the node.
1489
1490
1491.. _bluetooth_mesh_shell_dfu_metadata:
1492
1493DFU metadata
1494------------
1495
1496The DFU metadata shell commands allow generating metadata that can be used by a Target node to
1497check the firmware before accepting it. The commands are enabled through the
1498:kconfig:option:`CONFIG_BT_MESH_SHELL_DFU_METADATA` configuration option.
1499
1500``mesh models dfu metadata comp-clear``
1501^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1502
1503	Clear the stored composition data to be used for the Target node.
1504
1505``mesh models dfu metadata comp-add <CID> <ProductID> <VendorID> <Crpl> <Features>``
1506^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1507
1508	Create a header of the Composition Data Page 0.
1509
1510	* ``CID``: Company identifier assigned by Bluetooth SIG.
1511	* ``ProductID``: Vendor-assigned product identifier.
1512	* ``VendorID``: Vendor-assigned version identifier.
1513	* ``Crpl``: The size of the replay protection list.
1514	* ``Features``: Features supported by the node in bit field format:
1515
1516		* ``0``: Relay.
1517		* ``1``: Proxy.
1518		* ``2``: Friend.
1519		* ``3``: Low Power.
1520
1521``mesh models dfu metadata comp-elem-add <Loc> <NumS> <NumV> {<SigMID>|<VndCID> <VndMID>}...``
1522^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1523	Add element description of the Target node.
1524
1525	* ``Loc``: Element location.
1526	* ``NumS``: Number of SIG models instantiated on the element.
1527	* ``NumV``: Number of vendor models instantiated on the element.
1528	* ``SigMID``: SIG Model ID.
1529	* ``VndCID``: Vendor model company identifier.
1530	* ``VndMID``: Vendor model identifier.
1531
1532``mesh models dfu metadata comp-hash-get [<Key(16 hex)>]``
1533^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1534
1535	Generate a hash of the stored Composition Data to be used in metadata.
1536
1537	* ``Key``: Optional 128-bit key to be used to generate the hash. Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest.
1538
1539``mesh models dfu metadata encode <Major> <Minor> <Rev> <BuildNum> <Size> <CoreType> <Hash> <Elems> [<UserData>]``
1540^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1541
1542	Encode metadata for the DFU.
1543
1544	* ``Major``: Major version of the firmware.
1545	* ``Minor``: Minor version of the firmware.
1546	* ``Rev``: Revision number of the firmware.
1547	* ``BuildNum``: Build number.
1548	* ``Size``: Size of the signed bin file.
1549	* ``CoreType``: New firmware core type:
1550
1551		* ``1``: Application core.
1552		* ``2``: Network core.
1553		* ``4``: Applications specific BLOB.
1554	* ``Hash``: Hash of the composition data generated using ``mesh models dfu metadata comp-hash-get`` command.
1555	* ``Elems``: Number of elements on the new firmware.
1556	* ``UserData``: User data supplied with the metadata.
1557
1558
1559Segmentation and Reassembly (SAR) Configuration Client
1560------------------------------------------------------
1561
1562The SAR Configuration client is an optional mesh model that can be enabled through the
1563:kconfig:option:`CONFIG_BT_MESH_SAR_CFG_CLI` configuration option. The SAR Configuration Client
1564model is used to support the functionality of configuring the behavior of the lower transport layer
1565of a node that supports the SAR Configuration Server model.
1566
1567
1568``mesh models sar tx-get``
1569^^^^^^^^^^^^^^^^^^^^^^^^^^
1570
1571	Send SAR Configuration Transmitter Get message.
1572
1573``mesh models sar tx-set <SegIntStep> <UniRetransCnt> <UniRetransWithoutProgCnt> <UniRetransIntStep> <UniRetransIntInc> <MultiRetransCnt> <MultiRetransInt>``
1574^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1575
1576	Send SAR Configuration Transmitter Set message.
1577
1578	* ``SegIntStep``: SAR Segment Interval Step state.
1579	* ``UniRetransCnt``: SAR Unicast Retransmissions Count state.
1580	* ``UniRetransWithoutProgCnt``: SAR Unicast Retransmissions Without Progress Count state.
1581	* ``UniRetransIntStep``: SAR Unicast Retransmissions Interval Step state.
1582	* ``UniRetransIntInc``: SAR Unicast Retransmissions Interval Increment state.
1583	* ``MultiRetransCnt``: SAR Multicast Retransmissions Count state.
1584	* ``MultiRetransInt``: SAR Multicast Retransmissions Interval state.
1585
1586``mesh models sar rx-get``
1587^^^^^^^^^^^^^^^^^^^^^^^^^^
1588
1589	Send SAR Configuration Receiver Get message.
1590
1591``mesh models sar rx-set <SegThresh> <AckDelayInc> <DiscardTimeout> <RxSegIntStep> <AckRetransCount>``
1592^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1593
1594	Send SAR Configuration Receiver Set message.
1595
1596	* ``SegThresh``: SAR Segments Threshold state.
1597	* ``AckDelayInc``: SAR Acknowledgment Delay Increment state.
1598	* ``DiscardTimeout``: SAR Discard Timeout state.
1599	* ``RxSegIntStep``: SAR Receiver Segment Interval Step state.
1600	* ``AckRetransCount``: SAR Acknowledgment Retransmissions Count state.
1601
1602
1603Private Beacon Client
1604---------------------
1605
1606The Private Beacon Client model is an optional mesh subsystem that can be enabled through the
1607:kconfig:option:`CONFIG_BT_MESH_PRIV_BEACON_CLI` configuration option.
1608
1609``mesh models prb priv-beacon-get``
1610^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1611
1612	Get the target's Private Beacon state. Possible values:
1613
1614		* ``0x00``: The node doesn't broadcast Private beacons.
1615		* ``0x01``: The node broadcasts Private beacons.
1616
1617``mesh models prb priv-beacon-set <Val(off, on)> <RandInt(10s steps)>``
1618^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1619
1620	Set the target's Private Beacon state.
1621
1622	* ``Val``: Control Private Beacon state.
1623	* ``RandInt``: Random refresh interval (in 10-second steps), or 0 to keep current value.
1624
1625``mesh models prb priv-gatt-proxy-get``
1626^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1627
1628	Get the target's Private GATT Proxy state. Possible values:
1629
1630		* ``0x00``: The Private Proxy functionality is supported, but disabled.
1631		* ``0x01``: The Private Proxy functionality is enabled.
1632		* ``0x02``: The Private Proxy functionality is not supported.
1633
1634``mesh models prb priv-gatt-proxy-set <Val(off, on)>``
1635^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1636
1637	Set the target's Private GATT Proxy state.
1638
1639	* ``Val``: New Private GATT Proxy value:
1640
1641		* ``0x00``: Disable the Private Proxy functionality.
1642		* ``0x01``: Enable the Private Proxy functionality.
1643
1644``mesh models prb priv-node-id-get <NetKeyIdx>``
1645^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1646
1647	Get the target's Private Node Identity state. Possible values:
1648
1649		* ``0x00``: The node does not adverstise with the Private Node Identity.
1650		* ``0x01``: The node advertises with the Private Node Identity.
1651		* ``0x02``: The node doesn't support advertising with the Private Node Identity.
1652
1653	* ``NetKeyIdx``: Network index to get the Private Node Identity state of.
1654
1655``mesh models prb priv-node-id-set <NetKeyIdx> <State>``
1656^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1657
1658	Set the target's Private Node Identity state.
1659
1660	* ``NetKeyIdx``: Network index to set the Private Node Identity state of.
1661	* ``State``: New Private Node Identity value:
1662
1663		* ``0x00``: Stop advertising with the Private Node Identity.
1664		* ``0x01``: Start advertising with the Private Node Identity.
1665
1666
1667Opcodes Aggregator Client
1668-------------------------
1669
1670The Opcodes Aggregator client is an optional Bluetooth Mesh model that can be enabled through the
1671:kconfig:option:`CONFIG_BT_MESH_OP_AGG_CLI` configuration option. The Opcodes Aggregator Client
1672model is used to support the functionality of dispatching a sequence of access layer messages to
1673nodes supporting the Opcodes Aggregator Server model.
1674
1675``mesh models opagg seq-start <ElemAddr>``
1676^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1677
1678	Start the Opcodes Aggregator Sequence message. This command initiates the context for
1679	aggregating messages and sets the destination address for next shell commands to
1680	``elem_addr``.
1681
1682	* ``ElemAddr``: Element address that will process the aggregated opcodes.
1683
1684``mesh models opagg seq-send``
1685^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1686
1687	Send the Opcodes Aggregator Sequence message. This command completes the procedure, sends
1688	the aggregated sequence message to the target node and clears the context.
1689
1690``mesh models opagg seq-abort``
1691^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1692
1693	Abort the Opcodes Aggregator Sequence message. This command clears the Opcodes Aggregator
1694	Client context.
1695
1696
1697Remote Provisioning Client
1698--------------------------
1699
1700The Remote Provisioning Client is an optional Bluetooth Mesh model enabled through the
1701:kconfig:option:`CONFIG_BT_MESH_RPR_CLI` configuration option. The Remote Provisioning Client model
1702provides support for remote provisioning of devices into a mesh network by using the Remote
1703Provisioning Server model.
1704
1705This shell module can be used to trigger interaction between Remote Provisioning Clients and Remote
1706Provisioning Servers on devices in a mesh network.
1707
1708``mesh models rpr scan <Timeout(s)> [<UUID(1-16 hex)>]``
1709^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1710
1711	Start scanning for unprovisioned devices.
1712
1713	* ``Timeout``: Scan timeout in seconds. Must be at least 1 second.
1714	* ``UUID``: Device UUID to scan for. Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest. If omitted, all devices will be reported.
1715
1716``mesh models rpr scan-ext <Timeout(s)> <UUID(1-16 hex)> [<ADType> ... ]``
1717^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1718
1719	Start the extended scanning for unprovisioned devices.
1720
1721	* ``Timeout``: Scan timeout in seconds. Valid values from :c:macro:`BT_MESH_RPR_EXT_SCAN_TIME_MIN` to :c:macro:`BT_MESH_RPR_EXT_SCAN_TIME_MAX`.
1722	* ``UUID``: Device UUID to start extended scanning for. Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest.
1723	* ``ADType``: List of AD types to include in the scan report. Must contain 1 to :kconfig:option:`CONFIG_BT_MESH_RPR_AD_TYPES_MAX` entries.
1724
1725``mesh models rpr scan-srv [<ADType> ... ]``
1726^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1727
1728	Start the extended scanning for the Remote Provisioning Server.
1729
1730	* ``ADType``: List of AD types to include in the scan report. Must contain 1 to :kconfig:option:`CONFIG_BT_MESH_RPR_AD_TYPES_MAX` entries.
1731
1732``mesh models rpr scan-caps``
1733^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1734
1735	Get the scanning capabilities of the Remote Provisioning Server.
1736
1737``mesh models rpr scan-get``
1738^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1739
1740	Get the current scanning state of the Remote Provisioning Server.
1741
1742``mesh models rpr scan-stop``
1743^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1744
1745	Stop any ongoing scanning on the Remote Provisioning Server.
1746
1747``mesh models rpr link-get``
1748^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1749
1750	Get the current link status of the Remote Provisioning Server.
1751
1752``mesh models rpr link-close``
1753^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1754
1755	Close any open links on the Remote Provisioning Server.
1756
1757``mesh models rpr provision-remote <UUID(1-16 hex)> <NetKeyIdx> <Addr>``
1758^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1759
1760	Provision a mesh node using the PB-Remote provisioning bearer.
1761
1762	* ``UUID``: UUID of the unprovisioned node. Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest.
1763	* ``NetKeyIdx``: Network Key Index to give to the unprovisioned node.
1764	* ``Addr``: Address to assign to remote device. If ``addr`` is 0, the lowest available address will be chosen.
1765
1766``mesh models rpr reprovision-remote <Addr> [<CompChanged(false, true)>]``
1767^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1768
1769	Reprovision a mesh node using the PB-Remote provisioning bearer.
1770
1771	* ``Addr``: Address to assign to remote device. If ``addr`` is 0, the lowest available address will be chosen.
1772	* ``CompChanged``: The Target node has indicated that its Composition Data has changed.  Defaults to false.
1773
1774``mesh models rpr instance-set <ElemIdx>``
1775^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1776
1777	Use the Remote Provisioning Client model instance on the specified element when using the
1778	other Remote Provisioning Client model commands.
1779
1780	* ``ElemIdx``: The element on which to find the Remote Provisioning Client model instance to use.
1781
1782``mesh models rpr instance-get-all``
1783^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1784
1785	Get a list of all Remote Provisioning Client model instances on the node.
1786
1787
1788Large Composition Data Client
1789-----------------------------
1790
1791The Large Composition Data Client is an optional Bluetooth Mesh model enabled through the
1792:kconfig:option:`CONFIG_BT_MESH_LARGE_COMP_DATA_CLI` configuration option. The Large Composition Data Client
1793model is used to support the functionality of reading pages of Composition Data that do not fit in
1794a Config Composition Data Status message, and reading the metadata of the model instances.
1795
1796``mesh models lcd large-comp-data-get <Page> <Offset>``
1797^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1798
1799	Send the Large Composition Data Get message to query a portion of the Composition Data state of a node.
1800
1801	* ``Page``: Page number of the Composition Data.
1802	* ``Offset``: Offset within the page.
1803
1804``mesh models lcd models-metadata-get <Page> <Offset>``
1805^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1806
1807	Send the Models Metadata Get message to query a portion of a page of the Models Metadata state.
1808
1809	* ``Page``: Page number of the Models Metadata.
1810	* ``Offset``: Offset within the page.
1811
1812
1813Bridge Configuration Client
1814---------------------------
1815
1816The Bridge Configuration Client model is an optional Bluetooth Mesh model that can be enabled through the
1817:kconfig:option:`CONFIG_BT_MESH_BRG_CFG_CLI` configuration option. The model provides functionality
1818for configuring the subnet bridge functionality of a mesh node.
1819
1820``mesh models brg get``
1821^^^^^^^^^^^^^^^^^^^^^^^
1822
1823	Get the current Subnet Bridge state.
1824
1825``mesh models brg set <State(disable, enable)>``
1826^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1827
1828	Set the Subnet Bridge state.
1829
1830	* ``State``: Disable or enable the Subnet Bridge functionality.
1831
1832``mesh models brg table-size-get``
1833^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1834
1835	Get the current size of the Bridging Table.
1836
1837``mesh models brg table-add <Directions> <NetIdx1> <NetIdx2> <Addr1> <Addr2>``
1838^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1839
1840	Add an entry to the Bridging Table.
1841
1842	* ``Directions``: Allowed directions for the bridged traffic. Valid values are:
1843
1844		* ``0x01``: Bridging is allowed only for messages with ``Addr1`` as the source address and ``Addr2`` as the destination address.
1845		* ``0x02``: Bridging is allowed in both directions.
1846
1847	* ``NetIdx1``: NetKey index of the first subnet.
1848	* ``NetIdx2``: NetKey index of the second subnet.
1849	* ``Addr1``: Address of the node in the first subnet.
1850	* ``Addr2``: Address of the node in the second subnet.
1851
1852``mesh models brg table-remove <NetIdx1> <NetIdx2> <Addr1> <Addr2>``
1853^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1854
1855	Remove an entry from the Bridging Table.
1856
1857	* ``NetIdx1``: NetKey index of the first subnet.
1858	* ``NetIdx2``: NetKey index of the second subnet.
1859	* ``Addr1``: Address of the node in the first subnet.
1860	* ``Addr2``: Address of the node in the second subnet.
1861
1862``mesh models brg subnets-get <Filter> <NetIdx> <StartIdx>``
1863^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1864
1865	Get a filtered set of NetKey index pairs extracted from the Bridging Table.
1866
1867	* ``Filter``: Filter to be applied when reporting pairs of NetKey indexes extracted from the Bridging Table. Allowed values:
1868
1869		* ``0x00``: Report all pairs.
1870		* ``0x01``: Report pairs in which the NetKey index of the first subnet matches ``NetIdx``.
1871		* ``0x02``: Report pairs in which the NetKey index of the second subnet matches ``NetIdx``.
1872		* ``0x03``: Report pairs in which one of the NetKey indexes matches ``NetIdx``.
1873
1874	* ``NetIdx``: NetKey index of any of the subnets.
1875	* ``StartIdx``: Start offset in units of pairs of NetKey indexes to read.
1876
1877``mesh models brg table-get <NetIdx1> <NetIdx2> <StartIdx>``
1878^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1879
1880	Get a list of addresses and allowed traffic directions of the Bridging Table entries.
1881
1882	* ``NetIdx1``: NetKey index of the first subnet.
1883	* ``NetIdx2``: NetKey index of the second subnet.
1884	* ``StartIdx``: Start offset to read in units of Bridging Table state entries.
1885
1886
1887Configuration database
1888======================
1889
1890The Configuration database is an optional mesh subsystem that can be enabled through the
1891:kconfig:option:`CONFIG_BT_MESH_CDB` configuration option. The Configuration database is only
1892available on provisioner devices, and allows them to store all information about the mesh network.
1893To avoid conflicts, there should only be one mesh node in the network with the Configuration
1894database enabled. This node is the Configurator, and is responsible for adding new nodes to the
1895network and configuring them.
1896
1897``mesh cdb create [NetKey(1-16 hex)]``
1898--------------------------------------
1899
1900	Create a Configuration database.
1901
1902	* ``NetKey``: Optional network key value of the primary network key (NetKeyIndex=0).  Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest. Defaults to the default key value if omitted.
1903
1904
1905``mesh cdb clear``
1906------------------
1907
1908	Clear all data from the Configuration database.
1909
1910
1911``mesh cdb show``
1912-----------------
1913
1914	Show all data in the Configuration database.
1915
1916
1917``mesh cdb node-add <UUID(1-16 hex)> <Addr> <ElemCnt> <NetKeyIdx> [DevKey(1-16 hex)]``
1918--------------------------------------------------------------------------------------
1919
1920	Manually add a mesh node to the configuration database. Note that devices provisioned with
1921	``mesh provision`` and ``mesh provision-adv`` will be added automatically if the
1922	Configuration Database is enabled and created.
1923
1924	* ``UUID``: 128-bit hexadecimal UUID of the node. Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest.
1925	* ``Addr``: Unicast address of the node, or 0 to automatically choose the lowest available address.
1926	* ``ElemCnt``: Number of elements on the node.
1927	* ``NetKeyIdx``: The network key the node was provisioned with.
1928	* ``DevKey``: Optional 128-bit device key value for the device. Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest. If omitted, a random value will be generated.
1929
1930
1931``mesh cdb node-del <Addr>``
1932----------------------------
1933
1934	Delete a mesh node from the Configuration database. If possible, the node should be reset
1935	with ``mesh reset`` before it is deleted from the Configuration database, to avoid
1936	unexpected behavior and uncontrolled access to the network.
1937
1938	* ``Addr`` Address of the node to delete.
1939
1940
1941``mesh cdb subnet-add <NetKeyIdx> [<NetKey(1-16 hex)>]``
1942--------------------------------------------------------
1943
1944	Add a network key to the Configuration database. The network key can later be passed to mesh
1945	nodes in the network. Note that adding a key to the Configuration database does not
1946	automatically add it to the local node's list of known network keys.
1947
1948	* ``NetKeyIdx``: Key index of the network key to add.
1949	* ``NetKey``: Optional 128-bit network key value. Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest. If omitted, a random value will be generated.
1950
1951
1952``mesh cdb subnet-del <NetKeyIdx>``
1953-----------------------------------
1954
1955	Delete a network key from the Configuration database.
1956
1957	* ``NetKeyIdx``: Key index of the network key to delete.
1958
1959
1960``mesh cdb app-key-add <NetKeyIdx> <AppKeyIdx> [<AppKey(1-16 hex)>]``
1961---------------------------------------------------------------------
1962
1963	Add an application key to the Configuration database. The application key can later be
1964	passed to mesh nodes in the network. Note that adding a key to the Configuration database
1965	does not automatically add it to the local node's list of known application keys.
1966
1967	* ``NetKeyIdx``: Network key index the application key is bound to.
1968	* ``AppKeyIdx``: Key index of the application key to add.
1969	* ``AppKey``: Optional 128-bit application key value. Providing a hex-string shorter than 16 bytes will populate the N most significant bytes of the array and zero-pad the rest. If omitted, a random value will be generated.
1970
1971
1972``mesh cdb app-key-del <AppKeyIdx>``
1973------------------------------------
1974
1975	Delete an application key from the Configuration database.
1976
1977	* ``AppKeyIdx``: Key index of the application key to delete.
1978
1979
1980On-Demand Private GATT Proxy Client
1981-----------------------------------
1982
1983The On-Demand Private GATT Proxy Client model is an optional mesh subsystem that can be enabled
1984through the :kconfig:option:`CONFIG_BT_MESH_OD_PRIV_PROXY_CLI` configuration option.
1985
1986``mesh models od_priv_proxy od-priv-gatt-proxy [Dur(s)]``
1987---------------------------------------------------------
1988
1989	Set the On-Demand Private GATT Proxy state on active target, or fetch the value of this
1990	state from it.
1991
1992	* ``Dur``: If given, set the state of On-Demand Private GATT Proxy to this value in seconds.  Fetch this value otherwise.
1993
1994
1995Solicitation PDU RPL Client
1996---------------------------
1997
1998The Solicitation PDU RPL Client model is an optional mesh subsystem that can be enabled through the
1999:kconfig:option:`CONFIG_BT_MESH_SOL_PDU_RPL_CLI` configuration option.
2000
2001``mesh models sol_pdu_rpl sol-pdu-rpl-clear <RngStart> <Ackd> [RngLen]``
2002------------------------------------------------------------------------
2003
2004	Clear active target's solicitation replay protection list (SRPL) in given range of
2005	solicitation source (SSRC) addresses.
2006
2007	* ``RngStart``: Start address of the SSRC range.
2008	* ``Ackd``: This argument decides on whether an acknowledged or unacknowledged message will be sent.
2009	* ``RngLen``: Range length for the SSRC addresses to be cleared from the solicitiation RPL list. This parameter is optional; if absent, only a single SSRC address will be cleared.
2010
2011
2012Frame statistic
2013===============
2014
2015``mesh stat get``
2016-----------------
2017
2018	Get the frame statistic. The command prints numbers of received frames, as well as numbers
2019	of planned and succeeded transmission attempts.
2020
2021
2022``mesh stat clear``
2023-------------------
2024
2025	Clear all statistics collected before.
2026