Skip to content

Commit

Permalink
doc: improvements to nRF Desktop and CAF documentation
Browse files Browse the repository at this point in the history
Making configuration steps clearer.
Also other minor fixes.

NCSDK-30075

Signed-off-by: Pekka Niskanen <[email protected]>
  • Loading branch information
peknis committed Jan 2, 2025
1 parent 6862306 commit 967a8c1
Show file tree
Hide file tree
Showing 43 changed files with 216 additions and 210 deletions.
2 changes: 1 addition & 1 deletion applications/nrf_desktop/doc/bas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Module events
Configuration
*************

The module is enabled with the :ref:`CONFIG_DESKTOP_BAS_ENABLE <config_desktop_app_options>` option, that is implied by the :ref:`CONFIG_DESKTOP_BT_PERIPHERAL <config_desktop_app_options>` option.
To enable this module, use the :ref:`CONFIG_DESKTOP_BAS_ENABLE <config_desktop_app_options>` Kconfig option, that is implied by the :ref:`CONFIG_DESKTOP_BT_PERIPHERAL <config_desktop_app_options>` option.
The Battery Service is required for the HID peripheral device.
For more information about the Bluetooth® configuration in the nRF Desktop, see the :ref:`nrf_desktop_bluetooth_guide` documentation.

Expand Down
2 changes: 1 addition & 1 deletion applications/nrf_desktop/doc/ble_bond.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ For example, the transition from :c:enumerator:`STATE_ERASE_PEER` to :c:enumerat

When the transition occurs:

a. The :c:struct:`ble_peer_operation_event` with the defined :c:member:`ble_peer_operation_event.op` is submitted.
1. The :c:struct:`ble_peer_operation_event` with the defined :c:member:`ble_peer_operation_event.op` is submitted.
For example, when the user confirms the erase advertising, the :c:struct:`ble_peer_operation_event` is submitted with :c:member:`ble_peer_operation_event.op` set to :c:enumerator:`PEER_OPERATION_ERASE_ADV`.
#. The currently selected application local identity is updated (if anything changed).

Expand Down
4 changes: 3 additions & 1 deletion applications/nrf_desktop/doc/ble_discovery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ Complete the following steps to configure the module:
These modules are required for HID dongle that forwards the data from HID peripherals connected over Bluetooth.
#. Make sure that the :kconfig:option:`CONFIG_BT_GATT_CLIENT` Kconfig option is enabled to support the GATT Client role.
The GATT Client role is enabled by default by the :ref:`CONFIG_DESKTOP_BT_CENTRAL <config_desktop_app_options>` Kconfig option.
#. The |ble_discovery| module uses the :ref:`gatt_dm_readme` and selects the :kconfig:option:`CONFIG_BT_GATT_DM` Kconfig option to enable the library.

The |ble_discovery| module uses the :ref:`gatt_dm_readme` and selects the :kconfig:option:`CONFIG_BT_GATT_DM` Kconfig option to enable the library.

#. Define the module configuration in the :file:`ble_discovery_def.h` file, located in the board-specific directory in the application configuration directory.
You must define the following parameters for every nRF Desktop peripheral that connects with the given nRF Desktop central:

Expand Down
6 changes: 3 additions & 3 deletions applications/nrf_desktop/doc/ble_latency.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ The module listens for the following events related to data transfer initiated b
When these events are received, the module sets the connection latency to low.
When the :ref:`nrf_desktop_config_channel` is no longer in use, and neither :ref:`nrf_desktop_ble_smp` nor :ref:`nrf_desktop_dfu_mcumgr` receive firmware updates (no mentioned events for ``LOW_LATENCY_CHECK_PERIOD_MS``), the module sets the connection latency to :kconfig:option:`CONFIG_BT_PERIPHERAL_PREF_LATENCY` to reduce the power consumption.

