connectivity/bluetooth/api/mesh/shell.html · connectivity/bluetooth/api/mesh/shell.rst 공식 원문 ↗

Zephyr 3.7.0 · Connectivity · Bluetooth Mesh

Bluetooth Mesh Shell

Provisioning부터 Configuration, BLOB·DFU·RPR·CDB까지 Mesh 기능을 interactive shell에서 검증합니다.

Official pathconnectivity/bluetooth/api/mesh/shell.html
Source fileconnectivity/bluetooth/api/mesh/shell.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

Application을 새로 작성하지 않고 Bluetooth Mesh API를 시험하는 mesh 명령 체계입니다. 필수 초기화, target context, provisioning과 foundation/model client, firmware distribution, 원격 provisioning 흐름을 함께 설명합니다.

Commands

176

Source

1,929 lines

Coverage

Provision · Configure · Transfer · Diagnose

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 C35B19551F2A66B02D3326CFE64E434A7B9D8D0171038F1368C3BBC8319729D1
.. _bluetooth_mesh_shell:

Bluetooth Mesh Shell
####################

The Bluetooth Mesh shell subsystem provides a set of Bluetooth Mesh shell commands for the
:ref:`shell_api` module. It allows for testing and exploring the Bluetooth Mesh API through an
interactive interface, without having to write an application.

The Bluetooth Mesh shell interface provides access to most Bluetooth Mesh features, including
provisioning, configuration, and message sending.

Prerequisites
*************

The Bluetooth Mesh shell subsystem depends on the application to create the composition data and do
the mesh initialization.

Application
***********

The Bluetooth Mesh shell subsystem is most easily used through the Bluetooth Mesh shell application
under ``tests/bluetooth/mesh_shell``. See :ref:`shell_api` for information on how to connect and
interact with the Bluetooth Mesh shell application.

Basic usage
***********

The Bluetooth Mesh shell subsystem adds a single ``mesh`` command, which holds a set of
sub-commands. Every time the device boots up, make sure to call ``mesh init`` before any of the
other Bluetooth Mesh shell commands can be called::

	uart:~$ mesh init

This is done to ensure that all available log will be printed to the shell output.

Provisioning
============

The mesh node must be provisioned to become part of the network. This is only necessary the first
time the device boots up, as the device will remember its provisioning data between reboots.

The simplest way to provision the device is through self-provisioning. To do this the user must
provision the device with the default network key and address ``0x0001``, execute::

	uart:~$ mesh prov local 0 0x0001

Since all mesh nodes use the same values for the default network key, this can be done on multiple
devices, as long as they're assigned non-overlapping unicast addresses. Alternatively, to provision
the device into an existing network, the unprovisioned beacon can be enabled with
``mesh prov pb-adv on`` or ``mesh prov pb-gatt on``. The beacons can be picked up by an external
provisioner, which can provision the node into its network.

Once the mesh node is part of a network, its transmission parameters can be controlled by the
general configuration commands:

* To set the destination address, call ``mesh target dst <Addr>``.
* To set the network key index, call ``mesh target net <NetKeyIdx>``.
* To set the application key index, call ``mesh target app <AppKeyIdx>``.

By default, the transmission parameters are set to send messages to the provisioned address and
network key.

Configuration
=============

By setting the destination address to the local unicast address (``0x0001`` in the
``mesh prov local`` command above), we can perform self-configuration through any of the
:ref:`bluetooth_mesh_shell_cfg_cli` commands.

A good first step is to read out the node's own composition data::

	uart:~$ mesh models cfg get-comp

This prints a list of the composition data of the node, including a list of its model IDs.

Next, since the device has no application keys by default, it's a good idea to add one::

	uart:~$ mesh models cfg appkey add 0 0

Message sending
===============

With an application key added (see above), the mesh node's transition parameters are all valid, and
the Bluetooth Mesh shell can send raw mesh messages through the network.

For example, to send a Generic OnOff Set message, call::

	uart:~$ mesh test net-send 82020100

.. note::
	All multibyte fields model messages are in little endian, except the opcode.

The message will be sent to the current destination address, using the current network and
application key indexes. As the destination address points to the local unicast address by default,
the device will only send packets to itself. To change the destination address to the All Nodes
broadcast address, call::

	uart:~$ mesh target dst 0xffff

With the destination address set to ``0xffff``, any other mesh nodes in the network with the
configured network and application keys will receive and process the messages we send.

.. note::
	To change the configuration of the device, the destination address must be set back to the
	local unicast address before issuing any configuration commands.

Sending raw mesh packets is a good way to test model message handler implementations during
development, as it can be done without having to implement the sending model. By default, only the
reception of the model messages can be tested this way, as the Bluetooth Mesh shell only includes
the foundation models. To receive a packet in the mesh node, you have to add a model with a valid
opcode handler list to the composition data in ``subsys/bluetooth/mesh/shell.c``, and print the
incoming message to the shell in the handler callback.

Parameter formats
*****************

The Bluetooth Mesh shell commands are parsed with a variety of formats:

.. list-table:: Parameter formats
	:widths: 1 4 2
	:header-rows: 1

	* - Type
	  - Description
	  - Example
	* - Integers
	  - The default format unless something else is specified. Can be either decimal or
	    hexadecimal.
	  - ``1234``, ``0xabcd01234``
	* - Hexstrings
	  - For raw byte arrays, like UUIDs, key values and message payloads, the parameters should
	    be formatted as an unbroken string of hexadecimal values without any prefix.
	  - ``deadbeef01234``
	* - Booleans
	  - Boolean values are denoted in the API documentation as ``<val(off, on)>``.
	  - ``on``, ``off``, ``enabled``, ``disabled``, ``1``, ``0``

Commands
********

The Bluetooth Mesh shell implements a large set of commands. Some of the commands accept parameters,
which are mentioned in brackets after the command name. For example,
``mesh lpn set <value: off, on>``. Mandatory parameters are marked with angle brackets (e.g.
``<NetKeyIdx>``), and optional parameters are marked with square brackets (e.g. ``[DstAddr]``).

The Bluetooth Mesh shell commands are divided into the following groups:

.. contents::
	:depth: 1
	:local:

.. note::
	Some commands depend on specific features being enabled in the compile time configuration of
	the application. Not all features are enabled by default. The list of available Bluetooth
	mesh shell commands can be shown in the shell by calling ``mesh`` without any arguments.

General configuration
=====================

``mesh init``
-------------

	Initialize the mesh shell. This command must be run before any other mesh command.

``mesh reset-local``
--------------------

	Reset the local mesh node to its initial unprovisioned state. This command will also clear
	the Configuration Database (CDB) if present.

Target
======

The target commands enables the user to monitor and set the target destination address, network
index and application index for the shell. These parameters are used by several commands, like
provisioning, Configuration Client, etc.

``mesh target dst [DstAddr]``
-----------------------------

	Get or set the message destination address. The destination address determines where mesh
	packets are sent with the shell, but has no effect on modules outside the shell's control.

	* ``DstAddr``: If present, sets the new 16-bit mesh destination address. If omitted, the current destination address is printed.


``mesh target net [NetKeyIdx]``
-------------------------------

	Get or set the message network index. The network index determines which network key is used
	to encrypt mesh packets that are sent with the shell, but has no effect on modules outside
	the shell's control. The network key must already be added to the device, either through
	provisioning or by a Configuration Client.

	* ``NetKeyIdx``: If present, sets the new network index. If omitted, the current network index is printed.


``mesh target app [AppKeyIdx]``
-------------------------------

	Get or set the message application index. The application index determines which application
	key is used to encrypt mesh packets that are sent with the shell, but has no effect on
	modules outside the shell's control. The application key must already be added to the device
	by a Configuration Client, and must be bound to the current network index.

	* ``AppKeyIdx``: If present, sets the new application index. If omitted, the current application index is printed.


Low Power Node
==============

``mesh lpn set <Val(off, on)>``
-------------------------------

	Enable or disable Low Power operation. Once enabled, the device will turn off its radio and
	start polling for friend nodes.

	* ``Val``: Sets whether Low Power operation is enabled.

``mesh lpn poll``
-----------------

	Perform a poll to the friend node, to receive any pending messages. Only available when LPN
	is enabled.

Testing
=======

``mesh test net-send <HexString>``
-----------------------------------

	Send a raw mesh message with the current destination address, network and application index.
	The message opcode must be encoded manually.

	* ``HexString`` Raw hexadecimal representation of the message to send.

``mesh test iv-update``
-----------------------

	Force an IV update.


``mesh test iv-update-test <Val(off, on)>``
-------------------------------------------

	Set the IV update test mode. In test mode, the IV update timing requirements are bypassed.

	* ``Val``: Enable or disable the IV update test mode.


``mesh test rpl-clear``
-----------------------

	Clear the replay protection list, forcing the node to forget all received messages.

.. warning::

	Clearing the replay protection list breaks the security mechanisms of the mesh node, making
	it susceptible to message replay attacks. This should never be performed in a real
	deployment.

Health Server Test
------------------

``mesh test health-srv add-fault <FaultID>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Register a new Health Server Fault for the Linux Foundation Company ID.

	* ``FaultID``: ID of the fault to register (``0x0001`` to ``0xFFFF``)


``mesh test health-srv del-fault [FaultID]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Remove registered Health Server faults for the Linux Foundation Company ID.

	* ``FaultID``: If present, the given fault ID will be deleted. If omitted, all registered faults will be cleared.

Provisioning
============

To allow a device to broadcast connectable unprovisioned beacons, the
:kconfig:option:`CONFIG_BT_MESH_PROVISIONEE` configuration option must be enabled, along with the
:kconfig:option:`CONFIG_BT_MESH_PB_GATT` option.

``mesh prov pb-gatt <Val(off, on)>``
------------------------------------

	Start or stop advertising a connectable unprovisioned beacon. The connectable unprovisioned
	beacon allows the mesh node to be discovered by nearby GATT based provisioners, and
	provisioned through the GATT bearer.

	* ``Val``: Enable or disable provisioning with GATT

To allow a device to broadcast unprovisioned beacons, the
:kconfig:option:`CONFIG_BT_MESH_PROVISIONEE` configuration option must be enabled, along with the
:kconfig:option:`CONFIG_BT_MESH_PB_ADV` option.

``mesh prov pb-adv <Val(off, on)>``
-----------------------------------

	Start or stop advertising the unprovisioned beacon. The unprovisioned beacon allows the mesh
	node to be discovered by nearby advertising-based provisioners, and provisioned through the
	advertising bearer.

	* ``Val``: Enable or disable provisioning with advertiser

To allow a device to provision devices, the :kconfig:option:`CONFIG_BT_MESH_PROVISIONER` and
:kconfig:option:`CONFIG_BT_MESH_PB_ADV` configuration options must be enabled.

``mesh prov remote-adv <UUID(1-16 hex)> <NetKeyIdx> <Addr> <AttDur(s)>``
-----------------------------------------------------------------------------------

	Provision a nearby device into the mesh. The mesh node starts scanning for unprovisioned
	beacons with the given UUID. Once found, the unprovisioned device will be added to the mesh
	network with the given unicast address, and given the network key indicated by
	``NetKeyIdx``.

	* ``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.
	* ``NetKeyIdx``: Index of the network key to pass to the device.
	* ``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.
	* ``AttDur``: The duration in seconds the unprovisioned device will identify itself for, if supported. See :ref:`bluetooth_mesh_models_health_srv_attention` for details.

To allow a device to provision devices over GATT, the :kconfig:option:`CONFIG_BT_MESH_PROVISIONER`
and :kconfig:option:`CONFIG_BT_MESH_PB_GATT_CLIENT` configuration options must be enabled.

``mesh prov remote-gatt <UUID(1-16 hex)> <NetKeyIdx> <Addr> <AttDur(s)>``
-------------------------------------------------------------------------

	Provision a nearby device into the mesh. The mesh node starts scanning for connectable
	advertising for PB-GATT with the given UUID. Once found, the unprovisioned device will be
	added to the mesh network with the given unicast address, and given the network key
	indicated by ``NetKeyIdx``.

	* ``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.
	* ``NetKeyIdx``: Index of the network key to pass to the device.
	* ``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.
	* ``AttDur``: The duration in seconds the unprovisioned device will identify itself for, if supported. See :ref:`bluetooth_mesh_models_health_srv_attention` for details.

``mesh prov uuid [UUID(1-16 hex)]``
-----------------------------------

	Get or set the mesh node's UUID, used in the unprovisioned beacons.

	* ``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.


``mesh prov input-num <Number>``
--------------------------------

	Input a numeric OOB authentication value. Only valid when prompted by the shell during
	provisioning. The input number must match the number presented by the other participant in
	the provisioning.

	* ``Number``: Decimal authentication number.


``mesh prov input-str <String>``
--------------------------------

	Input an alphanumeric OOB authentication value. Only valid when prompted by the shell during
	provisioning. The input string must match the string presented by the other participant in
	the provisioning.

	* ``String``: Unquoted alphanumeric authentication string.


``mesh prov static-oob [Val(1-32 hex)]``
----------------------------------------

	Set or clear the static OOB authentication value. The static OOB authentication value must
	be set before provisioning starts to have any effect. The static OOB value must be same on
	both participants in the provisioning. To enable this command, the
	:kconfig:option:`CONFIG_BT_MESH_SHELL_PROV_CTX_INSTANCE` option must be enabled.

	* ``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.


``mesh prov local <NetKeyIdx> <Addr> [IVI]``
--------------------------------------------

	Provision the mesh node itself. If the Configuration database is enabled, the network key
	must be created. Otherwise, the default key value is used.

	* ``NetKeyIdx``: Index of the network key to provision.
	* ``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.
	* ``IVI``: Indicates the current network IV index. Defaults to 0 if omitted.


``mesh prov beacon-listen <Val(off, on)>``
------------------------------------------

	Enable or disable printing of incoming unprovisioned beacons. Allows a provisioner device to
	detect nearby unprovisioned devices and provision them. To enable this command, the
	:kconfig:option:`CONFIG_BT_MESH_SHELL_PROV_CTX_INSTANCE` option must be enabled.

	* ``Val``: Whether to enable the unprovisioned beacon printing.

``mesh prov remote-pub-key <PubKey>``
-------------------------------------
	Provide Device public key.

	* ``PubKey`` - Device public key in big-endian.

