This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 6bc6ffef30b Documentation: Describe NimBLE mesh support and examples.
6bc6ffef30b is described below
commit 6bc6ffef30b8fcad3fc5e13059002cc554033139
Author: raiden00pl <[email protected]>
AuthorDate: Fri Oct 30 10:08:42 2026 +0100
Documentation: Describe NimBLE mesh support and examples.
Document the NimBLE configuration options added with the Mbed TLS
migration and Bluetooth Mesh support in apps, the buffer requirements
of a mesh node, and the nimble_mesh_node, nimble_mesh_sensor and
nimble_mesh_vendor examples.
Assisted-by: Claude:claude-fable-5-1
Signed-off-by: raiden00pl <[email protected]>
---
.../examples/nimble_mesh_node/index.rst | 17 ++++++
.../examples/nimble_mesh_sensor/index.rst | 19 +++++++
.../examples/nimble_mesh_vendor/index.rst | 17 ++++++
.../applications/wireless/nimble/index.rst | 60 ++++++++++++++++++++++
4 files changed, 113 insertions(+)
diff --git a/Documentation/applications/examples/nimble_mesh_node/index.rst
b/Documentation/applications/examples/nimble_mesh_node/index.rst
new file mode 100644
index 00000000000..4a54dc8dc8f
--- /dev/null
+++ b/Documentation/applications/examples/nimble_mesh_node/index.rst
@@ -0,0 +1,17 @@
+==============================================
+``nimble_mesh_node`` NimBLE Mesh node
+==============================================
+
+A provisionable Bluetooth Mesh node (company ``0x05F1``) with the
+Configuration Server, Health Server and Generic OnOff Server models on its
+primary element. Generic OnOff Get, Set and Set Unacknowledged are handled
+and the state is reported with Generic OnOff Status.
+
+Needs ``CONFIG_NIMBLE_MESH`` with PB-ADV or PB-GATT, see
+:doc:`/applications/wireless/nimble/index`. Start the node from NSH and
+provision it with a mesh provisioner::
+
+ nsh> nimble_mesh_node &
+ nimble_mesh_node: provisioning enabled
+
+Device UUID ``ddaa0001-4d45-5348-4f4e-4f4646000001``.
diff --git a/Documentation/applications/examples/nimble_mesh_sensor/index.rst
b/Documentation/applications/examples/nimble_mesh_sensor/index.rst
new file mode 100644
index 00000000000..1066fef7f0b
--- /dev/null
+++ b/Documentation/applications/examples/nimble_mesh_sensor/index.rst
@@ -0,0 +1,19 @@
+==================================================
+``nimble_mesh_sensor`` NimBLE Mesh Sensor Server
+==================================================
+
+A provisionable Bluetooth Mesh node with a Sensor Server on its primary
+element serving one property, Present Ambient Temperature (``0x004F``).
+Sensor Descriptor Get and Sensor Get answer with Sensor Descriptor Status
+and Sensor Status; the value is a simulated temperature that increases by
+0.5 C on every read. An unknown Property ID gets the empty reply defined by
+the Mesh Model specification.
+
+Needs ``CONFIG_NIMBLE_MESH`` with PB-ADV or PB-GATT, see
+:doc:`/applications/wireless/nimble/index`. Start the node from NSH and
+provision it with a mesh provisioner::
+
+ nsh> nimble_mesh_sensor &
+ nimble_mesh_sensor: provisioning enabled
+
+Device UUID ``ddaa0002-4d45-5348-5345-4e5300000001``.
diff --git a/Documentation/applications/examples/nimble_mesh_vendor/index.rst
b/Documentation/applications/examples/nimble_mesh_vendor/index.rst
new file mode 100644
index 00000000000..b49b8adff35
--- /dev/null
+++ b/Documentation/applications/examples/nimble_mesh_vendor/index.rst
@@ -0,0 +1,17 @@
+=================================================
+``nimble_mesh_vendor`` NimBLE Mesh vendor model
+=================================================
+
+A provisionable Bluetooth Mesh node with a vendor model (company
+``0x05F1``, model ``0x0001``) on its primary element. The model stores one
+byte: vendor opcode ``0x01`` (Get) and ``0x03`` (Set, one byte) answer with
+opcode ``0x02`` (Status) carrying the value.
+
+Needs ``CONFIG_NIMBLE_MESH`` with PB-ADV or PB-GATT, see
+:doc:`/applications/wireless/nimble/index`. Start the node from NSH and
+provision it with a mesh provisioner::
+
+ nsh> nimble_mesh_vendor &
+ nimble_mesh_vendor: provisioning enabled
+
+Device UUID ``ddaa0003-4d45-5348-564e-440000000001``.
diff --git a/Documentation/applications/wireless/nimble/index.rst
b/Documentation/applications/wireless/nimble/index.rst
index 7b574483e3d..a26bd6aadd6 100644
--- a/Documentation/applications/wireless/nimble/index.rst
+++ b/Documentation/applications/wireless/nimble/index.rst
@@ -9,6 +9,66 @@ For a Central/Peripheral example that tests connections, GATT
service
discovery, and subscriptions without Bluetooth hardware, see
:ref:`simulator_bluetooth_testing`.
+Configuration
+-------------
+
+NimBLE needs ``CONFIG_NET_BLUETOOTH`` and a Bluetooth controller exposed
+through the NuttX HCI socket, and conflicts with the NuttX host
+(``CONFIG_WIRELESS_BLUETOOTH_HOST`` must be off). Enable the GAP roles the
+application needs with ``CONFIG_NIMBLE_ROLE_*``.
+
+Cryptography uses Mbed TLS (``CONFIG_MBEDTLS_MINIMAL`` is enabled by
+default). ``CONFIG_NIMBLE_TINYCRYPT`` builds the legacy bundled TinyCrypt
+instead.
+
+``CONFIG_NIMBLE_EVENTQ_SIZE`` sets the depth of the host event queue. Hosts
+that scan need room for the advertising reports queued by the transport;
+the default is 16, or 32 with mesh.
+
+Bluetooth Mesh
+--------------
+
+``CONFIG_NIMBLE_MESH`` builds the NimBLE mesh stack. Provisioning bearers
+and node features:
+
+- ``CONFIG_NIMBLE_MESH_PB_ADV`` - PB-ADV, needs the broadcaster and
+ observer roles.
+- ``CONFIG_NIMBLE_MESH_PB_GATT`` - PB-GATT, needs the peripheral role.
+- ``CONFIG_NIMBLE_MESH_GATT_PROXY``, ``CONFIG_NIMBLE_MESH_RELAY``,
+ ``CONFIG_NIMBLE_MESH_FRIEND``, ``CONFIG_NIMBLE_MESH_LOW_POWER``,
+ ``CONFIG_NIMBLE_MESH_PROVISIONER``.
+- ``CONFIG_NIMBLE_MESH_DEVICE_NAME`` - name in the PB-GATT and proxy scan
+ response.
+
+Resource limits: ``CONFIG_NIMBLE_MESH_SUBNET_COUNT``,
+``CONFIG_NIMBLE_MESH_APP_KEY_COUNT``, ``CONFIG_NIMBLE_MESH_MODEL_KEY_COUNT``,
+``CONFIG_NIMBLE_MESH_MODEL_GROUP_COUNT``, ``CONFIG_NIMBLE_MESH_ADV_BUF_COUNT``,
+``CONFIG_NIMBLE_MESH_TX_SEG_MAX`` and ``CONFIG_NIMBLE_MESH_RX_SEG_MAX``.
+
+A mesh node scans continuously and the host is busy for up to a second
+during provisioning (ECDH), so the Bluetooth socket must absorb a burst
+of advertising reports: set ``CONFIG_NET_BLUETOOTH_BACKLOG=32`` and
+``CONFIG_IOB_NBUFFERS=64``. With the defaults (8 and 8) the socket drops
+the oldest queued HCI event, which can be a Command Complete, and the
+host resets on an HCI timeout.
+
+The controller must support scanning and advertising at the same time.
+With the nRF52 SoftDevice Controller the peripheral-only configuration
+has no scanning, so mesh needs ``CONFIG_NRF52_SDC_MULTIROLE`` and
+``CONFIG_BLUETOOTH_MAX_CONN=2`` (one peripheral plus one central role).
+
+Mesh applications create the HCI socket task, register the mesh GATT
+services with ``bt_mesh_register_gatt()`` before the host starts, call
+``bt_mesh_init()`` from the host sync callback, run ``mesh_adv_thread()``
+on its own thread and enable provisioning with ``bt_mesh_prov_enable()``.
+See the :doc:`node </applications/examples/nimble_mesh_node/index>`,
+:doc:`sensor </applications/examples/nimble_mesh_sensor/index>` and
+:doc:`vendor </applications/examples/nimble_mesh_vendor/index>` examples.
+
+Nodes can be provisioned from Linux with BlueZ ``bluetooth-meshd`` and
+``mesh-cfgclient``. ``meshd`` needs exclusive access to the adapter, so
+``bluetoothd`` must not manage it at the same time.
+
.. toctree::
:maxdepth: 2
:caption: Contents