Skip to content

Commit 43f3c50

Browse files
committed
samples: ble_nus_central: cleanup sample
* Update header include list. Add missing and reorder. * Update return type of scan_start function to void because the returned error values are not used. * Align the placement of const keyword for some parameters and variables. * Align names some event handlers and init functions. * Align setup of scan filters with other central samples. * Removed call to ble_nus_client_handles_assign from BLE_GAP_EVT_CONNECTED evt handling (it is done from BLE_NUS_CLIENT_EVT_DISCOVERY_COMPLETE event handling) and moved a call to scan_start() from BLE_NUS_CLIENT_EVT_DISCONNECTED event handling to BLE_GAP_EVT_DISCONNECTED event handling to align with ble_hrs_central sample. * Removed application specific handling of the BLE_GAP_EVT_PHY_UPDATE_REQUEST event. It is now handled by the conn_params library. * Removed some duplicate logging of ATT MTU and data length updates. Signed-off-by: Andreas Moltumyr <andreas.moltumyr@nordicsemi.no>
1 parent 9d7760b commit 43f3c50

3 files changed

Lines changed: 133 additions & 160 deletions

File tree

samples/bluetooth/ble_nus_central/Kconfig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

7-
menu "BLE NUS Central sample"
7+
menu "Bluetooth LE NUS central sample"
88

99
config SAMPLE_BLE_DEVICE_NAME
1010
string "Device name"
@@ -27,13 +27,13 @@ config SAMPLE_NUS_CENTRAL_UART_RX_BUF_SIZE
2727
help
2828
UART RX is double buffered, so the actual buffer will be twice as large.
2929

30+
config SAMPLE_NUS_CENTRAL_LPUARTE
31+
bool "NUS Client Low Power UARTE"
32+
3033
config SAMPLE_USE_TARGET_PERIPHERAL_NAME
3134
bool "Use target peripheral name"
3235
default y
3336

34-
config SAMPLE_NUS_CENTRAL_LPUARTE
35-
bool "NUS Client Low Power UARTE"
36-
3737
if SAMPLE_USE_TARGET_PERIPHERAL_NAME
3838

3939
config SAMPLE_TARGET_PERIPHERAL_NAME

samples/bluetooth/ble_nus_central/README.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,21 @@ In addition, the sample enables peer TX notifications to receive data from the p
4444
User interface
4545
**************
4646

47+
Button 3:
48+
Press to disconnect from the connected peer device.
49+
4750
LED 0:
48-
Lit when the device is initialized.
51+
Lit when the device is initialized.
4952

5053
LED 1:
51-
Lit when a device is connected.
52-
53-
Button 3:
54-
Disconnects from the peer when pressed.
54+
Lit when a device is connected.
5555

5656
.. note::
5757

58-
LEDs are only used in the normal UARTE configuration.
59-
In LPUARTE mode, LEDs are disabled to avoid interfering with the RX pin and to allow proper low-power operation.
58+
LEDs are only used in the normal UARTE configuration.
59+
In LPUARTE mode, LEDs are disabled to avoid interfering with the RX pin and to allow proper low-power operation.
6060

61-
In LPUARTE mode, **LED 1** may appear lit even when no device is connected for some development kits, because it shares a pin with the RX signal; RX activity can toggle the LED, which is expected behavior.
61+
In LPUARTE mode, **LED 1** may appear lit even when no device is connected for some development kits, because it shares a pin with the RX signal; RX activity can toggle the LED, which is expected behavior.
6262

6363

6464
Building and running
@@ -94,12 +94,12 @@ You can test the sample in two ways, depending on the selected UART configuratio
9494
#. Connect to the kit with a terminal emulator (for example, the `Serial Terminal app`_) for both UARTs on both development kits.
9595
#. Reset the kits.
9696
#. Observe that the device running the :ref:`ble_nus_central_sample` sample is configured to connect to ``nRF_BM_NUS``.
97-
You can configure this name using the :kconfig:option:`SAMPLE_TARGET_PERIPHERAL_NAME` Kconfig option.
97+
You can configure this name using the :kconfig:option:`CONFIG_SAMPLE_TARGET_PERIPHERAL_NAME` Kconfig option.
9898
For information on how to do this, see `Configuring Kconfig`_.
9999
#. Observe that the device running the :ref:`ble_nus_sample` sample is advertising under the default name ``nRF_BM_NUS``.
100100
You can configure this name using the :kconfig:option:`CONFIG_SAMPLE_BLE_DEVICE_NAME` Kconfig option.
101101
For information on how to do this, see `Configuring Kconfig`_.
102-
#. Observe that the text ``BLE NUS central example started.`` is printed on the COM listener connected to the device running the :ref:`ble_nus_central_sample` sample.
102+
#. Observe that the text ``BLE NUS central sample initialized`` is printed on the COM listener connected to the device running the :ref:`ble_nus_central_sample` sample.
103103
#. Observe that the text ``BLE NUS sample initialized`` is printed on the COM listener connected to the device running the :ref:`ble_nus_sample` sample.
104104
#. Write a text in the COM listener running on the computer and press Enter.
105105
#. Observe that the text is displayed in the second COM listener running on the computer.

0 commit comments

Comments
 (0)