``mesh prov auth-method input <Action> <Size>``
-----------------------------------------------
	From the provisioner device, instruct the unprovisioned device to use the specified Input
	OOB authentication action.

	* ``Action`` - Input action. Allowed values:

		* ``0`` - No input action.
		* ``1`` - Push action set.
		* ``2`` - Twist action set.
		* ``4`` - Enter number action set.
		* ``8`` - Enter String action set.
	* ``Size`` - Authentication size.

``mesh prov auth-method output <Action> <Size>``
------------------------------------------------
	From the provisioner device, instruct the unprovisioned device to use the specified Output
	OOB authentication action.

	* ``Action`` - Output action. Allowed values:

		* ``0`` - No output action.
		* ``1`` - Blink action set.
		* ``2`` - Vibrate action set.
		* ``4`` - Display number action set.
		* ``8`` - Display String action set.
	* ``Size`` - Authentication size.

``mesh prov auth-method static <Val(1-16 hex)>``
------------------------------------------------
	From the provisioner device, instruct the unprovisioned device to use static OOB
	authentication, and use the given static authentication value when provisioning.

	* ``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.

``mesh prov auth-method none``
------------------------------
	From the provisioner device, don't use any authentication when provisioning new devices.
	This is the default behavior.

Proxy
=====

The Proxy Server module is an optional mesh subsystem that can be enabled through the
:kconfig:option:`CONFIG_BT_MESH_GATT_PROXY` configuration option.

``mesh proxy identity-enable``
------------------------------

	Enable the Proxy Node Identity beacon, allowing Proxy devices to connect explicitly to this
	device. The beacon will run for 60 seconds before the node returns to normal Proxy beacons.

The Proxy Client module is an optional mesh subsystem that can be enabled through the
:kconfig:option:`CONFIG_BT_MESH_PROXY_CLIENT` configuration option.

``mesh proxy connect <NetKeyIdx>``
----------------------------------

	Auto-Connect a nearby proxy server into the mesh.

	* ``NetKeyIdx``: Index of the network key to connect.


``mesh proxy disconnect <NetKeyIdx>``
-------------------------------------

	Disconnect the existing proxy connection.

	* ``NetKeyIdx``: Index of the network key to disconnect.


``mesh proxy solicit <NetKeyIdx>``
----------------------------------

	Begin Proxy Solicitation of a subnet. Support of this feature can be enabled through the
	:kconfig:option:`CONFIG_BT_MESH_PROXY_SOLICITATION` configuration option.

	* ``NetKeyIdx``: Index of the network key to send Solicitation PDUs to.

.. _bluetooth_mesh_shell_cfg_cli:

Models
======

Configuration Client
--------------------

The Configuration Client model is an optional mesh subsystem that can be enabled through the
:kconfig:option:`CONFIG_BT_MESH_CFG_CLI` configuration option. This is implemented as a separate
module (``mesh models cfg``) inside the ``mesh models`` subcommand list. This module will work on
any instance of the Configuration Client model if the mentioned shell configuration options is
enabled, and as long as the Configuration Client model is present in the model composition of the
application. This shell module can be used for configuring itself and other nodes in the mesh
network.

The Configuration Client uses general message parameters set by ``mesh target dst`` and ``mesh
target net`` to target specific nodes. When the Bluetooth Mesh shell node is provisioned, given that
the :kconfig:option:`CONFIG_BT_MESH_SHELL_PROV_CTX_INSTANCE` option is enabled with the shell
provisioning context initialized, the Configuration Client model targets itself by default.
Similarly, when another node has been provisioned by the Bluetooth Mesh shell, the Configuration
Client model targets the new node. In most common use-cases, the Configuration Client is depending
on the provisioning features and the Configuration database to be fully functional. The
Configuration Client always sends messages using the Device key bound to the destination address, so
it will only be able to configure itself and the mesh nodes it provisioned. The following steps are
an example of how you can set up a device to start using the Configuration Client commands:

* Initialize the client node (``mesh init``).
* Create the CDB (``mesh cdb create``).
* Provision the local device (``mesh prov local``).
* The shell module should now target itself.
* Monitor the composition data of the local node (``mesh models cfg get-comp``).
* Configure the local node as desired with the Configuration Client commands.
* Provision other devices (``mesh prov beacon-listen``) (``mesh prov remote-adv``)
  (``mesh prov remote-gatt``).
* The shell module should now target the newly added node.
* Monitor the newly provisioned nodes and their addresses (``mesh cdb show``).
* Monitor the composition data of the target device (``mesh models cfg get-comp``).
* Configure the node as desired with the Configuration Client commands.

``mesh models cfg target get``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get the target Configuration server for the Configuration Client model.

``mesh models cfg help``
^^^^^^^^^^^^^^^^^^^^^^^^

	Print information for the Configuration Client shell module.

``mesh models cfg reset``
^^^^^^^^^^^^^^^^^^^^^^^^^

	Reset the target device.

``mesh models cfg timeout [Timeout(s)]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get and set the Config Client model timeout used during message sending.

	* ``Timeout``: If present, set the Config Client model timeout in seconds. If omitted, the current timeout is printed.


``mesh models cfg get-comp [Page]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Read a composition data page. The full composition data page will be printed. If the target
	does not have the given page, it will return the last page before it.

	* ``Page``: The composition data page to request. Defaults to 0 if omitted.


``mesh models cfg beacon [Val(off, on)]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get or set the network beacon transmission.

	* ``Val``: If present, enables or disables sending of the network beacon. If omitted, the current network beacon state is printed.


``mesh models cfg ttl [TTL]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get or set the default TTL value.

	* ``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.


``mesh models cfg friend [Val(off, on)]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get or set the Friend feature.

	* ``Val``: If present, enables or disables the Friend feature. If omitted, the current Friend feature state is printed:

		* ``0x00``: The feature is supported, but disabled.
		* ``0x01``: The feature is enabled.
		* ``0x02``: The feature is not supported.


``mesh models cfg gatt-proxy [Val(off, on)]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get or set the GATT Proxy feature.

	* ``Val``: If present, enables or disables the GATT Proxy feature. If omitted, the current GATT Proxy feature state is printed:

		* ``0x00``: The feature is supported, but disabled.
		* ``0x01``: The feature is enabled.
		* ``0x02``: The feature is not supported.


``mesh models cfg relay [<Val(off, on)> [<Count> [Int(ms)]]]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get or set the Relay feature and its parameters.

	* ``Val``: If present, enables or disables the Relay feature. If omitted, the current Relay feature state is printed:

		* ``0x00``: The feature is supported, but disabled.
		* ``0x01``: The feature is enabled.
		* ``0x02``: The feature is not supported.

	* ``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.
	* ``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.

``mesh models cfg node-id <NetKeyIdx> [Identity]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get or Set of current Node Identity state of a subnet.

	* ``NetKeyIdx``: The network key index to Get/Set.
	* ``Identity``: If present, sets the identity of Node Identity state.

``mesh models cfg polltimeout-get <LPNAddr>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get current value of the PollTimeout timer of the LPN within a Friend node.

	* ``LPNAddr`` Address of Low Power node.

``mesh models cfg net-transmit-param [<Count> <Int(ms)>]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get or set the network transmit parameters.

	* ``Count``: Sets the number of additional network transmits for every sent message. Legal retransmit count is 0-7.
	* ``Int``: Sets the new network retransmit interval in milliseconds. Legal interval range is 10-320 milliseconds.


``mesh models cfg netkey add <NetKeyIdx> [Key(1-16 hex)]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Add a network key to the target node. Adds the key to the Configuration Database if enabled.

	* ``NetKeyIdx``: The network key index to add.
	* ``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.


``mesh models cfg netkey upd <NetKeyIdx> [Key(1-16 hex)]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Update a network key to the target node.

	* ``NetKeyIdx``: The network key index to updated.
	* ``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.

``mesh models cfg netkey get``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get a list of known network key indexes.


``mesh models cfg netkey del <NetKeyIdx>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Delete a network key from the target node.

	* ``NetKeyIdx``: The network key index to delete.


``mesh models cfg appkey add <NetKeyIdx> <AppKeyIdx> [Key(1-16 hex)]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Add an application key to the target node. Adds the key to the Configuration Database if
	enabled.

	* ``NetKeyIdx``: The network key index the application key is bound to.
	* ``AppKeyIdx``: The application key index to add.
	* ``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.

``mesh models cfg appkey upd <NetKeyIdx> <AppKeyIdx> [Key(1-16 hex)]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Update an application key to the target node.

	* ``NetKeyIdx``: The network key index the application key is bound to.
	* ``AppKeyIdx``: The application key index to update.
	* ``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.

``mesh models cfg appkey get <NetKeyIdx>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get a list of known application key indexes bound to the given network key index.

	* ``NetKeyIdx``: Network key indexes to get a list of application key indexes from.


``mesh models cfg appkey del <NetKeyIdx> <AppKeyIdx>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Delete an application key from the target node.

	* ``NetKeyIdx``: The network key index the application key is bound to.
	* ``AppKeyIdx``: The application key index to delete.


``mesh models cfg model app-bind <Addr> <AppKeyIdx> <MID> [CID]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Bind an application key to a model. Models can only encrypt and decrypt messages sent with
	application keys they are bound to.

	* ``Addr``: Address of the element the model is on.
	* ``AppKeyIdx``: The application key to bind to the model.
	* ``MID``: The model ID of the model to bind the key to.
	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.


``mesh models cfg model app-unbind <Addr> <AppKeyIdx> <MID> [CID]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Unbind an application key from a model.

	* ``Addr``: Address of the element the model is on.
	* ``AppKeyIdx``: The application key to unbind from the model.
	* ``MID``: The model ID of the model to unbind the key from.
	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.


``mesh models cfg model app-get <ElemAddr> <MID> [CID]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get a list of application keys bound to a model.

	* ``ElemAddr``: Address of the element the model is on.
	* ``MID``: The model ID of the model to get the bound keys of.
	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.


``mesh models cfg model pub <Addr> <MID> [CID] [<PubAddr> <AppKeyIdx> <Cred(off, on)> <TTL> <PerRes> <PerSteps> <Count> <Int(ms)>]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get or set the publication parameters of a model. If all publication parameters are
	included, they become the new publication parameters of the model.  If all publication
	parameters are omitted, print the current publication parameters of the model.

	* ``Addr``: Address of the element the model is on.
	* ``MID``: The model ID of the model to get the bound keys of.
	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.

	Publication parameters:

		* ``PubAddr``: The destination address to publish to.
		* ``AppKeyIdx``: The application key index to publish with.
		* ``Cred``: Whether to publish with Friendship credentials when acting as a Low Power Node.
		* ``TTL``: TTL value to publish with (``0x00`` to ``0x07f``).
		* ``PerRes``: Resolution of the publication period steps:

			* ``0x00``: The Step Resolution is 100 milliseconds
			* ``0x01``: The Step Resolution is 1 second
			* ``0x02``: The Step Resolution is 10 seconds
			* ``0x03``: The Step Resolution is 10 minutes
		* ``PerSteps``: Number of publication period steps, or 0 to disable periodic publication.
		* ``Count``: Number of retransmission for each published message (``0`` to ``7``).
		* ``Int`` The interval between each retransmission, in milliseconds. Must be a multiple of 50.

``mesh models cfg model pub-va <Addr> <UUID(1-16 hex)> <AppKeyIdx> <Cred(off, on)> <TTL> <PerRes> <PerSteps> <Count> <Int(ms)> <MID> [CID]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Set the publication parameters of a model.

	* ``Addr``: Address of the element the model is on.
	* ``MID``: The model ID of the model to get the bound keys of.
	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.

	Publication parameters:

		* ``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.
		* ``AppKeyIdx``: The application key index to publish with.
		* ``Cred``: Whether to publish with Friendship credentials when acting as a Low Power Node.
		* ``TTL``: TTL value to publish with (``0x00`` to ``0x07f``).
		* ``PerRes``: Resolution of the publication period steps:

			* ``0x00``: The Step Resolution is 100 milliseconds
			* ``0x01``: The Step Resolution is 1 second
			* ``0x02``: The Step Resolution is 10 seconds
			* ``0x03``: The Step Resolution is 10 minutes
		* ``PerSteps``: Number of publication period steps, or 0 to disable periodic publication.
		* ``Count``: Number of retransmission for each published message (``0`` to ``7``).
		* ``Int`` The interval between each retransmission, in milliseconds. Must be a multiple of 50.


``mesh models cfg model sub-add <ElemAddr> <SubAddr> <MID> [CID]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Subscription the model to a group address. Models only receive messages sent to their
	unicast address or a group or virtual address they subscribe to. Models may subscribe to
	multiple group and virtual addresses.

	* ``ElemAddr``: Address of the element the model is on.
	* ``SubAddr``: 16-bit group address the model should subscribe to (``0xc000`` to ``0xFEFF``).
	* ``MID``: The model ID of the model to add the subscription to.
	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.


``mesh models cfg model sub-del <ElemAddr> <SubAddr> <MID> [CID]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Unsubscribe a model from a group address.

	* ``ElemAddr``: Address of the element the model is on.
	* ``SubAddr``: 16-bit group address the model should remove from its subscription list (``0xc000`` to ``0xFEFF``).
	* ``MID``: The model ID of the model to add the subscription to.
	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.


``mesh models cfg model sub-add-va <ElemAddr> <LabelUUID(1-16 hex)> <MID> [CID]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Subscribe the model to a virtual address. Models only receive messages sent to their unicast
	address or a group or virtual address they subscribe to. Models may subscribe to multiple
	group and virtual addresses.

	* ``ElemAddr``: Address of the element the model is on.
	* ``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.
	* ``MID``: The model ID of the model to add the subscription to.
	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.


``mesh models cfg model sub-del-va <ElemAddr> <LabelUUID(1-16 hex)> <MID> [CID]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Unsubscribe a model from a virtual address.

	* ``ElemAddr``: Address of the element the model is on.
	* ``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.
	* ``MID``: The model ID of the model to add the subscription to.
	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.

``mesh models cfg model sub-ow <ElemAddr> <SubAddr> <MID> [CID]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Overwrite all model subscriptions with a single new group address.

	* ``ElemAddr``: Address of the element the model is on.
	* ``SubAddr``: 16-bit group address the model should added to the subscription list (``0xc000`` to ``0xFEFF``).
	* ``MID``: The model ID of the model to add the subscription to.
	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.

``mesh models cfg model sub-ow-va <ElemAddr> <LabelUUID(1-16 hex)> <MID> [CID]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Overwrite all model subscriptions with a single new virtual address. Models only receive
	messages sent to their unicast address or a group or virtual address they subscribe to.
	Models may subscribe to multiple group and virtual addresses.

	* ``ElemAddr``: Address of the element the model is on.
	* ``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.
	* ``MID``: The model ID of the model to add the subscription to.
	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.