.. note::
If the option :ref:`CONFIG_DESKTOP_BLE_LOW_LATENCY_LOCK <config_desktop_app_options>` is enabled, the LLPM connection latency is not increased unless the device is in the low power mode.
.. note::
If the :ref:`CONFIG_DESKTOP_BLE_LOW_LATENCY_LOCK <config_desktop_app_options>` Kconfig option is enabled, the LLPM connection latency is not increased unless the device is in the low power mode.

When the device is in the low power mode and the events related to data transfer are not received, the connection latency is set to higher value to reduce the power consumption.
When the device is in the low power mode and the events related to data transfer are not received, the connection latency is set to higher value to reduce the power consumption.

The ``ble_latency`` module receives :ref:`nrf_desktop_config_channel` events, but it is not configurable with the :ref:`nrf_desktop_config_channel`.
The module does not register itself using the ``GEN_CONFIG_EVENT_HANDLERS`` macro.
Expand Down
6 changes: 3 additions & 3 deletions applications/nrf_desktop/doc/ble_passkey.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Bluetooth LE passkey module
:local:
:depth: 2

Use the Bluetooth LE passkey module to enable pairing based on passkey for increased security.
Use the Bluetooth® LE passkey module to enable pairing based on passkey for increased security.

Module events
*************
Expand All @@ -22,7 +22,7 @@ Module events
Configuration
*************

The module requires the basic Bluetooth® configuration, as described in :ref:`nrf_desktop_bluetooth_guide`.
The module requires the basic Bluetooth configuration, as described in :ref:`nrf_desktop_bluetooth_guide`.
The module can be used only for nRF Desktop Bluetooth Peripheral devices (:ref:`CONFIG_DESKTOP_BT_PERIPHERAL <config_desktop_app_options>`).

Use the option :ref:`CONFIG_DESKTOP_BLE_ENABLE_PASSKEY <config_desktop_app_options>` to enable the module.
Expand All @@ -42,5 +42,5 @@ The passkey input is handled in the :ref:`nrf_desktop_passkey`.

.. note::
By default, Zephyr's Bluetooth Peripheral demands the security level 3 in case the passkey authentication is enabled.
If the nRF Desktop dongle is unable to achieve the security level 3, it will be unable to connect with the peripheral.
If the nRF Desktop dongle cannot achieve the security level 3, it cannot connect with the peripheral.
The :kconfig:option:`CONFIG_BT_SMP_ENFORCE_MITM` option is disabled by default to allow the dongle to connect without the authentication.
9 changes: 5 additions & 4 deletions applications/nrf_desktop/doc/ble_qos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ Configuration
The module requires the basic Bluetooth configuration, as described in :ref:`nrf_desktop_bluetooth_guide`.

The QoS module uses the ``chmap_filter`` library, whose API is described in :file:`src/util/chmap_filter/include/chmap_filter.h`.
The library is linked if :ref:`CONFIG_DESKTOP_BLE_QOS_ENABLE <config_desktop_app_options>` Kconfig option is enabled.
The library is linked if the :ref:`CONFIG_DESKTOP_BLE_QOS_ENABLE <config_desktop_app_options>` Kconfig option is enabled.

Enable the module using the :ref:`CONFIG_DESKTOP_BLE_QOS_ENABLE <config_desktop_app_options>` Kconfig option.
The option selects :kconfig:option:`CONFIG_BT_HCI_VS_EVT_USER`, because the module uses vendor-specific HCI events.

You can use the :ref:`CONFIG_DESKTOP_BLE_QOS_STATS_PRINTOUT_ENABLE <config_desktop_app_options>` Kconfig option to enable real-time QoS information printouts through the USB CDC ACM port.
The :ref:`CONFIG_DESKTOP_USB_STACK_LEGACY <config_desktop_app_options>` Kconfig option must be enabled and the selected USB CDC ACM instance must be enabled, and specified in devicetree using ``ncs,ble-qos-uart`` DT chosen.
Use the :ref:`CONFIG_DESKTOP_BLE_QOS_STATS_PRINTOUT_ENABLE <config_desktop_app_options>` Kconfig option to enable real-time QoS information printouts through the USB CDC ACM port.
The :ref:`CONFIG_DESKTOP_USB_STACK_LEGACY <config_desktop_app_options>` Kconfig option must be enabled.
Also the selected USB CDC ACM instance must be enabled, and specified in devicetree using ``ncs,ble-qos-uart`` DT chosen.
For an example of configuration that specifies the ``ncs,ble-qos-uart`` DT chosen, see the :file:`configuration/nrf52840dongle_nrf52840/app.overlay` file.
This option automatically selects other Kconfig options needed to handle stats printouts over the USB CDC ACM port:
This option automatically selects other Kconfig options needed to handle statistics printouts over the USB CDC ACM port:

