Bluetooth LE Quality of Service module

Use the Bluetooth® LE Quality of Service (QoS) module to achieve better connection quality and higher report rate by avoiding congested RF channels. The module can be used by both nRF Desktop peripheral and nRF Desktop central with the SoftDevice Link Layer (CONFIG_BT_LL_SOFTDEVICE). However, only the Bluetooth central can update the Bluetooth LE channel map that is in use.

Module events

Source Module

Input Event

This Module

Output Event

Sink Module

Source modules for config_event



HID forward module


HID state module

HID Service module

USB state module

Source modules for module_state_event



Quality of Service module


Sink modules for config_event


Sink modules for module_state_event


See the Overview: Firmware architecture for more information about the event-based communication in the nRF Desktop application and about how to read this table.


The module requires the basic Bluetooth configuration, as described in Bluetooth in nRF Desktop.

The QoS module uses the chmap_filter library, whose API is described in src/util/chmap_filter/include/chmap_filter.h. The library is linked if CONFIG_DESKTOP_BLE_QOS_ENABLE Kconfig option is enabled.

Enable the module using the CONFIG_DESKTOP_BLE_QOS_ENABLE Kconfig option. The option selects CONFIG_BT_HCI_VS_EVT_USER, because the module uses vendor-specific HCI events.

You can use the CONFIG_DESKTOP_BLE_QOS_STATS_PRINTOUT_ENABLE 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 CONFIG_USB_DEVICE_STACK must be enabled.

The QoS module creates additional thread for processing the QoS algorithm. You can define the following options:


You can use the default thread stack sizes as long as you do not modify the module source code.

Configuration channel options

You can use the Configuration channel to configure the module or read the configuration. The module is a configuration channel listener and provides the following configuration options:

  • sample_count_min

    Minimum number of samples needed for channel map processing.

  • min_channel_count

    Minimum Bluetooth LE channel count.

  • weight_crc_ok

    Weight of CRC OK. Fixed point value with 1/100 scaling.

  • weight_crc_error

    Weight of CRC ERROR. Fixed point value with 1/100 scaling.

  • ble_block_threshold

    Threshold relative to the average rating for blocking Bluetooth LE channels. Fixed point value with 1/100 scaling.

  • eval_max_count

    Maximum number of blocked channels that can be evaluated.

  • eval_duration

    Duration of the channel evaluation (in seconds).

  • eval_keepout_duration

    Duration during which a channel will be blocked before it is considered for re-evaluation (in seconds).

  • eval_success_threshold

    Average rating threshold for approving a blocked Bluetooth LE channel that is under evaluation by the QoS module. Fixed point value with 1/100 scaling.

  • wifi_rating_inc

    Wi-Fi strength rating multiplier. Increase the value to block Wi-Fi faster. Fixed point value with 1/100 scaling.

  • wifi_present_threshold

    Average rating threshold for considering a Wi-Fi present. Fixed point with 1/100 scaling.

  • wifi_active_threshold

    Average rating threshold for considering a Wi-Fi active (blockable). Fixed point value with 1/100 scaling.

  • channel_map

    5-byte Bluetooth LE channel map bitmask. This option is read-only.

  • wifi_blacklist

    List of blacklisted Wi-Fi channels. The QoS module represents the list as a bitmask. In the HID configurator for nRF Desktop, the Wi-Fi channels are provided in a comma-separated list, for example wifi_blacklist 1,3,5.

Implementation details

The QoS module uses Zephyr’s Settings subsystem to store the configuration in non-volatile memory. The channel map is not stored.

SoftDevice Controller interaction

The module uses CRC information from the SoftDevice Controller to adjust the channel map. The CRC information is received through the vendor-specific Bluetooth HCI event (SDC_HCI_SUBEVENT_VS_QOS_CONN_EVENT_REPORT).

Additional thread

The module creates an additional low-priority thread. The thread is used to periodically perform the following operations:

  • Check and apply new configuration parameters received through the Configuration channel.

  • Check and apply new blacklist received through the Configuration channel.

  • Process channel map filter.

  • Get channel map suggested by the chmap_filter library.

  • Submit the suggested channel map as ble_qos_event.

  • If the device is a Bluetooth central, update the used Bluetooth LE channel map.

If the CONFIG_DESKTOP_BLE_QOS_STATS_PRINTOUT_ENABLE Kconfig option is set, the module prints the following information through the virtual COM port:

  • HID report rate

    The module counts the number of HID input reports received through Bluetooth LE and prints the report rate through the virtual COM port every 100 packets. The report rate is printed with a timestamp.

    Example output:

  • Bluetooth LE channel statistics

    The information is printed by the low-priority thread. The output (BT_INFO) consists of the Bluetooth LE channel information. Every Bluetooth LE channel information contains the following elements:

    • Last two digits of the channel frequency (2400 + x MHz)

    • Channel state

    • Channel rating

    If the channel map is updated, the Channel map update string is printed with a timestamp.

    Example output:

    [05407128]Channel map update