``mesh models cfg model sub-del-all <ElemAddr> <MID> [CID]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Remove all group and virtual address subscriptions from of a model.

	* ``ElemAddr``: Address of the element the model is on.
	* ``MID``: The model ID of the model to Unsubscribe all.
	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.

``mesh models cfg model sub-get <ElemAddr> <MID> [CID]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get a list of addresses the model subscribes to.

	* ``ElemAddr``: Address of the element the model is on.
	* ``MID``: The model ID of the model to get the subscription list of.
	* ``CID``: If present, determines the Company ID of the model. If omitted, the model is a Bluetooth SIG defined model.


``mesh models cfg krp <NetKeyIdx> [Phase]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get or set the key refresh phase of a subnet.

	* ``NetKeyIdx``: The identified network key used to Get/Set the current Key Refresh Phase state.
	* ``Phase``: New Key Refresh Phase. Valid phases are:

		* ``0x00``: Normal operation; Key Refresh procedure is not active
		* ``0x01``: First phase of Key Refresh procedure
		* ``0x02``: Second phase of Key Refresh procedure

``mesh models cfg hb-sub [<Src> <Dst> <Per>]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get or set the Heartbeat subscription parameters. A node only receives Heartbeat messages
	matching the Heartbeat subscription parameters. Sets the Heartbeat subscription parameters
	if present, or prints the current Heartbeat subscription parameters if called with no
	parameters.

	* ``Src``: Unicast source address to receive Heartbeat messages from.
	* ``Dst``: Destination address to receive Heartbeat messages on.
	* ``Per``: Logarithmic representation of the Heartbeat subscription period:

		* ``0``: Heartbeat subscription will be disabled.
		* ``1`` to ``17``: The node will subscribe to Heartbeat messages for 2\ :sup:`(period - 1)` seconds.


``mesh models cfg hb-pub [<Dst> <Count> <Per> <TTL> <Features> <NetKeyIdx>]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get or set the Heartbeat publication parameters. Sets the Heartbeat publication parameters
	if present, or prints the current Heartbeat publication parameters if called with no
	parameters.

	* ``Dst``: Destination address to publish Heartbeat messages to.
	* ``Count``: Logarithmic representation of the number of Heartbeat messages to publish periodically:

		* ``0``: Heartbeat messages are not published periodically.
		* ``1`` to ``17``: The node will periodically publish 2\ :sup:`(count - 1)` Heartbeat messages.
		* ``255``: Heartbeat messages will be published periodically indefinitely.

	* ``Per``: Logarithmic representation of the Heartbeat publication period:

		* ``0``: Heartbeat messages are not published periodically.
		* ``1`` to ``17``: The node will publish Heartbeat messages every 2\ :sup:`(period - 1)` seconds.

	* ``TTL``: The TTL value to publish Heartbeat messages with (``0x00`` to ``0x7f``).
	* ``Features``: Bitfield of features that should trigger a Heartbeat publication when changed:

		* ``Bit 0``: Relay feature.
		* ``Bit 1``: Proxy feature.
		* ``Bit 2``: Friend feature.
		* ``Bit 3``: Low Power feature.

	* ``NetKeyIdx``: Index of the network key to publish Heartbeat messages with.


Health Client
-------------

The Health Client model is an optional mesh subsystem that can be enabled through the
:kconfig:option:`CONFIG_BT_MESH_HEALTH_CLI` configuration option. This is implemented as a separate
module (``mesh models health``) inside the ``mesh models`` subcommand list. This module will work on
any instance of the Health Client model if the mentioned shell configuration options is enabled, and
as long as one or more Health Client model(s) is present in the model composition of the
application. This shell module can be used to trigger interaction between Health Clients and Servers
on devices in a Mesh network.

By default, the module will choose the first Health Client instance in the model composition when
using the Health Client commands. To choose a specific Health Client instance the user can utilize
the commands ``mesh models health instance set`` and ``mesh models health instance get-all``.

The Health Client may use the general messages parameters set by ``mesh target dst``,
``mesh target net`` and ``mesh target app`` to target specific nodes. If the shell target
destination address is set to zero, the targeted Health Client will attempt to publish messages
using its configured publication parameters.

``mesh models health instance set <ElemIdx>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Set the Health Client model instance to use.

	* ``ElemIdx``: Element index of Health Client model.

``mesh models health instance get-all``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Prints all available Health Client model instances on the device.

``mesh models health fault-get <CID>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get a list of registered faults for a Company ID.

	* ``CID``: Company ID to get faults for.


``mesh models health fault-clear <CID>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Clear the list of faults for a Company ID.

	* ``CID``: Company ID to clear the faults for.


``mesh models health fault-clear-unack <CID>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Clear the list of faults for a Company ID without requesting a response.

	* ``CID``: Company ID to clear the faults for.


``mesh models health fault-test <CID> <TestID>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Invoke a self-test procedure, and show a list of triggered faults.

	* ``CID``: Company ID to perform self-tests for.
	* ``TestID``: Test to perform.


``mesh models health fault-test-unack <CID> <TestID>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Invoke a self-test procedure without requesting a response.

	* ``CID``: Company ID to perform self-tests for.
	* ``TestID``: Test to perform.


``mesh models health period-get``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get the current Health Server publish period divisor.


``mesh models health period-set <Divisor>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Set the current Health Server publish period divisor. When a fault is detected, the Health
	Server will start publishing is fault status with a reduced interval. The reduced interval
	is determined by the Health Server publish period divisor: Fault publish period = Publish
	period / 2\ :sup:`divisor`.

	* ``Divisor``: The new Health Server publish period divisor.


``mesh models health period-set-unack <Divisor>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Set the current Health Server publish period divisor. When a fault is detected, the Health
	Server will start publishing is fault status with a reduced interval. The reduced interval
	is determined by the Health Server publish period divisor: Fault publish period = Publish
	period / 2\ :sup:`divisor`.

	* ``Divisor``: The new Health Server publish period divisor.


``mesh models health attention-get``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get the current Health Server attention state.


``mesh models health attention-set <Time(s)>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Enable the Health Server attention state for some time.

	* ``Time``: Duration of the attention state, in seconds (``0`` to ``255``)


``mesh models health attention-set-unack <Time(s)>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Enable the Health Server attention state for some time without requesting a response.

	* ``Time``: Duration of the attention state, in seconds (``0`` to ``255``)


Binary Large Object (BLOB) Transfer Client model
------------------------------------------------

The :ref:`bluetooth_mesh_blob_cli` can be added to the mesh shell by enabling the
:kconfig:option:`CONFIG_BT_MESH_BLOB_CLI` option, and disabling the
:kconfig:option:`CONFIG_BT_MESH_DFU_CLI` option.

``mesh models blob cli target <Addr>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Add a Target node for the next BLOB transfer.

	* ``Addr``: Unicast address of the Target node's BLOB Transfer Server model.


``mesh models blob cli bounds [<Group>]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get the total boundary parameters of all Target nodes.

	* ``Group``: Optional group address to use when communicating with Target nodes. If omitted, the BLOB Transfer Client will address each Target node individually.


``mesh models blob cli tx <Id> <Size> <BlockSizeLog> <ChunkSize> [<Group> [<Mode(push, pull)>]]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Perform a BLOB transfer to Target nodes. The BLOB Transfer Client will send a dummy BLOB to
	all Target nodes, then post a message when the transfer is completed. Note that all Target
	nodes must first be configured to receive the transfer using the ``mesh models blob srv rx``
	command.

	* ``Id``: 64-bit BLOB transfer ID.
	* ``Size``: Size of the BLOB in bytes.
	* ``BlockSizeLog``: Logarithmic representation of the BLOB's block size. The final block size will be ``1 << block size log`` bytes.
	* ``ChunkSize``: Chunk size in bytes.
	* ``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.
	* ``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.


``mesh models blob cli tx-cancel``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Cancel an ongoing BLOB transfer.

``mesh models blob cli tx-get [Group]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Determine the progress of a previously running BLOB transfer. Can be used when not
	performing a BLOB transfer.

	* ``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.


``mesh models blob cli tx-suspend``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Suspend the ongoing BLOB transfer.


``mesh models blob cli tx-resume``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Resume the suspended BLOB transfer.

``mesh models blob cli instance-set <ElemIdx>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Use the BLOB Transfer Client model instance on the specified element when using the other
	BLOB Transfer Client model commands.

	* ``ElemIdx``: The element on which to find the BLOB Transfer Client model instance to use.

``mesh models blob cli instance-get-all``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get a list of all BLOB Transfer Client model instances on the node.


BLOB Transfer Server model
--------------------------

The :ref:`bluetooth_mesh_blob_srv` can be added to the mesh shell by enabling the
:kconfig:option:`CONFIG_BT_MESH_BLOB_SRV` option. The BLOB Transfer Server model is capable of
receiving any BLOB data, but the implementation in the mesh shell will discard the incoming data.


``mesh models blob srv rx <ID> [<TimeoutBase(10s steps)>]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Prepare to receive a BLOB transfer.

	* ``ID``: 64-bit BLOB transfer ID to receive.
	* ``TimeoutBase``: Optional additional time to wait for client messages, in 10-second increments.


``mesh models blob srv rx-cancel``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Cancel an ongoing BLOB transfer.

``mesh models blob srv instance-set <ElemIdx>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Use the BLOB Transfer Server model instance on the specified element when using the other
	BLOB Transfer Server model commands.

	* ``ElemIdx``: The element on which to find the BLOB Transfer Server model instance to use.

``mesh models blob srv instance-get-all``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get a list of all BLOB Transfer Server model instances on the node.


Firmware Update Client model
----------------------------

The Firmware Update Client model can be added to the mesh shell by enabling configuration options
:kconfig:option:`CONFIG_BT_MESH_BLOB_CLI` and :kconfig:option:`CONFIG_BT_MESH_DFU_CLI`. The Firmware
Update Client demonstrates the firmware update Distributor role by transferring a dummy firmware
update to a set of Target nodes.


``mesh models dfu slot add <Size> <FwID> [<Metadata>]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Add a virtual DFU image slot that can be transferred as a DFU image. The image slot will be
	assigned an image slot index, which is printed as a response, and can be used to reference
	the slot in other commands. To update the image slot, remove it using the
	``mesh models dfu slot del`` shell command and then add it again.

	* ``Size``: DFU image slot size in bytes.
	* ``FwID``: Firmware ID, formatted as a hexstring.
	* ``Metadata``: Optional firmware metadata, formatted as a hexstring.


``mesh models dfu slot del <SlotIdx>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Delete the DFU image slot at the given index.

	* ``SlotIdx``: Index of the slot to delete.


``mesh models dfu slot get <SlotIdx>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get all available information about a DFU image slot.

	* ``SlotIdx``: Index of the slot to get.


``mesh models dfu cli target <Addr> <ImgIdx>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Add a Target node.

	* ``Addr``: Unicast address of the Target node.
	* ``ImgIdx``: Image index to address on the Target node.


``mesh models dfu cli target-state``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Check the DFU Target state of the device at the configured destination address.


``mesh models dfu cli target-imgs [<MaxCount>]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get a list of DFU images on the device at the configured destination address.

	* ``MaxCount``: Optional maximum number of images to return. If omitted, there's no limit on the number of returned images.


``mesh models dfu cli target-check <SlotIdx> <TargetImgIdx>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Check whether the device at the configured destination address will accept a DFU transfer
	from the given DFU image slot to the Target node's DFU image at the given index, and what
	the effect would be.

	* ``SlotIdx``: Index of the local DFU image slot to check.
	* ``TargetImgIdx``: Index of the Target node's DFU image to check.


``mesh models dfu cli send <SlotIdx> [<Group>]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Start a DFU transfer to all added Target nodes.

	* ``SlotIdx``: Index of the local DFU image slot to send.
	* ``Group``: Optional group address to use when communicating with the Target nodes. If omitted, the Firmware Update Client will address each Target node individually.


``mesh models dfu cli cancel [<Addr>]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Cancel the DFU procedure at any state on a specific Target node or on all Target nodes. When
	a Target node address is provided, the Firmware Update Client model will try to cancel the
	DFU procedure on the provided Target node. Otherwise, the Firmware Update Client model will
	try to cancel the ongoing DFU procedure on all Target nodes.

	* ``Addr``: Optional unicast address of a Target node on which to cancel the DFU procedure.


``mesh models dfu cli apply``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Apply the most recent DFU transfer on all Target nodes. Can only be called after a DFU
	transfer is completed.


``mesh models dfu cli confirm``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Confirm that the most recent DFU transfer was successfully applied on all Target nodes. Can
	only be called after a DFU transfer is completed and applied.


``mesh models dfu cli suspend``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Suspend the ongoing DFU transfer.


``mesh models dfu cli resume``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Resume the suspended DFU transfer.


``mesh models dfu cli progress``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Check the progress of the current transfer.


``mesh models dfu cli instance-set <ElemIdx>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Use the Firmware Update Client model instance on the specified element when using the other
	Firmware Update Client model commands.

	* ``ElemIdx``: The element on which to find the Firmware Update Client model instance to use.

``mesh models dfu cli instance-get-all``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get a list of all Firmware Update Client model instances on the node.


Firmware Update Server model
----------------------------

The Firmware Update Server model can be added to the mesh shell by enabling configuration options
:kconfig:option:`CONFIG_BT_MESH_BLOB_SRV` and :kconfig:option:`CONFIG_BT_MESH_DFU_SRV`. The Firmware
Update Server demonstrates the firmware update Target role by accepting any firmware update. The
mesh shell Firmware Update Server will discard the incoming firmware data, but otherwise behave as a
proper firmware update Target node.


``mesh models dfu srv applied``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Mark the most recent DFU transfer as applied. Can only be called after a DFU transfer is
	completed, and the Distributor has requested that the transfer is applied.

	As the mesh shell Firmware Update Server doesn't actually apply the incoming firmware image,
	this command can be used to emulate an applied status, to notify the Distributor that the
	transfer was successful.


``mesh models dfu srv progress``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Check the progress of the current transfer.

``mesh models dfu srv rx-cancel``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Cancel incoming DFU transfer.

``mesh models dfu srv instance-set <ElemIdx>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Use the Firmware Update Server model instance on the specified element when using the other
	Firmware Update Server model commands.

	* ``ElemIdx``: The element on which to find the Firmware Update Server model instance to use.

