Skip to content

Commit a26aa40

Browse files
leewkb4567rlubos
authored andcommitted
samples: bluetooth: ancs_client: Change Bluetooth device name
Following the convention of other Bluetooth samples, change Bluetooth device name of ANCS sample to 'Nordic_ANCS'. Signed-off-by: Bernard Lee <[email protected]>
1 parent 4ff2375 commit a26aa40

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

samples/bluetooth/peripheral_ancs_client/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Testing with Bluetooth Low Energy app
126126
Click the dongle configuration and select :guilabel:`Security parameters`.
127127
Check :guilabel:`Perform Bonding` and :guilabel:`Enable LE Secure Connection pairing`, and click :guilabel:`Apply`.
128128
#. Connect to the device from the app.
129-
The device is advertising as "ANCS".
129+
The device is advertising as "Nordic_ANCS".
130130
#. Wait until the bond is established. Verify that the UART data is received as follows::
131131

132132
Connected xx:xx:xx:xx:xx:xx (random)

samples/bluetooth/peripheral_ancs_client/prj.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
99

1010
CONFIG_BT=y
1111
CONFIG_BT_PERIPHERAL=y
12-
CONFIG_BT_DEVICE_NAME="ANCS"
12+
CONFIG_BT_DEVICE_NAME="Nordic_ANCS"
1313
CONFIG_BT_SMP=y
1414
CONFIG_BT_GATT_CLIENT=y
1515
CONFIG_BT_GATT_DM=y

samples/bluetooth/peripheral_ancs_client/src/main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ enum {
4545
static const struct bt_data ad[] = {
4646
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_LIMITED | BT_LE_AD_NO_BREDR)),
4747
BT_DATA_BYTES(BT_DATA_SOLICIT128, BT_UUID_ANCS_VAL),
48+
};
49+
50+
static const struct bt_data sd[] = {
4851
BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN),
4952
};
5053

@@ -321,7 +324,7 @@ static void discover_ancs_again(struct bt_conn *conn)
321324

322325
static void adv_work_handler(struct k_work *work)
323326
{
324-
int err = bt_le_adv_start(BT_LE_ADV_CONN_FAST_2, ad, ARRAY_SIZE(ad), NULL, 0);
327+
int err = bt_le_adv_start(BT_LE_ADV_CONN_FAST_2, ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd));
325328

326329
if (err) {
327330
printk("Advertising failed to start (err %d)\n", err);

0 commit comments

Comments
 (0)