1.. _bluetooth_shell: 2 3Shell 4##### 5 6The Bluetooth Shell is an application based on the :ref:`shell_api` module. It offer a collection of 7commands made to easily interact with the Bluetooth stack. 8 9For specific Bluetooth functionality see also the following shell documentation 10 11.. toctree:: 12 :maxdepth: 1 13 14 shell/audio/bap.rst 15 shell/audio/bap_broadcast_assistant.rst 16 shell/audio/bap_scan_delegator.rst 17 shell/audio/cap.rst 18 shell/audio/ccp.rst 19 shell/audio/csip.rst 20 shell/audio/gmap.rst 21 shell/audio/mcp.rst 22 shell/audio/tbs.rst 23 shell/audio/tmap.rst 24 shell/audio/pbp.rst 25 shell/classic/a2dp.rst 26 shell/host/gap.rst 27 shell/host/gatt.rst 28 shell/host/iso.rst 29 shell/host/l2cap.rst 30 31Bluetooth Shell Setup and Usage 32******************************* 33 34First you need to build and flash your board with the Bluetooth shell. For how to do that, see the 35:ref:`getting_started`. The Bluetooth shell itself is located in 36:zephyr_file:`tests/bluetooth/shell/`. 37 38When it's done, connect to the CLI using your favorite serial terminal application. You should see 39the following prompt: 40 41.. code-block:: console 42 43 uart:~$ 44 45For more details on general usage of the shell, see :ref:`shell_api`. 46 47The first step is enabling Bluetooth. To do so, use the :code:`bt init` command. The following 48message is printed to confirm Bluetooth has been initialized. 49 50.. code-block:: console 51 52 uart:~$ bt init 53 Bluetooth initialized 54 Settings Loaded 55 [00:02:26.771,148] <inf> fs_nvs: nvs_mount: 8 Sectors of 4096 bytes 56 [00:02:26.771,148] <inf> fs_nvs: nvs_mount: alloc wra: 0, fe8 57 [00:02:26.771,179] <inf> fs_nvs: nvs_mount: data wra: 0, 0 58 [00:02:26.777,984] <inf> bt_hci_core: hci_vs_init: HW Platform: Nordic Semiconductor (0x0002) 59 [00:02:26.778,015] <inf> bt_hci_core: hci_vs_init: HW Variant: nRF52x (0x0002) 60 [00:02:26.778,045] <inf> bt_hci_core: hci_vs_init: Firmware: Standard Bluetooth controller (0x00) Version 3.2 Build 99 61 [00:02:26.778,656] <inf> bt_hci_core: bt_init: No ID address. App must call settings_load() 62 [00:02:26.794,738] <inf> bt_hci_core: bt_dev_show_info: Identity: EB:BF:36:26:42:09 (random) 63 [00:02:26.794,769] <inf> bt_hci_core: bt_dev_show_info: HCI: version 5.3 (0x0c) revision 0x0000, manufacturer 0x05f1 64 [00:02:26.794,799] <inf> bt_hci_core: bt_dev_show_info: LMP: version 5.3 (0x0c) subver 0xffff 65 66 67Logging 68******* 69 70You can configure the logging level per module at runtime. This depends on the maximum logging level 71that is compiled in. To configure, use the :code:`log` command. Here are some examples: 72 73* List the available modules and their current logging level 74 75.. code-block:: console 76 77 uart:~$ log status 78 79* Disable logging for *bt_hci_core* 80 81.. code-block:: console 82 83 uart:~$ log disable bt_hci_core 84 85* Enable error logs for *bt_att* and *bt_smp* 86 87.. code-block:: console 88 89 uart:~$ log enable err bt_att bt_smp 90 91* Disable logging for all modules 92 93.. code-block:: console 94 95 uart:~$ log disable 96 97* Enable warning logs for all modules 98 99.. code-block:: console 100 101 uart:~$ log enable wrn 102