``mesh models dfu srv instance-get-all``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get a list of all Firmware Update Server model instances on the node.


.. _bluetooth_mesh_shell_dfd_server:

Firmware Distribution Server model
----------------------------------

The Firmware Distribution Server model commands can be added to the mesh shell by enabling the
:kconfig:option:`CONFIG_BT_MESH_DFD_SRV` configuration option. The shell commands for this model
mirror the messages sent to the server by a Firmware Distribution Client model. To use these
commands, a Firmware Distribution Server must be instantiated by the application.

``mesh models dfd receivers-add <Addr>,<FwIdx>[;<Addr>,<FwIdx>]...``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Add receivers to the Firmware Distribution Server. Supply receivers as a list of
	comma-separated addr,fw_idx pairs, separated by semicolons, for example,
	``0x0001,0;0x0002,0;0x0004,1``.  Do not use spaces in the receiver list. Repeated calls to
	this command will continue populating the receivers list until
	``mesh models dfd receivers-delete-all`` is called.

	* ``Addr``: Address of the receiving node(s).
	* ``FwIdx``: Index of the firmware slot to send to ``Addr``.

``mesh models dfd receivers-delete-all``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Delete all receivers from the server.

``mesh models dfd receivers-get <First> <Count>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get a list of info about firmware receivers.

	* ``First``: Index of the first receiver to get from the receiver list.
	* ``Count``: The number of receivers for which to get info.

``mesh models dfd capabilities-get``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get the capabilities of the server.

``mesh models dfd get``
^^^^^^^^^^^^^^^^^^^^^^^

	Get information about the current distribution state, phase and the transfer parameters.

``mesh models dfd start <AppKeyIdx> <SlotIdx> [<Group> [<PolicyApply> [<TTL> [<TimeoutBase> [<XferMode>]]]]]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Start the firmware distribution.

	* ``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.
	* ``SlotIdx``: Index of the local image slot to send.
	* ``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.
	* ``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.
	* ``TTL``: Optional. TTL value to use when sending. Defaults to configured default TTL.
	* ``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.
	* ``XferMode``: Optional BLOB transfer mode. 1 = Push mode (Push BLOB Transfer Mode), 2 = Pull mode (Pull BLOB Transfer Mode). Defaults to Push mode.

``mesh models dfd suspend``
^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Suspends the ongoing distribution.

``mesh models dfd cancel``
^^^^^^^^^^^^^^^^^^^^^^^^^^

	Cancel the ongoing distribution.

``mesh models dfd apply``
^^^^^^^^^^^^^^^^^^^^^^^^^

	Apply the distributed firmware.

``mesh models dfd fw-get <FwID>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get information about the firmware image uploaded to the server.

	* ``FwID``: Firmware ID of the image to get.

``mesh models dfd fw-get-by-idx <Idx>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get information about the firmware image uploaded to the server in a specific slot.

	* ``Idx``: Index of the slot to get the image from.

``mesh models dfd fw-delete <FwID>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Delete a firmware image from the server.

	* ``FwID``: Firmware ID of the image to delete.

``mesh models dfd fw-delete-all``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Delete all firmware images from the server.

``mesh models dfd instance-set <ElemIdx>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Use the Firmware Distribution Server model instance on the specified element when using the
	other Firmware Distribution Server model commands.

	* ``ElemIdx``: The element on which to find the Firmware Distribution Server model instance to use.

``mesh models dfd instance-get-all``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get a list of all Firmware Distribution Server model instances on the node.


.. _bluetooth_mesh_shell_dfu_metadata:

DFU metadata
------------

The DFU metadata commands allow generating metadata that can be used by a Target node to check the
firmware before accepting it. The commands are enabled through the
:kconfig:option:`CONFIG_BT_MESH_DFU_METADATA` configuration option.

``mesh models dfu metadata comp-clear``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Clear the stored composition data to be used for the Target node.

``mesh models dfu metadata comp-add <CID> <ProductID> <VendorID> <Crpl> <Features>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Create a header of the Composition Data Page 0.

	* ``CID``: Company identifier assigned by Bluetooth SIG.
	* ``ProductID``: Vendor-assigned product identifier.
	* ``VendorID``: Vendor-assigned version identifier.
	* ``Crpl``: The size of the replay protection list.
	* ``Features``: Features supported by the node in bit field format:

		* ``0``: Relay.
		* ``1``: Proxy.
		* ``2``: Friend.
		* ``3``: Low Power.

``mesh models dfu metadata comp-elem-add <Loc> <NumS> <NumV> {<SigMID>|<VndCID> <VndMID>}...``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	Add element description of the Target node.

	* ``Loc``: Element location.
	* ``NumS``: Number of SIG models instantiated on the element.
	* ``NumV``: Number of vendor models instantiated on the element.
	* ``SigMID``: SIG Model ID.
	* ``VndCID``: Vendor model company identifier.
	* ``VndMID``: Vendor model identifier.

``mesh models dfu metadata comp-hash-get [<Key(16 hex)>]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Generate a hash of the stored Composition Data to be used in metadata.

	* ``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.

``mesh models dfu metadata encode <Major> <Minor> <Rev> <BuildNum> <Size> <CoreType> <Hash> <Elems> [<UserData>]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Encode metadata for the DFU.

	* ``Major``: Major version of the firmware.
	* ``Minor``: Minor version of the firmware.
	* ``Rev``: Revision number of the firmware.
	* ``BuildNum``: Build number.
	* ``Size``: Size of the signed bin file.
	* ``CoreType``: New firmware core type:

		* ``1``: Application core.
		* ``2``: Network core.
		* ``4``: Applications specific BLOB.
	* ``Hash``: Hash of the composition data generated using ``mesh models dfu metadata comp-hash-get`` command.
	* ``Elems``: Number of elements on the new firmware.
	* ``UserData``: User data supplied with the metadata.


Segmentation and Reassembly (SAR) Configuration Client
------------------------------------------------------

The SAR Configuration client is an optional mesh model that can be enabled through the
:kconfig:option:`CONFIG_BT_MESH_SAR_CFG_CLI` configuration option. The SAR Configuration Client
model is used to support the functionality of configuring the behavior of the lower transport layer
of a node that supports the SAR Configuration Server model.


``mesh models sar tx-get``
^^^^^^^^^^^^^^^^^^^^^^^^^^

	Send SAR Configuration Transmitter Get message.

``mesh models sar tx-set <SegIntStep> <UniRetransCnt> <UniRetransWithoutProgCnt> <UniRetransIntStep> <UniRetransIntInc> <MultiRetransCnt> <MultiRetransInt>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Send SAR Configuration Transmitter Set message.

	* ``SegIntStep``: SAR Segment Interval Step state.
	* ``UniRetransCnt``: SAR Unicast Retransmissions Count state.
	* ``UniRetransWithoutProgCnt``: SAR Unicast Retransmissions Without Progress Count state.
	* ``UniRetransIntStep``: SAR Unicast Retransmissions Interval Step state.
	* ``UniRetransIntInc``: SAR Unicast Retransmissions Interval Increment state.
	* ``MultiRetransCnt``: SAR Multicast Retransmissions Count state.
	* ``MultiRetransInt``: SAR Multicast Retransmissions Interval state.

``mesh models sar rx-get``
^^^^^^^^^^^^^^^^^^^^^^^^^^

	Send SAR Configuration Receiver Get message.

``mesh models sar rx-set <SegThresh> <AckDelayInc> <DiscardTimeout> <RxSegIntStep> <AckRetransCount>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Send SAR Configuration Receiver Set message.

	* ``SegThresh``: SAR Segments Threshold state.
	* ``AckDelayInc``: SAR Acknowledgment Delay Increment state.
	* ``DiscardTimeout``: SAR Discard Timeout state.
	* ``RxSegIntStep``: SAR Receiver Segment Interval Step state.
	* ``AckRetransCount``: SAR Acknowledgment Retransmissions Count state.


Private Beacon Client
---------------------

The Private Beacon Client model is an optional mesh subsystem that can be enabled through the
:kconfig:option:`CONFIG_BT_MESH_PRIV_BEACON_CLI` configuration option.

``mesh models prb priv-beacon-get``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get the target's Private Beacon state. Possible values:

		* ``0x00``: The node doesn't broadcast Private beacons.
		* ``0x01``: The node broadcasts Private beacons.

``mesh models prb priv-beacon-set <Val(off, on)> <RandInt(10s steps)>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Set the target's Private Beacon state.

	* ``Val``: Control Private Beacon state.
	* ``RandInt``: Random refresh interval (in 10-second steps), or 0 to keep current value.

``mesh models prb priv-gatt-proxy-get``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get the target's Private GATT Proxy state. Possible values:

		* ``0x00``: The Private Proxy functionality is supported, but disabled.
		* ``0x01``: The Private Proxy functionality is enabled.
		* ``0x02``: The Private Proxy functionality is not supported.

``mesh models prb priv-gatt-proxy-set <Val(off, on)>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Set the target's Private GATT Proxy state.

	* ``Val``: New Private GATT Proxy value:

		* ``0x00``: Disable the Private Proxy functionality.
		* ``0x01``: Enable the Private Proxy functionality.

``mesh models prb priv-node-id-get <NetKeyIdx>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get the target's Private Node Identity state. Possible values:

		* ``0x00``: The node does not adverstise with the Private Node Identity.
		* ``0x01``: The node advertises with the Private Node Identity.
		* ``0x02``: The node doesn't support advertising with the Private Node Identity.

	* ``NetKeyIdx``: Network index to get the Private Node Identity state of.

``mesh models prb priv-node-id-set <NetKeyIdx> <State>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Set the target's Private Node Identity state.

	* ``NetKeyIdx``: Network index to set the Private Node Identity state of.
	* ``State``: New Private Node Identity value:

		* ``0x00``: Stop advertising with the Private Node Identity.
		* ``0x01``: Start advertising with the Private Node Identity.


Opcodes Aggregator Client
-------------------------

The Opcodes Aggregator client is an optional Bluetooth Mesh model that can be enabled through the
:kconfig:option:`CONFIG_BT_MESH_OP_AGG_CLI` configuration option. The Opcodes Aggregator Client
model is used to support the functionality of dispatching a sequence of access layer messages to
nodes supporting the Opcodes Aggregator Server model.

``mesh models opagg seq-start <ElemAddr>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Start the Opcodes Aggregator Sequence message. This command initiates the context for
	aggregating messages and sets the destination address for next shell commands to
	``elem_addr``.

	* ``ElemAddr``: Element address that will process the aggregated opcodes.

``mesh models opagg seq-send``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Send the Opcodes Aggregator Sequence message. This command completes the procedure, sends
	the aggregated sequence message to the target node and clears the context.

``mesh models opagg seq-abort``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Abort the Opcodes Aggregator Sequence message. This command clears the Opcodes Aggregator
	Client context.


Remote Provisioning Client
--------------------------

The Remote Provisioning Client is an optional Bluetooth Mesh model enabled through the
:kconfig:option:`CONFIG_BT_MESH_RPR_CLI` configuration option. The Remote Provisioning Client model
provides support for remote provisioning of devices into a mesh network by using the Remote
Provisioning Server model.

This shell module can be used to trigger interaction between Remote Provisioning Clients and Remote
Provisioning Servers on devices in a mesh network.

``mesh models rpr scan <Timeout(s)> [<UUID(1-16 hex)>]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Start scanning for unprovisioned devices.

	* ``Timeout``: Scan timeout in seconds. Must be at least 1 second.
	* ``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.

