Skip to content

Commit

Permalink
applications: nrf_desktop: Update BLE QoS stats printout
Browse files Browse the repository at this point in the history
Change updates dependencies and documentation of the
CONFIG_DESKTOP_BLE_QOS_STATS_PRINTOUT_ENABLE Kconfig option.

Jira: NCSDK-27883

Signed-off-by: Marek Pieta <[email protected]>
Signed-off-by: Mateusz Kapala <[email protected]>
Signed-off-by: Divya Pillai <[email protected]>
  • Loading branch information
MarekPieta authored and anangl committed Jun 19, 2024
1 parent 1cea083 commit a1cfb3c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* the RNG node for entropy exclusively.
*/
zephyr,entropy = &rng;
ncs,ble-qos-uart = &cdc_acm_uart;
};

/* Configure DTS nodes used for USB next HID support. */
Expand Down Expand Up @@ -60,6 +61,10 @@
num-isoout-endpoints = <0>;
};

&cdc_acm_uart {
status = "okay";
};

&pwm0 {
status = "okay";
};
Expand Down
14 changes: 10 additions & 4 deletions applications/nrf_desktop/doc/ble_qos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@ The library is linked if :ref:`CONFIG_DESKTOP_BLE_QOS_ENABLE <config_desktop_app
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>` option to enable real-time QoS information printouts through a UART (e.g. a virtual COM port).
The chosen UART needs to be specified in devicetree using ``ncs,ble-qos-uart``.
This option also enables and configures the COM port (USB CDC ACM).
For this reason, the :kconfig:option:`CONFIG_USB_DEVICE_STACK` must be enabled.
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.
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:

* :kconfig:option:`CONFIG_USB_COMPOSITE_DEVICE`
* :kconfig:option:`CONFIG_USB_CDC_ACM`
* :kconfig:option:`CONFIG_SERIAL`
* :kconfig:option:`CONFIG_UART_LINE_CTRL`
* :kconfig:option:`CONFIG_UART_INTERRUPT_DRIVEN`

The QoS module creates additional thread for processing the QoS algorithm.
You can define the following options:
Expand Down
7 changes: 6 additions & 1 deletion applications/nrf_desktop/src/modules/Kconfig.ble_qos
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ config DESKTOP_BLE_QOS_STACK_SIZE
help
Configure base stack size for QoS processing thread.

DT_CHOSEN_NCS_BLE_QOS_UART := ncs,ble-qos-uart
DT_COMP_ZEPHYR_CDC_ACM_UART := zephyr,cdc-acm-uart

config DESKTOP_BLE_QOS_STATS_PRINTOUT_ENABLE
bool "Enable BLE QoS statistics printout"
depends on USB_DEVICE_STACK
depends on DESKTOP_USB_STACK_LEGACY
depends on $(dt_chosen_enabled,$(DT_CHOSEN_NCS_BLE_QOS_UART)) && \
$(dt_chosen_has_compat,$(DT_CHOSEN_NCS_BLE_QOS_UART),$(DT_COMP_ZEPHYR_CDC_ACM_UART))
select USB_COMPOSITE_DEVICE
select USB_CDC_ACM
select SERIAL
Expand Down
3 changes: 1 addition & 2 deletions applications/nrf_desktop/src/modules/ble_qos.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ BUILD_ASSERT(THREAD_PRIORITY >= CONFIG_BT_HCI_TX_PRIO);

static void ble_qos_thread_fn(void);

static const struct device *const cdc_dev =
DEVICE_DT_GET_OR_NULL(DT_CHOSEN(ncs_ble_qos_uart));
static const struct device *const cdc_dev = DEVICE_DT_GET_OR_NULL(DT_CHOSEN(ncs_ble_qos_uart));
static uint32_t cdc_dtr;

enum ble_qos_opt {
Expand Down

0 comments on commit a1cfb3c

Please sign in to comment.