* :kconfig:option:`CONFIG_USB_COMPOSITE_DEVICE`
* :kconfig:option:`CONFIG_USB_CDC_ACM`
Expand Down
15 changes: 8 additions & 7 deletions applications/nrf_desktop/doc/ble_scan.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Complete the following steps to enable the |ble_scan|:
#. Make sure that the number of scan filters based on the Bluetooth name (:kconfig:option:`CONFIG_BT_SCAN_NAME_CNT`) is equal to the number of peripheral types the nRF Desktop central connects to.
The |ble_scan| uses Bluetooth name filters to look for unbonded peripherals.
The peripheral type may be either a mouse or a keyboard.
#. If you want to limit the number of attempts to connect to a device, you can use the connection attempt filter (:kconfig:option:`CONFIG_BT_SCAN_CONN_ATTEMPTS_FILTER`).
#. To limit the number of attempts to connect to a device, you can use the connection attempt filter (:kconfig:option:`CONFIG_BT_SCAN_CONN_ATTEMPTS_FILTER`).
The Kconfig option is enabled by default.
After the predefined number of disconnections or connection failures, the nRF Desktop central will no longer try to connect with the given peripheral device.
This is done to prevent connecting and disconnecting with a peripheral in a never-ending loop.
Expand Down Expand Up @@ -88,14 +88,14 @@ The following scanning scenarios are possible:
Scanning module configuration
=============================

The |ble_scan| relies on :ref:`nrf_bt_scan_readme` to perform Bluetooth scanning.
The |ble_scan| selects :kconfig:option:`CONFIG_BT_SCAN` and :kconfig:option:`CONFIG_BT_SCAN_FILTER_ENABLE`.
Apart from that the following default values are applied:
The |ble_scan| relies on the :ref:`nrf_bt_scan_readme` library to perform Bluetooth scanning.
The module selects :kconfig:option:`CONFIG_BT_SCAN` and :kconfig:option:`CONFIG_BT_SCAN_FILTER_ENABLE`.
Apart from that, the following default values are applied:

* :kconfig:option:`CONFIG_BT_SCAN_NAME_CNT` is set to ``2``.
By default, nRF Desktop dongle connects to peripherals that are either keyboard or mouse.
By default, the nRF Desktop dongle connects to peripherals that are either keyboard or mouse.
* :kconfig:option:`CONFIG_BT_SCAN_ADDRESS_CNT` is set to :kconfig:option:`CONFIG_BT_MAX_PAIRED`.
The dongle scans for all of the bonded peripherals.
The dongle scans for all bonded peripherals.
* :kconfig:option:`CONFIG_BT_SCAN_CONN_ATTEMPTS_FILTER` is enabled.