``mesh models rpr scan-ext <Timeout(s)> <UUID(1-16 hex)> [<ADType> ... ]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Start the extended scanning for unprovisioned devices.

	* ``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`.
	* ``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.
	* ``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.

``mesh models rpr scan-srv [<ADType> ... ]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Start the extended scanning for the Remote Provisioning Server.

	* ``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.

``mesh models rpr scan-caps``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get the scanning capabilities of the Remote Provisioning Server.

``mesh models rpr scan-get``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get the current scanning state of the Remote Provisioning Server.

``mesh models rpr scan-stop``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Stop any ongoing scanning on the Remote Provisioning Server.

``mesh models rpr link-get``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get the current link status of the Remote Provisioning Server.

``mesh models rpr link-close``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Close any open links on the Remote Provisioning Server.

``mesh models rpr provision-remote <UUID(1-16 hex)> <NetKeyIdx> <Addr>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Provision a mesh node using the PB-Remote provisioning bearer.

	* ``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.
	* ``NetKeyIdx``: Network Key Index to give to the unprovisioned node.
	* ``Addr``: Address to assign to remote device. If ``addr`` is 0, the lowest available address will be chosen.

``mesh models rpr reprovision-remote <Addr> [<CompChanged(false, true)>]``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Reprovision a mesh node using the PB-Remote provisioning bearer.

	* ``Addr``: Address to assign to remote device. If ``addr`` is 0, the lowest available address will be chosen.
	* ``CompChanged``: The Target node has indicated that its Composition Data has changed.  Defaults to false.

``mesh models rpr instance-set <ElemIdx>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Use the Remote Provisioning Client model instance on the specified element when using the
	other Remote Provisioning Client model commands.

	* ``ElemIdx``: The element on which to find the Remote Provisioning Client model instance to use.

``mesh models rpr instance-get-all``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Get a list of all Remote Provisioning Client model instances on the node.


Large Composition Data Client
-----------------------------

The Large Composition Data Client is an optional Bluetooth Mesh model enabled through the
:kconfig:option:`CONFIG_BT_MESH_LARGE_COMP_DATA_CLI` configuration option. The Large Composition Data Client
model is used to support the functionality of reading pages of Composition Data that do not fit in
a Config Composition Data Status message, and reading the metadata of the model instances.

``mesh models lcd large-comp-data-get <Page> <Offset>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Send the Large Composition Data Get message to query a portion of the Composition Data state of a node.

	* ``Page``: Page number of the Composition Data.
	* ``Offset``: Offset within the page.

``mesh models lcd models-metadata-get <Page> <Offset>``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Send the Models Metadata Get message to query a portion of a page of the Models Metadata state.

	* ``Page``: Page number of the Models Metadata.
	* ``Offset``: Offset within the page.


Configuration database
======================

The Configuration database is an optional mesh subsystem that can be enabled through the
:kconfig:option:`CONFIG_BT_MESH_CDB` configuration option. The Configuration database is only
available on provisioner devices, and allows them to store all information about the mesh network.
To avoid conflicts, there should only be one mesh node in the network with the Configuration
database enabled. This node is the Configurator, and is responsible for adding new nodes to the
network and configuring them.

``mesh cdb create [NetKey(1-16 hex)]``
--------------------------------------

	Create a Configuration database.

	* ``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.


``mesh cdb clear``
------------------

	Clear all data from the Configuration database.


``mesh cdb show``
-----------------

	Show all data in the Configuration database.


``mesh cdb node-add <UUID(1-16 hex)> <Addr> <ElemCnt> <NetKeyIdx> [DevKey(1-16 hex)]``
--------------------------------------------------------------------------------------

	Manually add a mesh node to the configuration database. Note that devices provisioned with
	``mesh provision`` and ``mesh provision-adv`` will be added automatically if the
	Configuration Database is enabled and created.

	* ``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.
	* ``Addr``: Unicast address of the node, or 0 to automatically choose the lowest available address.
	* ``ElemCnt``: Number of elements on the node.
	* ``NetKeyIdx``: The network key the node was provisioned with.
	* ``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.


``mesh cdb node-del <Addr>``
----------------------------

	Delete a mesh node from the Configuration database. If possible, the node should be reset
	with ``mesh reset`` before it is deleted from the Configuration database, to avoid
	unexpected behavior and uncontrolled access to the network.

	* ``Addr`` Address of the node to delete.


``mesh cdb subnet-add <NetKeyIdx> [<NetKey(1-16 hex)>]``
--------------------------------------------------------

	Add a network key to the Configuration database. The network key can later be passed to mesh
	nodes in the network. Note that adding a key to the Configuration database does not
	automatically add it to the local node's list of known network keys.

	* ``NetKeyIdx``: Key index of the network key to add.
	* ``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.


``mesh cdb subnet-del <NetKeyIdx>``
-----------------------------------

	Delete a network key from the Configuration database.

	* ``NetKeyIdx``: Key index of the network key to delete.


``mesh cdb app-key-add <NetKeyIdx> <AppKeyIdx> [<AppKey(1-16 hex)>]``
---------------------------------------------------------------------

	Add an application key to the Configuration database. The application key can later be
	passed to mesh nodes in the network. Note that adding a key to the Configuration database
	does not automatically add it to the local node's list of known application keys.

	* ``NetKeyIdx``: Network key index the application key is bound to.
	* ``AppKeyIdx``: Key index of the application key to add.
	* ``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.


``mesh cdb app-key-del <AppKeyIdx>``
------------------------------------

	Delete an application key from the Configuration database.

	* ``AppKeyIdx``: Key index of the application key to delete.


On-Demand Private GATT Proxy Client
-----------------------------------

The On-Demand Private GATT Proxy Client model is an optional mesh subsystem that can be enabled
through the :kconfig:option:`CONFIG_BT_MESH_OD_PRIV_PROXY_CLI` configuration option.

``mesh models od_priv_proxy od-priv-gatt-proxy [Dur(s)]``
---------------------------------------------------------

	Set the On-Demand Private GATT Proxy state on active target, or fetch the value of this
	state from it.

	* ``Dur``: If given, set the state of On-Demand Private GATT Proxy to this value in seconds.  Fetch this value otherwise.


Solicitation PDU RPL Client
---------------------------

The Solicitation PDU RPL Client model is an optional mesh subsystem that can be enabled through the
:kconfig:option:`CONFIG_BT_MESH_SOL_PDU_RPL_CLI` configuration option.

``mesh models sol_pdu_rpl sol-pdu-rpl-clear <RngStart> <Ackd> [RngLen]``
------------------------------------------------------------------------

	Clear active target's solicitation replay protection list (SRPL) in given range of
	solicitation source (SSRC) addresses.

	* ``RngStart``: Start address of the SSRC range.
	* ``Ackd``: This argument decides on whether an acknowledged or unacknowledged message will be sent.
	* ``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.


Frame statistic
===============

``mesh stat get``
-----------------

	Get the frame statistic. The command prints numbers of received frames, as well as numbers
	of planned and succeeded transmission attempts.


``mesh stat clear``
-------------------

	Clear all statistics collected before.

Part 3

한국어 전문 번역

Bluetooth Mesh Shell

Bluetooth Mesh shell 하위 시스템은 shell_api 모듈에서 사용할 Bluetooth Mesh 명령 집합을 제공합니다. 별도 application을 작성하지 않고도 대화형 interface에서 Bluetooth Mesh API를 시험하고 탐색할 수 있으며, provisioning, configuration, message 전송을 포함한 대부분의 Mesh 기능에 접근합니다.

사전 조건

Application이 composition data를 만들고 Mesh를 초기화해야 합니다.

Application

가장 간단한 사용 경로는 tests/bluetooth/mesh_shell의 Bluetooth Mesh shell application입니다. 연결하고 상호 작용하는 방법은 Shell API 문서를 따릅니다.

기본 사용법

하위 명령을 담는 최상위 mesh 명령 하나가 추가됩니다. Device가 boot할 때마다 다른 Mesh shell 명령보다 먼저 mesh init을 실행해야 모든 log가 shell output에 출력됩니다.

uart:~$ mesh init

Provisioning 빠른 시작

Node가 network에 참여하려면 최초 한 번 provisioning해야 하며, provisioning data는 reboot 뒤에도 유지됩니다. 기본 network key와 0x0001 주소로 self-provisioning하려면 다음을 실행합니다.

uart:~$ mesh prov local 0 0x0001

기본 network key 값은 모든 Mesh node에서 같으므로, 서로 겹치지 않는 unicast address를 주면 여러 device에 사용할 수 있습니다. 기존 network에 넣을 때는 mesh prov pb-adv on 또는 mesh prov pb-gatt on으로 unprovisioned beacon을 켜고 외부 Provisioner가 node를 편입하게 합니다.

  • 목적지 주소: mesh target dst <Addr>
  • Network key index: mesh target net <NetKeyIdx>
  • Application key index: mesh target app <AppKeyIdx>

기본 전송값은 provision된 주소와 network key를 사용합니다.

Configuration 빠른 시작

목적지를 local unicast address로 두면 Configuration Client 명령으로 자신을 구성할 수 있습니다. 먼저 mesh models cfg get-comp로 model ID를 포함한 composition data를 읽고, 기본 상태에는 application key가 없으므로 mesh models cfg appkey add 0 0으로 하나를 추가하는 것이 좋습니다.

uart:~$ mesh models cfg get-comp
uart:~$ mesh models cfg appkey add 0 0

Message 전송

Application key를 추가하면 raw Mesh message를 보낼 수 있습니다. 예를 들어 Generic OnOff Set은 mesh test net-send 82020100으로 전송합니다.

uart:~$ mesh test net-send 82020100

Message는 현재 목적지와 network/application key index로 전송됩니다. 기본 목적지는 local unicast address라 자신에게만 보내므로 전체 node에 보내려면 mesh target dst 0xffff로 바꿉니다.

uart:~$ mesh target dst 0xffff

Raw packet 전송은 송신 model을 구현하지 않고도 개발 중 message handler를 시험하는 좋은 방법입니다. 기본 shell에는 foundation model만 있으므로 수신도 시험하려면 subsys/bluetooth/mesh/shell.c의 composition data에 유효한 opcode handler list를 가진 model을 추가하고 handler callback에서 수신 message를 출력해야 합니다.

Parameter 형식

명령 인자는 다음 형식으로 해석됩니다. UUID와 key처럼 길이가 정해진 hexstring에 더 짧은 값을 주면 array의 상위 N byte부터 채우고 나머지는 0으로 padding합니다.

형식설명예
Integer별도 표시가 없을 때의 기본 형식이며 decimal 또는 hexadecimal을 허용합니다.1234, 0xabcd01234
HexstringUUID, key, payload 같은 raw byte array는 prefix와 구분자 없는 연속 hexadecimal string으로 씁니다.deadbeef01234
Boolean문서에는 <Val(off, on)>으로 표시합니다.on, off, enabled, disabled, 1, 0

명령 표기

필수 인자는 <NetKeyIdx>처럼 angle bracket, 선택 인자는 [DstAddr]처럼 square bracket으로 표시합니다.

일반 구성

Mesh shell 자체를 초기화하거나 local node를 초기 상태로 되돌립니다.

mesh init

Mesh shell을 초기화합니다. 다른 모든 Mesh 명령보다 먼저 실행해야 합니다.

mesh reset-local

Local Mesh node를 최초의 unprovisioned 상태로 되돌리고, 존재하면 Configuration Database(CDB)도 비웁니다.

Target

Shell 명령이 사용할 목적지 주소, network index와 application index를 조회하거나 지정합니다. Provisioning과 Configuration Client 등 여러 명령이 이 값을 공유합니다.

mesh target dst [DstAddr]

Shell이 Mesh packet을 보낼 목적지 주소를 조회하거나 설정합니다. Shell 밖의 module에는 영향을 주지 않습니다.

DstAddr
주어지면 새 16-bit Mesh 목적지 주소를 설정하고, 생략하면 현재 주소를 출력합니다.

mesh target net [NetKeyIdx]

Shell 송신 packet을 암호화할 network key index를 조회하거나 설정합니다. Key는 provisioning 또는 Configuration Client를 통해 device에 이미 추가되어 있어야 합니다.

NetKeyIdx
주어지면 새 network index를 설정하고, 생략하면 현재 값을 출력합니다.

mesh target app [AppKeyIdx]

Shell 송신 packet을 암호화할 application key index를 조회하거나 설정합니다. Key가 device에 추가되어 있고 현재 network index에 bind되어 있어야 합니다.

AppKeyIdx
주어지면 새 application index를 설정하고, 생략하면 현재 값을 출력합니다.

Low Power Node

LPN radio 동작과 Friend polling을 제어합니다.

mesh lpn set <Val(off, on)>

Low Power 동작을 켜거나 끕니다. 켜면 radio를 끄고 Friend node polling을 시작합니다.

Val
Low Power 동작 활성 여부입니다.

mesh lpn poll

대기 중인 message를 받도록 Friend node를 poll합니다. LPN이 활성화된 경우에만 사용할 수 있습니다.

시험

Raw message, IV Update와 Replay Protection List를 시험합니다.

mesh test net-send <HexString>

현재 목적지 주소와 network/application index로 raw Mesh message를 보냅니다. Opcode는 직접 encoding해야 합니다.

HexString
보낼 message의 raw hexadecimal 표현입니다.

mesh test iv-update

IV Update를 강제로 시작합니다.

mesh test iv-update-test <Val(off, on)>

IV Update test mode를 설정합니다. Test mode에서는 IV Update 시간 요구사항을 우회합니다.

Val
IV Update test mode를 켜거나 끕니다.

mesh test rpl-clear

Replay Protection List를 비워 node가 지금까지 받은 모든 message를 잊게 합니다.

Health Server 시험

Linux Foundation Company ID에 대한 test fault를 관리합니다.

mesh test health-srv add-fault <FaultID>

새 Health Server fault를 등록합니다.

FaultID
0x0001부터 0xFFFF까지의 fault ID입니다.

mesh test health-srv del-fault [FaultID]

등록한 Health Server fault를 제거합니다.

FaultID
주어지면 해당 fault만 삭제하고, 생략하면 등록된 fault를 모두 지웁니다.

Provisioning

Unprovisioned beacon, local/remote provisioning과 OOB authentication을 제어합니다.

CONFIG_BT_MESH_PROVISIONEE와 CONFIG_BT_MESH_PB_GATT 또는 CONFIG_BT_MESH_PB_ADV를 켜야 해당 bearer의 beacon을 광고할 수 있습니다. 다른 device를 advertising으로 provision하려면 CONFIG_BT_MESH_PROVISIONER와 CONFIG_BT_MESH_PB_ADV, GATT로 provision하려면 CONFIG_BT_MESH_PROVISIONER와 CONFIG_BT_MESH_PB_GATT_CLIENT가 필요합니다.

mesh prov pb-gatt <Val(off, on)>

Connectable unprovisioned beacon 광고를 시작하거나 중지합니다. 근처 GATT Provisioner가 node를 발견해 GATT bearer로 provision할 수 있습니다.

Val
GATT provisioning 활성 여부입니다.

mesh prov pb-adv <Val(off, on)>

Unprovisioned beacon 광고를 시작하거나 중지합니다. 근처 advertising 기반 Provisioner가 node를 발견해 advertising bearer로 provision할 수 있습니다.

Val
Advertising provisioning 활성 여부입니다.

mesh prov remote-adv <UUID(1-16 hex)> <NetKeyIdx> <Addr> <AttDur(s)>

주어진 UUID의 unprovisioned beacon을 scan하고, 찾은 device를 지정한 unicast address와 network key로 Mesh에 편입합니다.

UUID
Unprovisioned device UUID입니다. 16 byte보다 짧으면 상위 N byte를 채우고 나머지는 0으로 padding합니다.
NetKeyIdx
Device에 전달할 network key index입니다.
Addr
할당할 첫 unicast address입니다. Element 수만큼 연속 주소가 모두 비어 있어야 합니다.
AttDur
지원할 경우 device가 자신을 식별할 attention duration(초)입니다.

mesh prov remote-gatt <UUID(1-16 hex)> <NetKeyIdx> <Addr> <AttDur(s)>

주어진 UUID의 PB-GATT connectable advertising을 scan하고, 찾은 device를 지정한 주소와 network key로 Mesh에 편입합니다.

UUID
Unprovisioned device UUID이며 짧은 값은 상위 byte부터 채우고 0으로 padding합니다.
NetKeyIdx
Device에 전달할 network key index입니다.
Addr
할당할 첫 unicast address입니다. 모든 element 주소가 비어 있어야 합니다.
AttDur
지원할 경우 device identification duration(초)입니다.

mesh prov uuid [UUID(1-16 hex)]

Unprovisioned beacon에 쓰는 Mesh node UUID를 조회하거나 설정합니다.

UUID
CONFIG_BT_MESH_SHELL_PROV_CTX_INSTANCE가 필요합니다. 주어지면 새 128-bit UUID를 설정하고, 생략하면 현재 값을 출력합니다.

mesh prov input-num <Number>

Provisioning 중 shell이 요구할 때 상대가 표시한 값과 같은 numeric OOB authentication value를 입력합니다.

Number
Decimal authentication number입니다.

mesh prov input-str <String>

Provisioning 중 shell이 요구할 때 상대가 표시한 값과 같은 alphanumeric OOB authentication value를 입력합니다.

String
따옴표 없는 alphanumeric authentication string입니다.

mesh prov static-oob [Val(1-32 hex)]

Provisioning 시작 전에 static OOB authentication value를 설정하거나 지웁니다. 양쪽 participant 값이 같아야 하며 shell provisioning context option이 필요합니다.

Val
주어지면 새 hexadecimal OOB 값을 설정하고, 생략하면 지웁니다. 짧은 값은 상위 byte부터 채우고 0으로 padding합니다.

mesh prov local <NetKeyIdx> <Addr> [IVI]

Mesh node 자신을 provision합니다. CDB를 사용하면 network key가 먼저 생성되어 있어야 하며, 아니면 기본 key를 사용합니다.

NetKeyIdx
Provisioning할 network key index입니다.
Addr
Device에 할당할 첫 unicast address입니다.
IVI
현재 network IV index이며 생략하면 0입니다.

mesh prov beacon-listen <Val(off, on)>

수신한 unprovisioned beacon 출력을 켜거나 끕니다. Provisioner가 근처 device를 발견하는 데 사용합니다.

Val
Beacon 출력 활성 여부입니다.

mesh prov remote-pub-key <PubKey>

Device public key를 제공합니다.

PubKey
Big-endian Device public key입니다.

mesh prov auth-method input <Action> <Size>

Provisioner가 unprovisioned device에 지정한 Input OOB authentication action을 사용하라고 지시합니다.

Action
0: 없음, 1: push, 2: twist, 4: number 입력, 8: string 입력.
Size
Authentication 크기입니다.

mesh prov auth-method output <Action> <Size>

Provisioner가 unprovisioned device에 지정한 Output OOB authentication action을 사용하라고 지시합니다.

Action
0: 없음, 1: blink, 2: vibrate, 4: number 표시, 8: string 표시.
Size
Authentication 크기입니다.

mesh prov auth-method static <Val(1-16 hex)>

Static OOB authentication을 선택하고 provisioning에 사용할 static value를 제공합니다.

Val
Static OOB 값입니다. 32 byte보다 짧으면 상위 N byte부터 채우고 나머지는 0으로 padding합니다.

mesh prov auth-method none

새 device를 provision할 때 authentication을 사용하지 않습니다. 기본 동작입니다.

Proxy

Proxy Server는 CONFIG_BT_MESH_GATT_PROXY, Proxy Client는 CONFIG_BT_MESH_PROXY_CLIENT로 켭니다.

mesh proxy identity-enable

Proxy Node Identity beacon을 60초 동안 켜서 Proxy device가 이 node에 명시적으로 연결할 수 있게 한 뒤 일반 Proxy beacon으로 돌아갑니다.

mesh proxy connect <NetKeyIdx>

근처 Proxy Server에 자동 연결합니다.

NetKeyIdx
연결할 network key index입니다.

mesh proxy disconnect <NetKeyIdx>

기존 Proxy 연결을 끊습니다.

NetKeyIdx
연결 해제할 network key index입니다.

mesh proxy solicit <NetKeyIdx>

Subnet에 Proxy Solicitation을 시작합니다. CONFIG_BT_MESH_PROXY_SOLICITATION 지원이 필요합니다.

NetKeyIdx
Solicitation PDU를 보낼 network key index입니다.

Models: Configuration Client

Configuration Server 상태를 읽고 수정하는 foundation model 명령입니다.

CONFIG_BT_MESH_CFG_CLI로 활성화하는 선택 기능이며 mesh models cfg 아래에 구현됩니다. Application composition에 Configuration Client model이 있으면 어느 instance에서나 동작하며, 자신과 다른 Mesh node를 구성할 수 있습니다.

mesh target dst와 mesh target net의 공통 값을 사용합니다. Shell provisioning context가 초기화되어 있으면 local provisioning 뒤에는 자신을, 다른 node를 provision한 뒤에는 새 node를 자동 target으로 삼습니다. Destination에 bind된 Device Key로 항상 전송하므로 자신과 자신이 provision한 node만 구성할 수 있습니다.

  • mesh init으로 client node 초기화
  • mesh cdb create로 CDB 생성
  • mesh prov local로 local device provisioning
  • mesh models cfg get-comp로 local composition 확인 후 구성
  • mesh prov beacon-listen, mesh prov remote-adv, mesh prov remote-gatt로 다른 device provisioning
  • mesh cdb show로 새 node와 주소 확인
  • Target composition을 읽고 원하는 Configuration Client 명령 적용

mesh models cfg target get

Configuration Client model이 현재 대상으로 삼는 Configuration Server를 출력합니다.

mesh models cfg help

Configuration Client shell module 정보를 출력합니다.

mesh models cfg reset

Target device를 reset합니다.

mesh models cfg timeout [Timeout(s)]

Message 전송 중 사용할 Config Client timeout을 조회하거나 설정합니다.

Timeout
주어지면 초 단위 timeout을 설정하고, 생략하면 현재 값을 출력합니다.

mesh models cfg get-comp [Page]

Composition Data page 전체를 읽어 출력합니다. Target에 요청 page가 없으면 그보다 앞선 마지막 page가 반환됩니다.

Page
요청할 Composition Data page이며 생략하면 0입니다.

mesh models cfg beacon [Val(off, on)]

Network beacon 송신 상태를 조회하거나 설정합니다.

Val
주어지면 beacon 송신을 켜거나 끄고, 생략하면 현재 상태를 출력합니다.

mesh models cfg ttl [TTL]

기본 TTL을 조회하거나 설정합니다.

TTL
0x00 또는 0x02~0x7f가 유효합니다. 생략하면 현재 값을 출력합니다.

mesh models cfg friend [Val(off, on)]

Friend feature를 조회하거나 설정합니다.

Val
주어지면 기능을 켜거나 끕니다. 조회 결과는 0x00: 지원하지만 꺼짐, 0x01: 켜짐, 0x02: 미지원입니다.

mesh models cfg gatt-proxy [Val(off, on)]

GATT Proxy feature를 조회하거나 설정합니다.

Val
주어지면 기능을 켜거나 끕니다. 조회 결과는 0x00: 지원하지만 꺼짐, 0x01: 켜짐, 0x02: 미지원입니다.

mesh models cfg relay [<Val(off, on)> [<Count> [Int(ms)]]]

Relay feature와 retransmission parameter를 조회하거나 설정합니다.

Val
생략하면 상태를 출력합니다. 0x00: 지원하지만 꺼짐, 0x01: 켜짐, 0x02: 미지원.
Count
on일 때 0~7의 retransmit count이며 생략하면 2입니다.
Int
on일 때 10~320 ms의 retransmit interval이며 생략하면 20 ms입니다.

mesh models cfg node-id <NetKeyIdx> [Identity]

Subnet의 현재 Node Identity 상태를 조회하거나 설정합니다.

NetKeyIdx
대상 network key index입니다.
Identity
주어지면 새 Node Identity 상태를 설정합니다.

mesh models cfg polltimeout-get <LPNAddr>

Friend node 안에서 해당 LPN의 PollTimeout timer 현재 값을 읽습니다.

LPNAddr
Low Power Node 주소입니다.

mesh models cfg net-transmit-param [<Count> <Int(ms)>]

Network transmit parameter를 조회하거나 설정합니다.

Count
각 message에 추가할 network transmit 수이며 유효 범위는 0~7입니다.
Int
Network retransmit interval이며 유효 범위는 10~320 ms입니다.

mesh models cfg netkey add <NetKeyIdx> [Key(1-16 hex)]

Target node에 network key를 추가하고 CDB가 활성화되어 있으면 CDB에도 넣습니다.

NetKeyIdx
추가할 network key index입니다.
Key
선택 128-bit hexadecimal key입니다. CDB에 아직 없는 key에만 지정할 수 있고, 생략하면 기본 key를 사용합니다.

mesh models cfg netkey upd <NetKeyIdx> [Key(1-16 hex)]

Target node의 network key를 갱신합니다.

NetKeyIdx
갱신할 network key index입니다.
Key
새 128-bit hexadecimal key이며 생략하면 기본 key를 사용합니다.

mesh models cfg netkey get

알려진 network key index 목록을 읽습니다.

mesh models cfg netkey del <NetKeyIdx>

Target node에서 network key를 삭제합니다.

NetKeyIdx
삭제할 network key index입니다.

mesh models cfg appkey add <NetKeyIdx> <AppKeyIdx> [Key(1-16 hex)]

Target node에 application key를 추가하고 CDB가 활성화되어 있으면 CDB에도 넣습니다.

NetKeyIdx
Application key가 bind될 network key index입니다.
AppKeyIdx
추가할 application key index입니다.
Key
선택 128-bit hexadecimal key이며 CDB에 아직 없는 key에만 지정할 수 있습니다. 생략하면 기본 key를 사용합니다.

mesh models cfg appkey upd <NetKeyIdx> <AppKeyIdx> [Key(1-16 hex)]

Target node의 application key를 갱신합니다.

NetKeyIdx
Application key가 bind된 network key index입니다.
AppKeyIdx
갱신할 application key index입니다.
Key
새 128-bit hexadecimal key이며 생략하면 기본 key를 사용합니다.

mesh models cfg appkey get <NetKeyIdx>

해당 network key에 bind된 application key index 목록을 읽습니다.

NetKeyIdx
목록을 조회할 network key index입니다.

mesh models cfg appkey del <NetKeyIdx> <AppKeyIdx>

Target node에서 application key를 삭제합니다.

NetKeyIdx
Application key가 bind된 network key index입니다.
AppKeyIdx
삭제할 application key index입니다.

mesh models cfg model app-bind <Addr> <AppKeyIdx> <MID> [CID]

Application key를 model에 bind합니다. Model은 bind된 application key로 보낸 message만 암호화·복호화할 수 있습니다.

Addr
Model이 있는 element 주소입니다.
AppKeyIdx
Bind할 application key입니다.
MID
대상 model ID입니다.
CID
주어지면 Company ID이며, 생략하면 Bluetooth SIG model입니다.

mesh models cfg model app-unbind <Addr> <AppKeyIdx> <MID> [CID]

Application key와 model의 binding을 해제합니다.

Addr
Model element 주소입니다.
AppKeyIdx
Unbind할 application key입니다.
MID
대상 model ID입니다.
CID
선택 Company ID이며 생략하면 SIG model입니다.

mesh models cfg model app-get <ElemAddr> <MID> [CID]

Model에 bind된 application key 목록을 읽습니다.

ElemAddr
Model element 주소입니다.
MID
대상 model ID입니다.
CID
선택 Company ID이며 생략하면 SIG model입니다.

mesh models cfg model pub <Addr> <MID> [CID] [<PubAddr> <AppKeyIdx> <Cred(off, on)> <TTL> <PerRes> <PerSteps> <Count> <Int(ms)>]

Model publication parameter를 조회하거나 설정합니다. Publication parameter를 모두 주면 새 값으로 설정하고 모두 생략하면 현재 값을 출력합니다.

Addr
Model element 주소입니다.
MID
대상 model ID입니다.
CID
선택 Company ID입니다.
PubAddr
Publication 목적지 주소입니다.
AppKeyIdx
Publication에 사용할 application key index입니다.
Cred
LPN일 때 Friendship credential을 사용할지 지정합니다.
TTL
0x00~0x07f publication TTL입니다.
PerRes
0x00: 100 ms, 0x01: 1 s, 0x02: 10 s, 0x03: 10 min의 period step resolution입니다.
PerSteps
Publication period step 수이며 0이면 periodic publication을 끕니다.
Count
Message당 retransmission 수 0~7입니다.
Int
Retransmission 간격(ms)이며 50의 배수여야 합니다.

mesh models cfg model pub-va <Addr> <UUID(1-16 hex)> <AppKeyIdx> <Cred(off, on)> <TTL> <PerRes> <PerSteps> <Count> <Int(ms)> <MID> [CID]

Virtual address를 사용하는 model publication parameter를 설정합니다.

Addr
Model element 주소입니다.
UUID
Publication 목적지 virtual address의 128-bit Label UUID입니다.
AppKeyIdx
Publication application key index입니다.
Cred
LPN Friendship credential 사용 여부입니다.
TTL
Publication TTL입니다.
PerRes
0x00: 100 ms, 0x01: 1 s, 0x02: 10 s, 0x03: 10 min입니다.
PerSteps
Period step 수이며 0이면 periodic publication을 끕니다.
Count
Message당 retransmission 수 0~7입니다.
Int
50의 배수인 retransmission interval(ms)입니다.
MID
대상 model ID입니다.
CID
선택 Company ID입니다.

mesh models cfg model sub-add <ElemAddr> <SubAddr> <MID> [CID]

Model을 group address에 subscribe합니다. Model은 unicast 주소와 subscribe한 group/virtual 주소 message를 수신할 수 있습니다.

ElemAddr
Model element 주소입니다.
SubAddr
0xc000~0xFEFF의 16-bit group address입니다.
MID
대상 model ID입니다.
CID
선택 Company ID입니다.

mesh models cfg model sub-del <ElemAddr> <SubAddr> <MID> [CID]

Model의 group address subscription을 제거합니다.

ElemAddr
Model element 주소입니다.
SubAddr
제거할 16-bit group address입니다.
MID
대상 model ID입니다.
CID
선택 Company ID입니다.

mesh models cfg model sub-add-va <ElemAddr> <LabelUUID(1-16 hex)> <MID> [CID]

Model을 virtual address에 subscribe합니다.

ElemAddr
Model element 주소입니다.
LabelUUID
Subscribe할 virtual address의 128-bit Label UUID입니다.
MID
대상 model ID입니다.
CID
선택 Company ID입니다.

mesh models cfg model sub-del-va <ElemAddr> <LabelUUID(1-16 hex)> <MID> [CID]

Model의 virtual address subscription을 제거합니다.

ElemAddr
Model element 주소입니다.
LabelUUID
제거할 virtual address의 128-bit Label UUID입니다.
MID
대상 model ID입니다.
CID
선택 Company ID입니다.

mesh models cfg model sub-ow <ElemAddr> <SubAddr> <MID> [CID]

기존 model subscription을 모두 지우고 group address 하나로 덮어씁니다.

ElemAddr
Model element 주소입니다.
SubAddr
새 16-bit group address입니다.
MID
대상 model ID입니다.
CID
선택 Company ID입니다.

mesh models cfg model sub-ow-va <ElemAddr> <LabelUUID(1-16 hex)> <MID> [CID]

기존 model subscription을 모두 지우고 virtual address 하나로 덮어씁니다.

ElemAddr
Model element 주소입니다.
LabelUUID
새 virtual address의 128-bit Label UUID입니다.
MID
대상 model ID입니다.
CID
선택 Company ID입니다.

mesh models cfg model sub-del-all <ElemAddr> <MID> [CID]

Model의 모든 group/virtual address subscription을 제거합니다.

ElemAddr
Model element 주소입니다.
MID
대상 model ID입니다.
CID
선택 Company ID입니다.

mesh models cfg model sub-get <ElemAddr> <MID> [CID]

Model이 subscribe한 주소 목록을 읽습니다.

ElemAddr
Model element 주소입니다.
MID
대상 model ID입니다.
CID
선택 Company ID입니다.

mesh models cfg krp <NetKeyIdx> [Phase]

Subnet의 Key Refresh phase를 조회하거나 설정합니다.

NetKeyIdx
대상 network key입니다.
Phase
0x00: 정상/비활성, 0x01: 1단계, 0x02: 2단계입니다.

mesh models cfg hb-sub [<Src> <Dst> <Per>]

Heartbeat subscription parameter를 설정하거나 인자 없이 현재 값을 출력합니다.

Src
Heartbeat를 받을 unicast source address입니다.
Dst
Heartbeat를 받을 destination address입니다.
Per
0: 비활성, 1~17: 2^(Per-1)초 동안 subscribe합니다.

mesh models cfg hb-pub [<Dst> <Count> <Per> <TTL> <Features> <NetKeyIdx>]

Heartbeat publication parameter를 설정하거나 인자 없이 현재 값을 출력합니다.

Dst
Heartbeat publication 목적지입니다.
Count
0: periodic 송신 없음, 1~17: 2^(Count-1)개 송신, 255: 무기한 송신입니다.
Per
0: periodic 송신 없음, 1~17: 2^(Per-1)초마다 송신합니다.
TTL
Heartbeat TTL 0x00~0x7f입니다.
Features
변경 시 Heartbeat를 유발할 bitfield입니다. bit 0 Relay, bit 1 Proxy, bit 2 Friend, bit 3 Low Power입니다.
NetKeyIdx
Heartbeat에 사용할 network key index입니다.

Models: Health Client

CONFIG_BT_MESH_HEALTH_CLI로 활성화하며 mesh models health 아래에서 Health Client/Server 상호 작용을 시험합니다. 기본적으로 composition의 첫 instance를 사용하고 instance 명령으로 바꿀 수 있습니다. Destination이 0이면 선택한 Client가 자신의 publication parameter로 송신합니다.

mesh models health instance set <ElemIdx>

사용할 Health Client model instance를 선택합니다.

ElemIdx
Health Client model의 element index입니다.

mesh models health instance get-all

Device의 모든 Health Client model instance를 출력합니다.

mesh models health fault-get <CID>

Company ID에 등록된 fault 목록을 읽습니다.

CID
조회할 Company ID입니다.

mesh models health fault-clear <CID>

Company ID의 fault 목록을 지웁니다.

CID
대상 Company ID입니다.

mesh models health fault-clear-unack <CID>

응답을 요청하지 않고 Company ID의 fault 목록을 지웁니다.

CID
대상 Company ID입니다.

mesh models health fault-test <CID> <TestID>

Self-test를 실행하고 발생한 fault 목록을 표시합니다.

CID
Self-test를 수행할 Company ID입니다.
TestID
실행할 test입니다.

mesh models health fault-test-unack <CID> <TestID>

응답을 요청하지 않고 self-test를 실행합니다.

CID
Self-test Company ID입니다.
TestID
실행할 test입니다.

mesh models health period-get

현재 Health Server publication period divisor를 읽습니다.

mesh models health period-set <Divisor>

Fault가 감지됐을 때 Health Server가 더 짧은 간격으로 fault status를 publish하도록 divisor를 설정합니다. Fault period = normal publication period / 2^divisor입니다.

Divisor
새 Health Server publication period divisor입니다.

mesh models health period-set-unack <Divisor>

응답을 요청하지 않고 Health Server publication period divisor를 설정합니다.

Divisor
새 divisor이며 fault period는 publication period / 2^divisor입니다.

mesh models health attention-get

현재 Health Server attention state를 읽습니다.

mesh models health attention-set <Time(s)>

지정한 시간 동안 Health Server attention state를 활성화합니다.

Time
0~255초의 attention duration입니다.

mesh models health attention-set-unack <Time(s)>

응답을 요청하지 않고 지정한 시간 동안 attention state를 활성화합니다.

Time
0~255초의 attention duration입니다.

Models: BLOB Transfer Client

CONFIG_BT_MESH_BLOB_CLI를 켜고 CONFIG_BT_MESH_DFU_CLI를 끄면 shell에 추가됩니다.

mesh models blob cli target <Addr>

다음 BLOB transfer에 사용할 Target node를 추가합니다.

Addr
Target node BLOB Transfer Server model의 unicast address입니다.

mesh models blob cli bounds [<Group>]

모든 Target node의 종합 boundary parameter를 읽습니다.

Group
Target 통신에 쓸 선택 group address입니다. 생략하면 각 Target을 개별 주소로 호출합니다.

mesh models blob cli tx <Id> <Size> <BlockSizeLog> <ChunkSize> [<Group> [<Mode(push, pull)>]]

모든 Target node에 dummy BLOB을 전송하고 완료되면 알립니다. 먼저 각 Target에서 mesh models blob srv rx를 실행해 수신 준비를 해야 합니다.

Id
64-bit BLOB transfer ID입니다.
Size
BLOB byte 크기입니다.
BlockSizeLog
Block size의 log 값이며 실제 block은 1 << BlockSizeLog byte입니다.
ChunkSize
Chunk byte 크기입니다.
Group
선택 group address입니다. 생략하거나 0이면 각 Target을 개별 주소로 호출합니다.
Mode
push 또는 pull이며 생략하면 push입니다.

mesh models blob cli tx-cancel

진행 중인 BLOB transfer를 취소합니다.

mesh models blob cli tx-get [Group]

이전에 실행한 BLOB transfer 진행 상태를 확인합니다. Transfer를 수행 중이지 않을 때 사용할 수 있습니다.

Group
선택 group address이며 생략하거나 0이면 Target을 개별 조회합니다.

mesh models blob cli tx-suspend

진행 중인 BLOB transfer를 일시 중지합니다.

mesh models blob cli tx-resume

일시 중지한 BLOB transfer를 재개합니다.

mesh models blob cli instance-set <ElemIdx>

다른 BLOB Client 명령에서 사용할 model instance를 해당 element에서 선택합니다.

ElemIdx
BLOB Transfer Client instance를 찾을 element입니다.

mesh models blob cli instance-get-all

Node의 모든 BLOB Transfer Client model instance를 나열합니다.

Models: BLOB Transfer Server

CONFIG_BT_MESH_BLOB_SRV로 추가합니다. 임의 BLOB을 받을 수 있지만 shell 구현은 수신 data를 폐기합니다.

mesh models blob srv rx <ID> [<TimeoutBase(10s steps)>]

BLOB transfer 수신을 준비합니다.

ID
수신할 64-bit BLOB transfer ID입니다.
TimeoutBase
Client message를 더 기다릴 선택 시간으로 10초 단위입니다.

mesh models blob srv rx-cancel

진행 중인 BLOB transfer를 취소합니다.

mesh models blob srv instance-set <ElemIdx>

다른 BLOB Server 명령에서 사용할 model instance를 해당 element에서 선택합니다.

ElemIdx
BLOB Transfer Server instance를 찾을 element입니다.

mesh models blob srv instance-get-all

Node의 모든 BLOB Transfer Server model instance를 나열합니다.

Models: Firmware Update Client

CONFIG_BT_MESH_BLOB_CLI와 CONFIG_BT_MESH_DFU_CLI로 추가합니다. Dummy firmware update를 Target 집합에 보내 Distributor 역할을 시연합니다.

mesh models dfu slot add <Size> <FwID> [<Metadata>]

전송 가능한 virtual DFU image slot을 추가하고 다른 명령에서 사용할 slot index를 출력합니다. 갱신할 때는 mesh models dfu slot del로 지운 뒤 다시 추가합니다.

Size
DFU image slot byte 크기입니다.
FwID
Hexstring 형식 firmware ID입니다.
Metadata
선택 firmware metadata hexstring입니다.

mesh models dfu slot del <SlotIdx>

해당 index의 DFU image slot을 삭제합니다.

SlotIdx
삭제할 slot index입니다.

mesh models dfu slot get <SlotIdx>

DFU image slot의 모든 정보를 읽습니다.

SlotIdx
조회할 slot index입니다.

mesh models dfu cli target <Addr> <ImgIdx>

Target node를 추가합니다.

Addr
Target node unicast address입니다.
ImgIdx
Target node에서 갱신할 image index입니다.

mesh models dfu cli target-state

현재 destination address device의 DFU Target state를 확인합니다.

mesh models dfu cli target-imgs [<MaxCount>]

현재 destination address device의 DFU image 목록을 읽습니다.

MaxCount
반환할 선택 최대 image 수이며 생략하면 제한하지 않습니다.

mesh models dfu cli target-check <SlotIdx> <TargetImgIdx>

Target이 local slot의 DFU transfer를 지정 Target image index에 받아들일지, 받아들인다면 효과가 무엇인지 확인합니다.

SlotIdx
확인할 local DFU image slot index입니다.
TargetImgIdx
확인할 Target DFU image index입니다.

mesh models dfu cli send <SlotIdx> [<Group>]

추가된 모든 Target node에 DFU transfer를 시작합니다.

SlotIdx
보낼 local DFU image slot index입니다.
Group
Target 통신용 선택 group address이며 생략하면 각 Target을 개별 호출합니다.

mesh models dfu cli cancel [<Addr>]

어느 단계에서든 특정 Target 또는 모든 Target의 DFU 절차를 취소합니다.

Addr
선택 Target unicast address입니다. 생략하면 모든 Target의 진행 중 절차를 취소합니다.

mesh models dfu cli apply

가장 최근 DFU transfer를 모든 Target에 적용합니다. Transfer 완료 뒤에만 호출할 수 있습니다.

mesh models dfu cli confirm

가장 최근 DFU transfer가 모든 Target에 성공적으로 적용됐는지 확인합니다. 완료와 apply 뒤에만 호출할 수 있습니다.

mesh models dfu cli suspend

진행 중인 DFU transfer를 일시 중지합니다.

mesh models dfu cli resume

일시 중지한 DFU transfer를 재개합니다.

mesh models dfu cli progress

현재 transfer 진행률을 확인합니다.

mesh models dfu cli instance-set <ElemIdx>

다른 Firmware Update Client 명령에서 사용할 instance를 지정 element에서 선택합니다.

ElemIdx
Firmware Update Client instance를 찾을 element입니다.

mesh models dfu cli instance-get-all

Node의 모든 Firmware Update Client model instance를 나열합니다.

Models: Firmware Update Server

CONFIG_BT_MESH_BLOB_SRV와 CONFIG_BT_MESH_DFU_SRV로 추가합니다. 임의 update를 받아 Target 역할을 시연하며, 수신 firmware data는 폐기하지만 그 밖에는 정상 Target처럼 동작합니다.

mesh models dfu srv applied

최근 DFU transfer를 applied 상태로 표시합니다. Transfer가 완료되고 Distributor가 apply를 요청한 뒤에만 호출할 수 있습니다. 실제 image를 적용하지 않는 shell Server가 성공 상태를 모사하는 명령입니다.

mesh models dfu srv progress

현재 transfer 진행률을 확인합니다.

mesh models dfu srv rx-cancel

들어오는 DFU transfer를 취소합니다.

mesh models dfu srv instance-set <ElemIdx>

다른 Firmware Update Server 명령에서 사용할 instance를 지정 element에서 선택합니다.

ElemIdx
Firmware Update Server instance를 찾을 element입니다.

mesh models dfu srv instance-get-all

Node의 모든 Firmware Update Server model instance를 나열합니다.

Models: Firmware Distribution Server

CONFIG_BT_MESH_DFD_SRV로 명령을 추가합니다. Firmware Distribution Client가 Server에 보내는 message를 그대로 모사하며, application이 Server instance를 생성해야 합니다.

mesh models dfd receivers-add <Addr>,<FwIdx>[;<Addr>,<FwIdx>]...

Firmware receiver를 추가합니다. 0x0001,0;0x0002,0;0x0004,1처럼 comma로 address와 firmware index를 묶고 semicolon으로 pair를 구분하며 공백은 넣지 않습니다. receivers-delete-all 전까지 반복 호출로 목록을 누적합니다.

Addr
수신 node 주소입니다.
FwIdx
해당 주소로 보낼 firmware slot index입니다.

mesh models dfd receivers-delete-all

Server의 receiver를 모두 삭제합니다.

mesh models dfd receivers-get <First> <Count>

Firmware receiver 정보 목록을 읽습니다.

First
Receiver list에서 첫 index입니다.
Count
정보를 읽을 receiver 수입니다.

mesh models dfd capabilities-get

Server capability를 읽습니다.

mesh models dfd get

현재 distribution state, phase와 transfer parameter를 읽습니다.

mesh models dfd start <AppKeyIdx> <SlotIdx> [<Group> [<PolicyApply> [<TTL> [<TimeoutBase> [<XferMode>]]]]]

Firmware distribution을 시작합니다.

AppKeyIdx
송신에 사용할 application key index입니다. Distributor와 Target의 Firmware Update/BLOB model에 공통 key가 bind되어야 합니다.
SlotIdx
보낼 local image slot index입니다.
Group
Target 통신용 선택 group address입니다. 0이면 개별 addressing을 유지하면서 뒤 인자만 바꿀 수 있습니다.
PolicyApply
true면 transfer 완료 직후 Server가 image를 적용합니다.
TTL
선택 송신 TTL이며 생략하면 configured default TTL입니다.
TimeoutBase
Distribution timeout 계산에 더할 10초 단위 값이며 기본 0입니다.
XferMode
1: Push, 2: Pull이며 기본은 Push입니다.

mesh models dfd suspend

진행 중인 distribution을 일시 중지합니다.

mesh models dfd cancel

진행 중인 distribution을 취소합니다.

mesh models dfd apply

배포된 firmware를 적용합니다.

mesh models dfd fw-get <FwID>

Server에 upload된 firmware image 정보를 ID로 읽습니다.

FwID
조회할 firmware image ID입니다.

mesh models dfd fw-get-by-idx <Idx>

특정 slot에 upload된 firmware image 정보를 읽습니다.

Idx
Image가 있는 slot index입니다.

mesh models dfd fw-delete <FwID>

Server에서 firmware image를 삭제합니다.

FwID
삭제할 firmware image ID입니다.

mesh models dfd fw-delete-all

Server의 firmware image를 모두 삭제합니다.

mesh models dfd instance-set <ElemIdx>

다른 Firmware Distribution Server 명령에서 사용할 instance를 지정 element에서 선택합니다.

ElemIdx
Firmware Distribution Server instance를 찾을 element입니다.

mesh models dfd instance-get-all

Node의 모든 Firmware Distribution Server model instance를 나열합니다.

DFU metadata

CONFIG_BT_MESH_DFU_METADATA로 켭니다. Target이 firmware를 수락하기 전에 검사할 metadata를 생성합니다.

mesh models dfu metadata comp-clear

Target에 사용할 저장된 composition data를 지웁니다.

mesh models dfu metadata comp-add <CID> <ProductID> <VendorID> <Crpl> <Features>

Composition Data Page 0 header를 만듭니다.

CID
Bluetooth SIG가 할당한 Company identifier입니다.
ProductID
Vendor가 정한 product identifier입니다.
VendorID
Vendor가 정한 version identifier입니다.
Crpl
Replay Protection List 크기입니다.
Features
Node feature bitfield입니다. bit 0 Relay, bit 1 Proxy, bit 2 Friend, bit 3 Low Power입니다.

mesh models dfu metadata comp-elem-add <Loc> <NumS> <NumV> {<SigMID>|<VndCID> <VndMID>}...

Target node의 element 설명을 추가합니다.

Loc
Element location입니다.
NumS
Element에 생성된 SIG model 수입니다.
NumV
Element에 생성된 vendor model 수입니다.
SigMID
SIG Model ID입니다.
VndCID
Vendor model Company identifier입니다.
VndMID
Vendor model identifier입니다.

mesh models dfu metadata comp-hash-get [<Key(16 hex)>]

Metadata에 넣을 저장 Composition Data hash를 생성합니다.

Key
Hash 생성에 사용할 선택 128-bit key입니다. 짧은 hexstring은 상위 N byte부터 채우고 0으로 padding합니다.

mesh models dfu metadata encode <Major> <Minor> <Rev> <BuildNum> <Size> <CoreType> <Hash> <Elems> [<UserData>]

DFU metadata를 encoding합니다.

Major
Firmware major version입니다.
Minor
Firmware minor version입니다.
Rev
Firmware revision입니다.
BuildNum
Build number입니다.
Size
Signed bin file 크기입니다.
CoreType
1: application core, 2: network core, 4: application-specific BLOB입니다.
Hash
comp-hash-get으로 만든 composition data hash입니다.
Elems
새 firmware의 element 수입니다.
UserData
Metadata와 함께 제공할 user data입니다.

Models: SAR Configuration Client

CONFIG_BT_MESH_SAR_CFG_CLI로 켜며 SAR Configuration Server를 지원하는 node의 lower transport layer 동작을 구성합니다.

mesh models sar tx-get

SAR Configuration Transmitter Get message를 보냅니다.

mesh models sar tx-set <SegIntStep> <UniRetransCnt> <UniRetransWithoutProgCnt> <UniRetransIntStep> <UniRetransIntInc> <MultiRetransCnt> <MultiRetransInt>

SAR Configuration Transmitter Set message를 보냅니다.

SegIntStep
SAR Segment Interval Step state입니다.
UniRetransCnt
SAR Unicast Retransmissions Count state입니다.
UniRetransWithoutProgCnt
SAR Unicast Retransmissions Without Progress Count state입니다.
UniRetransIntStep
SAR Unicast Retransmissions Interval Step state입니다.
UniRetransIntInc
SAR Unicast Retransmissions Interval Increment state입니다.
MultiRetransCnt
SAR Multicast Retransmissions Count state입니다.
MultiRetransInt
SAR Multicast Retransmissions Interval state입니다.

mesh models sar rx-get

SAR Configuration Receiver Get message를 보냅니다.

mesh models sar rx-set <SegThresh> <AckDelayInc> <DiscardTimeout> <RxSegIntStep> <AckRetransCount>

SAR Configuration Receiver Set message를 보냅니다.

SegThresh
SAR Segments Threshold state입니다.
AckDelayInc
SAR Acknowledgment Delay Increment state입니다.
DiscardTimeout
SAR Discard Timeout state입니다.
RxSegIntStep
SAR Receiver Segment Interval Step state입니다.
AckRetransCount
SAR Acknowledgment Retransmissions Count state입니다.

Models: Private Beacon Client

CONFIG_BT_MESH_PRIV_BEACON_CLI로 활성화하는 선택 model입니다.

mesh models prb priv-beacon-get

Target의 Private Beacon state를 읽습니다.

  • 0x00: Private beacon을 broadcast하지 않습니다.
  • 0x01: Private beacon을 broadcast합니다.

mesh models prb priv-beacon-set <Val(off, on)> <RandInt(10s steps)>

Target의 Private Beacon state를 설정합니다.

Val
Private Beacon state를 제어합니다.
RandInt
10초 단위 random refresh interval이며 0이면 현재 값을 유지합니다.

mesh models prb priv-gatt-proxy-get

Target의 Private GATT Proxy state를 읽습니다.

  • 0x00: 지원하지만 꺼져 있습니다.
  • 0x01: 켜져 있습니다.
  • 0x02: 지원하지 않습니다.

mesh models prb priv-gatt-proxy-set <Val(off, on)>

Target의 Private GATT Proxy state를 설정합니다.

Val
0x00: 기능 끄기, 0x01: 기능 켜기.

mesh models prb priv-node-id-get <NetKeyIdx>

Target의 Private Node Identity state를 읽습니다.

NetKeyIdx
상태를 조회할 network index입니다.
  • 0x00: Private Node Identity로 광고하지 않습니다.
  • 0x01: Private Node Identity로 광고합니다.
  • 0x02: 해당 광고를 지원하지 않습니다.

mesh models prb priv-node-id-set <NetKeyIdx> <State>

Target의 Private Node Identity state를 설정합니다.

NetKeyIdx
상태를 설정할 network index입니다.
State
0x00: 광고 중지, 0x01: 광고 시작.

Models: Opcodes Aggregator Client

CONFIG_BT_MESH_OP_AGG_CLI로 켜며 access layer message sequence를 Opcodes Aggregator Server node로 묶어 보냅니다.

mesh models opagg seq-start <ElemAddr>

Message aggregation context를 시작하고 뒤따르는 shell 명령의 destination을 ElemAddr로 설정합니다.

ElemAddr
Aggregated opcode를 처리할 element address입니다.

mesh models opagg seq-send

Aggregation 절차를 끝내고 sequence message를 Target node에 보낸 뒤 context를 지웁니다.

mesh models opagg seq-abort

Opcodes Aggregator Sequence를 중단하고 Client context를 지웁니다.

Models: Remote Provisioning Client

CONFIG_BT_MESH_RPR_CLI로 켜며 Remote Provisioning Server를 통해 device를 Mesh network에 원격 provisioning합니다.

mesh models rpr scan <Timeout(s)> [<UUID(1-16 hex)>]

Unprovisioned device scan을 시작합니다.

Timeout
최소 1초인 scan timeout입니다.
UUID
선택 device UUID입니다. 생략하면 모든 device를 보고합니다.

mesh models rpr scan-ext <Timeout(s)> <UUID(1-16 hex)> [<ADType> ... ]

Unprovisioned device extended scan을 시작합니다.

Timeout
BT_MESH_RPR_EXT_SCAN_TIME_MIN~BT_MESH_RPR_EXT_SCAN_TIME_MAX 범위의 timeout입니다.
UUID
Extended scan 대상 device UUID입니다.
ADType
CONFIG_BT_MESH_RPR_AD_TYPES_MAX 이내에서 scan report에 넣을 AD type 1개 이상입니다.

mesh models rpr scan-srv [<ADType> ... ]

Remote Provisioning Server에서 extended scan을 시작합니다.

ADType
Scan report에 넣을 AD type 목록입니다.

mesh models rpr scan-caps

Remote Provisioning Server의 scan capability를 읽습니다.

mesh models rpr scan-get

Remote Provisioning Server의 현재 scan state를 읽습니다.

mesh models rpr scan-stop

Remote Provisioning Server에서 진행 중인 scan을 중지합니다.

mesh models rpr link-get

Remote Provisioning Server의 현재 link status를 읽습니다.

mesh models rpr link-close

Remote Provisioning Server의 열린 link를 닫습니다.

mesh models rpr provision-remote <UUID(1-16 hex)> <NetKeyIdx> <Addr>

PB-Remote provisioning bearer로 Mesh node를 provision합니다.

UUID
Unprovisioned node UUID입니다.
NetKeyIdx
Node에 줄 Network Key Index입니다.
Addr
Remote device에 할당할 주소이며 0이면 사용 가능한 가장 낮은 주소를 고릅니다.

mesh models rpr reprovision-remote <Addr> [<CompChanged(false, true)>]

PB-Remote bearer로 Mesh node를 reprovision합니다.

Addr
Remote device에 할당할 주소이며 0이면 사용 가능한 가장 낮은 주소를 고릅니다.
CompChanged
Target이 Composition Data 변경을 표시했는지 지정하며 기본값은 false입니다.

mesh models rpr instance-set <ElemIdx>

다른 Remote Provisioning Client 명령에서 사용할 instance를 지정 element에서 선택합니다.

ElemIdx
Client instance를 찾을 element입니다.

mesh models rpr instance-get-all

Node의 모든 Remote Provisioning Client model instance를 나열합니다.

Models: Large Composition Data Client

CONFIG_BT_MESH_LARGE_COMP_DATA_CLI로 켭니다. Config Composition Data Status 한 message에 들어가지 않는 Composition Data page와 model instance metadata를 나누어 읽습니다.

mesh models lcd large-comp-data-get <Page> <Offset>

Node의 Composition Data state 중 일부를 조회하는 Large Composition Data Get message를 보냅니다.

Page
Composition Data page number입니다.
Offset
Page 안의 offset입니다.

mesh models lcd models-metadata-get <Page> <Offset>

Models Metadata state page 일부를 조회하는 Models Metadata Get message를 보냅니다.

Page
Models Metadata page number입니다.
Offset
Page 안의 offset입니다.

Configuration Database

CONFIG_BT_MESH_CDB로 켜며 Provisioner에서만 사용할 수 있습니다. Network 전체 정보를 저장하므로 충돌을 피하려면 CDB를 켠 node는 network에 하나만 두어야 합니다. 이 Configurator가 새 node 추가와 구성을 담당합니다.

mesh cdb create [NetKey(1-16 hex)]

Configuration Database를 생성합니다.

NetKey
Primary network key(NetKeyIndex=0)의 선택 값입니다. 생략하면 기본 key를 사용합니다.

mesh cdb clear

Configuration Database의 모든 data를 지웁니다.

mesh cdb show

Configuration Database의 모든 data를 표시합니다.

mesh cdb node-add <UUID(1-16 hex)> <Addr> <ElemCnt> <NetKeyIdx> [DevKey(1-16 hex)]

Mesh node를 CDB에 수동 추가합니다. CDB가 생성되어 있으면 provisioning 명령으로 추가한 device는 자동 등록됩니다.

UUID
Node의 128-bit hexadecimal UUID입니다.
Addr
Node unicast address이며 0이면 사용 가능한 가장 낮은 주소를 고릅니다.
ElemCnt
Node element 수입니다.
NetKeyIdx
Node provisioning에 사용한 network key입니다.
DevKey
선택 128-bit Device Key이며 생략하면 random 값을 생성합니다.

mesh cdb node-del <Addr>

CDB에서 Mesh node를 삭제합니다. 예기치 않은 동작과 통제되지 않은 network 접근을 피하려면 가능할 때 mesh reset으로 먼저 node를 reset해야 합니다.

Addr
삭제할 node 주소입니다.

mesh cdb subnet-add <NetKeyIdx> [<NetKey(1-16 hex)>]

나중에 network node에 전달할 network key를 CDB에 추가합니다. CDB 추가만으로 local node의 known network key 목록에 자동 추가되지는 않습니다.

NetKeyIdx
추가할 network key index입니다.
NetKey
선택 128-bit key이며 생략하면 random 값을 생성합니다.

mesh cdb subnet-del <NetKeyIdx>

CDB에서 network key를 삭제합니다.

NetKeyIdx
삭제할 network key index입니다.

mesh cdb app-key-add <NetKeyIdx> <AppKeyIdx> [<AppKey(1-16 hex)>]

나중에 network node에 전달할 application key를 CDB에 추가합니다. Local node known key 목록에는 자동 추가되지 않습니다.

NetKeyIdx
Application key가 bind될 network key index입니다.
AppKeyIdx
추가할 application key index입니다.
AppKey
선택 128-bit application key이며 생략하면 random 값을 생성합니다.

mesh cdb app-key-del <AppKeyIdx>

CDB에서 application key를 삭제합니다.

AppKeyIdx
삭제할 application key index입니다.

On-Demand Private GATT Proxy Client

CONFIG_BT_MESH_OD_PRIV_PROXY_CLI로 켜는 선택 model입니다.

mesh models od_priv_proxy od-priv-gatt-proxy [Dur(s)]

활성 Target의 On-Demand Private GATT Proxy state를 설정하거나 읽습니다.

Dur
주어지면 초 단위 state 값을 설정하고, 생략하면 현재 값을 읽습니다.

Solicitation PDU RPL Client

CONFIG_BT_MESH_SOL_PDU_RPL_CLI로 켜는 선택 model입니다.

mesh models sol_pdu_rpl sol-pdu-rpl-clear <RngStart> <Ackd> [RngLen]

활성 Target의 Solicitation Replay Protection List(SRPL)에서 지정 SSRC 주소 범위를 지웁니다.

RngStart
SSRC 범위 시작 주소입니다.
Ackd
Acknowledged 또는 unacknowledged message 송신 여부를 결정합니다.
RngLen
지울 SSRC 범위 길이이며 생략하면 주소 하나만 지웁니다.

Frame statistic

수신·송신·relay frame counter를 조회하고 초기화합니다.

mesh stat get

수신 frame 수와 계획된/성공한 transmission attempt 수를 출력합니다.

mesh stat clear

지금까지 수집한 statistic을 모두 지웁니다.

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.