Skip to content

Commit bea54c5

Browse files
Andrewpinicarlescufi
authored andcommitted
Bluetooth: Mesh: Shell: Make prov features dynamic
Alters several provisioning related features to allow commands to be functional with application defined Provisioning properties & capabilities. Signed-off-by: Anders Storrø <[email protected]>
1 parent 15ed856 commit bea54c5

File tree

5 files changed

+259
-95
lines changed

5 files changed

+259
-95
lines changed

doc/connectivity/bluetooth/api/mesh/shell.rst

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,12 @@ To allow a device to provision devices over GATT, the :kconfig:option:`CONFIG_BT
273273
* ``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.
274274
* ``AttentionDuration``: The duration in seconds the unprovisioned device will identify itself for, if supported. See :ref:`bluetooth_mesh_models_health_srv_attention` for details.
275275

276-
``mesh prov uuid <UUID: 1-16 hex values>``
276+
``mesh prov uuid [UUID: 1-16 hex values]``
277277
------------------------------------------
278278

279-
Set the mesh node's UUID, used in the unprovisioned beacons.
279+
Get or set the mesh node's UUID, used in the unprovisioned beacons.
280280

281-
* ``UUID``: New 128-bit UUID value. Any missing bytes will be zero.
281+
* ``UUID``: If present, new 128-bit UUID value. Any missing bytes will be zero. If omitted, the current UUID will be printed. To enable this command, the :kconfig:option:`BT_MESH_SHELL_PROV_CTX_INSTANCE` option must be enabled.
282282

283283

284284
``mesh prov input-num <number>``
@@ -300,7 +300,7 @@ To allow a device to provision devices over GATT, the :kconfig:option:`CONFIG_BT
300300
``mesh prov static-oob [val: 1-16 hex values]``
301301
-----------------------------------------------
302302

303-
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.
303+
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:`BT_MESH_SHELL_PROV_CTX_INSTANCE` option must be enabled.
304304

305305
* ``val``: If present, indicates the new hexadecimal value of the static OOB. If omitted, the static OOB value is cleared.
306306

@@ -318,10 +318,50 @@ To allow a device to provision devices over GATT, the :kconfig:option:`CONFIG_BT
318318
``mesh prov beacon-listen <val: off, on>``
319319
------------------------------------------
320320

321-
Enable or disable printing of incoming unprovisioned beacons. Allows a provisioner device to detect nearby unprovisioned devices and provision them.
321+
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:`BT_MESH_SHELL_PROV_CTX_INSTANCE` option must be enabled.
322322

323323
* ``val``: Whether to enable the unprovisioned beacon printing.
324324

325+
``mesh prov remote-pub-key <PubKey>``
326+
--------------------------------------
327+
Provide Device public key.
328+
329+
* ``PubKey`` - Device public key in big-endian.
330+
331+
``mesh prov auth-method input <Action> <Size>``
332+
-----------------------------------------------
333+
From the provisioner device, instruct the unprovisioned device to use the specified Input OOB authentication action.
334+
335+
* ``Action`` - Input action. Allowed values:
336+
* ``0`` - No input action.
337+
* ``1`` - Push action set.
338+
* ``2`` - Twist action set.
339+
* ``4`` - Enter number action set.
340+
* ``8`` - Enter String action set.
341+
* ``Size`` - Authentication size.
342+
343+
``mesh prov auth-method output <Action> <Size>``
344+
------------------------------------------------
345+
From the provisioner device, instruct the unprovisioned device to use the specified Output OOB authentication action.
346+
347+
* ``Action`` - Output action. Allowed values:
348+
* ``0`` - No output action.
349+
* ``1`` - Blink action set.
350+
* ``2`` - Vibrate action set.
351+
* ``4`` - Display number action set.
352+
* ``8`` - Display String action set.
353+
* ``Size`` - Authentication size.
354+
355+
``mesh prov auth-method static <Value>``
356+
----------------------------------------
357+
From the provisioner device, instruct the unprovisioned device to use static OOB authentication, and use the given static authentication value when provisioning.
358+
359+
* ``Value`` - Static OOB value.
360+
361+
``mesh prov auth-method none <Value>``
362+
--------------------------------------
363+
From the provisioner device, don't use any authentication when provisioning new devices. This is the default behavior.
364+
325365
Proxy
326366
=====
327367

@@ -359,7 +399,7 @@ Configuration Client
359399

360400
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.
361401

362-
The Configuration Client uses the general messages parameters set by ``mesh target dst`` and ``mesh target net`` to target specific nodes. When the Bluetooth mesh shell node is provisioned, the Configuration Client model targets itself by default. 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 will be dependent 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 mesh nodes it provisioned. The following steps is a example of how you can set up a device to start using the Configuration Client commands:
402+
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:`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:
363403

364404
* Initialize the client node (``mesh init``).
365405
* Create the CDB (``mesh cdb create``).

include/zephyr/bluetooth/mesh/shell.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ extern "C" {
2727

2828
/** Target context for the mesh shell */
2929
struct bt_mesh_shell_target {
30-
/* Local address of the device */
31-
uint16_t local;
3230
/* Current destination address */
3331
uint16_t dst;
3432
/* Current net index */

subsys/bluetooth/mesh/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,15 @@ config BT_MESH_SHELL_HEALTH_SRV_INSTANCE
898898
to the device composition data. Use BT_MESH_SHELL_HEALTH_PUB_DEFINE to
899899
instantiate publication context.
900900

901+
config BT_MESH_SHELL_PROV_CTX_INSTANCE
902+
bool "Support for Shell provisioning context instance"
903+
help
904+
This option enables the provisioning context instance in the
905+
Bluetooth mesh shell module together with several provisioning
906+
commands and target utility features. To use the provisioning
907+
context instance, use bt_mesh_shell_prov in the
908+
initialization of mesh.
909+
901910
endif # BT_MESH_SHELL
902911

903912
config BT_MESH_MODEL_EXTENSIONS

0 commit comments

Comments
 (0)