.. _nrf_desktop_ble_scan_scanning_not_started:
Expand Down Expand Up @@ -139,7 +139,8 @@ If the :ref:`CONFIG_DESKTOP_BLE_FORCED_SCAN_DURATION_S <config_desktop_app_optio
* Scan request

After the duration that is specified in the :ref:`CONFIG_DESKTOP_BLE_FORCED_SCAN_DURATION_S <config_desktop_app_options>` Kconfig option, the module switches to regular scanning.
The regular scanning can be interrupted by using connected peripherals and times out after the scan duration specified by :ref:`CONFIG_DESKTOP_BLE_SCAN_DURATION_S <config_desktop_app_options>` if there are peripherals connected over Bluetooth.
You can interrupt regular scanning by using connected peripherals.
The scanning times out after the duration specified by :ref:`CONFIG_DESKTOP_BLE_SCAN_DURATION_S <config_desktop_app_options>` if there are peripherals connected over Bluetooth.

.. note::
The conditions described under :ref:`nrf_desktop_ble_scan_scanning_not_started` prevent the starting of the forced scan.
Expand Down
6 changes: 3 additions & 3 deletions applications/nrf_desktop/doc/buttons_sim.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Button simulator module

Use the |button_sim| to generate the sequence of simulated key presses.
The time between subsequent key presses is defined as a module configuration option.
Generating keys can be started and stopped by pressing the predefined button.
To start or stop generating key presses, press the predefined button.

Module events
*************
Expand All @@ -34,7 +34,7 @@ To configure the |button_sim|:
#. Define the interval between subsequent simulated button presses (:ref:`CONFIG_DESKTOP_BUTTONS_SIM_INTERVAL <config_desktop_app_options>`).
One second is used by default.

If you want the sequence to automatically restart after it ends, set :ref:`CONFIG_DESKTOP_BUTTONS_SIM_LOOP_FOREVER <config_desktop_app_options>`.
If you want the sequence to automatically restart after it ends, set the :ref:`CONFIG_DESKTOP_BUTTONS_SIM_LOOP_FOREVER <config_desktop_app_options>` Kconfig option.
By default, the sequence is generated only once.

Implementation details
Expand All @@ -43,4 +43,4 @@ Implementation details
The |button_sim| generates button sequence using :c:struct:`k_work_delayable`, which resubmits itself.
The work handler submits the press and the release of a single button from the sequence.

Receiving :c:struct:`button_event` with the key ID set to :ref:`CONFIG_DESKTOP_BUTTONS_SIM_TRIGGER_KEY_ID <config_desktop_app_options>` either stops generating the sequence (in case it is already being generated) or starts generating it.
Receiving :c:struct:`button_event` with the key ID set to :ref:`CONFIG_DESKTOP_BUTTONS_SIM_TRIGGER_KEY_ID <config_desktop_app_options>` either stops generating the sequence (if it is already being generated) or starts generating it.
4 changes: 2 additions & 2 deletions applications/nrf_desktop/doc/config_channel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,8 @@ To register an application module as a configuration channel listener, complete

.. note::
The module must be an early subscriber to make sure it will receive the event before the configuration channel transports (:ref:`nrf_desktop_usb_state` and :ref:`nrf_desktop_hids`).
Otherwise, the module may not receive the configuration channel requests at all.
In that case an error responses will be generated by configuration channel transport.
Otherwise, the module may not receive configuration channel requests at all.
In that case, an error response will be generated by the configuration channel transport.

#. Call :c:macro:`GEN_CONFIG_EVENT_HANDLERS` in the :ref:`app_event_manager` event handler function registered by the application module:

Expand Down
6 changes: 3 additions & 3 deletions applications/nrf_desktop/doc/constlat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Module events
Configuration
*************

Enable the module with the :ref:`CONFIG_DESKTOP_CONSTLAT_ENABLE <config_desktop_app_options>` option.
To enable the module, use the :ref:`CONFIG_DESKTOP_CONSTLAT_ENABLE <config_desktop_app_options>` Kconfig option.

You can set the :ref:`CONFIG_DESKTOP_CONSTLAT_DISABLE_ON_STANDBY <config_desktop_app_options>` to disable the constant latency interrupts when the device goes to the low power mode (on ``power_down_event``).
The constant latency interrupts are reenabled on ``wake_up_event``.
You can set the :ref:`CONFIG_DESKTOP_CONSTLAT_DISABLE_ON_STANDBY <config_desktop_app_options>` option to disable the constant latency interrupts when the device switches to the low power mode (on ``power_down_event``).
The constant latency interrupts are re-enabled on a ``wake_up_event``.
6 changes: 3 additions & 3 deletions applications/nrf_desktop/doc/cpu_meas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ Module events
Configuration
*************

Enable the module using the :ref:`CONFIG_DESKTOP_CPU_MEAS_ENABLE <config_desktop_app_options>` option.
This Kconfig option selects the :kconfig:option:`CONFIG_CPU_LOAD` option.
To enable this module, use the :ref:`CONFIG_DESKTOP_CPU_MEAS_ENABLE <config_desktop_app_options>` Kconfig option.
This option selects the :kconfig:option:`CONFIG_CPU_LOAD` option.
The :kconfig:option:`CONFIG_CPU_LOAD` option enables :ref:`cpu_load`, that is used to perform the measurements.

Set the time between subsequent CPU load measurements, in milliseconds, using the :ref:`CONFIG_DESKTOP_CPU_MEAS_PERIOD <config_desktop_app_options>` option.

Implementation details
**********************

The module periodically submits the measured CPU load as :c:struct:`cpu_load_event` and resets the measurement.
The module periodically submits the measured CPU load as a :c:struct:`cpu_load_event` and resets the measurement.
The event can be displayed in the logs or using the :ref:`nrf_profiler`.
The :c:member:`cpu_load_event.load` presents the CPU load in 0.001% units.
14 changes: 7 additions & 7 deletions applications/nrf_desktop/doc/dev_descr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Device description module
:local:
:depth: 2

The device description module defines custom GATT Service, which contains:
The device description module defines the custom GATT Service that contains:

* Information about whether the peripheral supports the Low Latency Packet Mode (LLPM)
* Hardware ID (HW ID) of the peripheral
* Information about whether the peripheral supports the Low Latency Packet Mode (LLPM).
* Hardware ID (HW ID) of the peripheral.

To support the LLPM, the peripheral must use the SoftDevice Link Layer.
This means that you must enable both the :kconfig:option:`CONFIG_BT_LL_SOFTDEVICE` and the :kconfig:option:`CONFIG_CAF_BLE_USE_LLPM` Kconfig options.
Expand All @@ -20,21 +20,21 @@ The Service is mandatory for all nRF Desktop peripherals that connect to the nRF
Module events
*************

The ``dev_descr`` module does not submit any event nor subscribe for any event.
The ``dev_descr`` module does not submit nor subscribe to any events.

Configuration
*************

The module requires the basic Bluetooth configuration, as described in the :ref:`nrf_desktop_bluetooth_guide` documentation.
Make sure that both :ref:`CONFIG_DESKTOP_ROLE_HID_PERIPHERAL <config_desktop_app_options>` and :ref:`CONFIG_DESKTOP_BT_PERIPHERAL <config_desktop_app_options>` options are enabled.
The module requires the basic Bluetooth® configuration, as described in the :ref:`nrf_desktop_bluetooth_guide` documentation.
Make sure that both :ref:`CONFIG_DESKTOP_ROLE_HID_PERIPHERAL <config_desktop_app_options>` and :ref:`CONFIG_DESKTOP_BT_PERIPHERAL <config_desktop_app_options>` Kconfig options are enabled.
The device description application module is enabled by the :ref:`CONFIG_DESKTOP_DEV_DESCR_ENABLE <config_desktop_app_options>` option, which is implied by :ref:`CONFIG_DESKTOP_BT_PERIPHERAL <config_desktop_app_options>` together with other features used by a Bluetooth LE HID peripheral device.

The module selects the :ref:`CONFIG_DESKTOP_HWID <config_desktop_app_options>` option to make sure that the nRF Desktop Hardware ID utility is enabled.
The utility uses Zephyr's :ref:`zephyr:hwinfo_api` to obtain the hardware ID and selects the :kconfig:option:`CONFIG_HWINFO` Kconfig option to automatically enable the required driver.

The :file:`dev_descr.h` file contains the UUIDs used by the custom GATT Service.
The file is located in the :file:`configuration/common` directory.
The UUIDs must be the same for all devices to ensure that the central is able to read the provided information.
The UUIDs must be the same for all devices to ensure that the central can read the provided information.

Implementation details
**********************
Expand Down
Loading

0 comments on commit 967a8c1

Please sign in to comment.