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