Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions doc/releases/release-notes-4.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,15 @@ Deprecated APIs and options
* ``xiao_esp32c6`` board target has been deprecated and renamed to
``xiao_esp32c6/esp32c6/hpcore``.

* The :c:func:`bt_get_name` and :c:func:`bt_set_name` are deprecated in favor of
the new :c:func:`bt_gap_get_device_name` and :c:func:`bt_gap_set_device_name`.
:kconfig:option:`CONFIG_BT_DEVICE_NAME`,
:kconfig:option:`CONFIG_BT_DEVICE_NAME_DYNAMIC` and
:kconfig:option:`CONFIG_BT_DEVICE_NAME_MAX` are deprecated in favor of
:kconfig:option:`CONFIG_BT_GAP_DEVICE_NAME`,
:kconfig:option:`CONFIG_BT_GAP_DEVICE_NAME_DYNAMIC` and
:kconfig:option:`CONFIG_BT_GAP_DEVICE_NAME_DYNAMIC_MAX`.

New APIs and options
====================

Expand Down Expand Up @@ -144,6 +153,8 @@ New APIs and options
:c:func:`bt_br_unpair`.
* Remove query of the classic bonding information from :c:func:`bt_foreach_bond`, and add
:c:func:`bt_br_foreach_bond`.
* :c:func:`bt_gap_get_device_name`
* :c:func:`bt_gap_set_device_name`

* Display

Expand Down
4 changes: 2 additions & 2 deletions include/zephyr/bluetooth/bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ bool bt_is_ready(void);
*
* @return Zero on success or (negative) error code otherwise.
*/
int bt_set_name(const char *name);
__deprecated int bt_set_name(const char *name);

/**
* @brief Get Bluetooth Device Name
Expand All @@ -368,7 +368,7 @@ int bt_set_name(const char *name);
*
* @return Bluetooth Device Name
*/
const char *bt_get_name(void);
__deprecated const char *bt_get_name(void);

/**
* @brief Get local Bluetooth appearance
Expand Down
61 changes: 61 additions & 0 deletions include/zephyr/bluetooth/gap/device_name.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef ZEPHYR_INCLUDE_BLUETOOTH_GAP_DEVICE_NAME_H_
#define ZEPHYR_INCLUDE_BLUETOOTH_GAP_DEVICE_NAME_H_

#include <stddef.h>
#include <stdint.h>

/**
* @brief Maximum size of a Bluetooth GAP Device Name according to Bluetooth
* specification. See Core Specification vol. 3, part C, 12.1.
*
* @note It is recommended to use that value when reading the Bluetooth GAP
* Device Name from a peer.
*/
#define BT_GAP_DEVICE_NAME_MAX_SIZE 248

/**
* @brief Copy over Bluetooth GAP Device Name
*
* @note If buf is equal to NULL, the function will do nothing but return the
* size of the current Bluetooth GAP Device Name.
*
* @param buf Buffer where the Bluetooth GAP Device Name will be copied
* @param size Size of @p buf
*
* @retval >=0 Size of the GAP Device Name
* @retval -ENOMEM Device name is bigger than @p buf and thus cannot be copied
* in it
*/
int bt_gap_get_device_name(uint8_t *buf, size_t size);

/**
* @brief Set the Bluetooth GAP Device Name
*
* If the Bluetooth settings are enabled (@kconfig{CONFIG_BT_SETTINGS}) and the
* storing the name fail, no update will be made. The previous name will be
* kept.
*
* @note If the dynamic Bluetooth GAP Device Name
* (@kconfig{CONFIG_BT_GAP_DEVICE_NAME_DYNAMIC}) is not enabled, the function
* will do nothing an always return 0.
*
* @warning This API is considered thread safe only if no other APIs tries to
* write to the settings key used to store the GAP Device Name.
*
* @param buf Buffer containing the new Bluetooth GAP device name
* @param size Size of @p buf
*
* @retval 0 Success
* @retval -ENOBUFS @p size is bigger than the maximum allowed size
* @retval -EIO Error while trying to save the device name to the settings
* backend
*/
int bt_gap_set_device_name(const uint8_t *buf, size_t size);

#endif /* ZEPHYR_INCLUDE_BLUETOOTH_GAP_DEVICE_NAME_H_ */
2 changes: 1 addition & 1 deletion samples/bluetooth/bap_broadcast_sink/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This sample can be found under
Check the :zephyr:code-sample-category:`bluetooth` samples for general information.

Use :kconfig:option:`CONFIG_TARGET_BROADCAST_NAME` Kconfig to specify the name
(:kconfig:option:`CONFIG_BT_DEVICE_NAME`) of a broadcast source to listen to. With default value
(:kconfig:option:`CONFIG_BT_GAP_DEVICE_NAME`) of a broadcast source to listen to. With default value
(empty string), sink device will listen to all available broadcast sources.

Requirements
Expand Down
2 changes: 1 addition & 1 deletion samples/bluetooth/bap_broadcast_sink/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ CONFIG_BT_AUDIO_CODEC_CFG_MAX_DATA_SIZE=64
CONFIG_BT_AUDIO_CODEC_CAP_MAX_METADATA_SIZE=64
CONFIG_BT_AUDIO_CODEC_CAP_MAX_DATA_SIZE=64

CONFIG_BT_DEVICE_NAME="Broadcast Audio Sink"
CONFIG_BT_GAP_DEVICE_NAME="Broadcast Audio Sink"
4 changes: 2 additions & 2 deletions samples/bluetooth/bap_broadcast_sink/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -958,8 +958,8 @@ static int start_adv(void)
BT_UUID_16_ENCODE(BT_UUID_BASS_VAL),
BT_UUID_16_ENCODE(BT_UUID_PACS_VAL)),
BT_DATA_BYTES(BT_DATA_SVC_DATA16, BT_UUID_16_ENCODE(BT_UUID_BASS_VAL)),
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME,
sizeof(CONFIG_BT_DEVICE_NAME) - 1),
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_GAP_DEVICE_NAME,
sizeof(CONFIG_BT_GAP_DEVICE_NAME) - 1),
};
int err;

Expand Down
2 changes: 1 addition & 1 deletion samples/bluetooth/bap_broadcast_source/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ CONFIG_BT_BAP_BROADCAST_SRC_SUBGROUP_COUNT=1
CONFIG_BT_ISO_TX_BUF_COUNT=6
CONFIG_BT_ISO_TX_MTU=60

CONFIG_BT_DEVICE_NAME="Broadcast Audio Source"
CONFIG_BT_GAP_DEVICE_NAME="Broadcast Audio Source"
CONFIG_BROADCAST_ID=0x123456
7 changes: 4 additions & 3 deletions samples/bluetooth/bap_broadcast_source/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,9 +600,10 @@ int main(void)
ext_ad[0].type = BT_DATA_SVC_DATA16;
ext_ad[0].data_len = ad_buf.len;
ext_ad[0].data = ad_buf.data;
ext_ad[1] = (struct bt_data)BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME,
sizeof(CONFIG_BT_DEVICE_NAME) - 1);
err = bt_le_ext_adv_set_data(adv, ext_ad, 2, NULL, 0);
ext_ad[1] = (struct bt_data)BT_DATA(
BT_DATA_NAME_COMPLETE, CONFIG_BT_GAP_DEVICE_NAME,
sizeof(CONFIG_BT_GAP_DEVICE_NAME) - 1);
err = bt_le_ext_adv_set_data(adv, ext_ad, 2, NULL, 0);
if (err != 0) {
printk("Failed to set extended advertising data: %d\n", err);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion samples/bluetooth/bap_unicast_server/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ CONFIG_BT_AUDIO_CODEC_CFG_MAX_METADATA_SIZE=10
CONFIG_BT_ATT_PREPARE_COUNT=1

CONFIG_BT_EXT_ADV=y
CONFIG_BT_DEVICE_NAME="Unicast Audio Server"
CONFIG_BT_GAP_DEVICE_NAME="Unicast Audio Server"
10 changes: 6 additions & 4 deletions samples/bluetooth/bap_unicast_server/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ static uint8_t unicast_server_addata[] = {

/* TODO: Expand with BAP data */
static const struct bt_data ad[] = {
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
BT_DATA_BYTES(BT_DATA_UUID16_ALL, BT_UUID_16_ENCODE(BT_UUID_ASCS_VAL)),
BT_DATA(BT_DATA_SVC_DATA16, unicast_server_addata, ARRAY_SIZE(unicast_server_addata)),
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1),
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
BT_DATA_BYTES(BT_DATA_UUID16_ALL, BT_UUID_16_ENCODE(BT_UUID_ASCS_VAL)),
BT_DATA(BT_DATA_SVC_DATA16, unicast_server_addata,
ARRAY_SIZE(unicast_server_addata)),
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_GAP_DEVICE_NAME,
sizeof(CONFIG_BT_GAP_DEVICE_NAME) - 1),
};

#define AUDIO_DATA_TIMEOUT_US 1000000UL /* Send data every 1 second */
Expand Down
2 changes: 1 addition & 1 deletion samples/bluetooth/beacon/prj-coex.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CONFIG_BT=y
CONFIG_LOG=y
CONFIG_BT_DEVICE_NAME="Test beacon"
CONFIG_BT_GAP_DEVICE_NAME="Test beacon"

CONFIG_BT_LL_SW_SPLIT=y
CONFIG_BT_CTLR_COEX_TICKER=y
2 changes: 1 addition & 1 deletion samples/bluetooth/beacon/prj.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CONFIG_BT=y
CONFIG_LOG=y
CONFIG_BT_DEVICE_NAME="Test beacon"
CONFIG_BT_GAP_DEVICE_NAME="Test beacon"
2 changes: 1 addition & 1 deletion samples/bluetooth/beacon/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/hci.h>

#define DEVICE_NAME CONFIG_BT_DEVICE_NAME
#define DEVICE_NAME CONFIG_BT_GAP_DEVICE_NAME
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)

/*
Expand Down
2 changes: 1 addition & 1 deletion samples/bluetooth/broadcaster_multiple/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CONFIG_BT=y
CONFIG_BT_BROADCASTER=y
CONFIG_BT_EXT_ADV=y
CONFIG_BT_EXT_ADV_MAX_ADV_SET=2
CONFIG_BT_DEVICE_NAME="Broadcaster Multiple"
CONFIG_BT_GAP_DEVICE_NAME="Broadcaster Multiple"

CONFIG_LOG=y

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define BT_AD_DATA_FORMAT_LEN_MAX 255U

/* Device name length, size minus one null character */
#define BT_DEVICE_NAME_LEN (sizeof(CONFIG_BT_DEVICE_NAME) - 1U)
#define BT_DEVICE_NAME_LEN (sizeof(CONFIG_BT_GAP_DEVICE_NAME) - 1U)

/* Device name length in AD data format, 2 bytes for length and type overhead */
#define BT_DEVICE_NAME_AD_DATA_LEN (BT_AD_DATA_FORMAT_LEN_SIZE + \
Expand Down Expand Up @@ -55,11 +55,12 @@
static uint8_t mfg_data[BT_MFG_DATA_LEN] = { 0xFF, 0xFF, };

static const struct bt_data ad[] = {
BT_DATA(BT_DATA_MANUFACTURER_DATA, mfg_data, sizeof(mfg_data)),
BT_DATA(BT_DATA_MANUFACTURER_DATA, mfg_data, sizeof(mfg_data)),
#if CONFIG_BT_CTLR_ADV_DATA_LEN_MAX > 255
BT_DATA(BT_DATA_MANUFACTURER_DATA, mfg_data, sizeof(mfg_data)),
BT_DATA(BT_DATA_MANUFACTURER_DATA, mfg_data, sizeof(mfg_data)),
#endif
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1),
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_GAP_DEVICE_NAME,
sizeof(CONFIG_BT_GAP_DEVICE_NAME) - 1),
};

static struct bt_le_ext_adv *adv[CONFIG_BT_EXT_ADV_MAX_ADV_SET];
Expand Down
2 changes: 1 addition & 1 deletion samples/bluetooth/bthome_sensor_template/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
#
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME="BTHome template"
CONFIG_BT_GAP_DEVICE_NAME="BTHome template"
8 changes: 4 additions & 4 deletions samples/bluetooth/bthome_sensor_template/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ static uint8_t service_data[SERVICE_DATA_LEN] = {
};

static struct bt_data ad[] = {
BT_DATA_BYTES(BT_DATA_FLAGS, BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR),
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1),
BT_DATA(BT_DATA_SVC_DATA16, service_data, ARRAY_SIZE(service_data))
};
BT_DATA_BYTES(BT_DATA_FLAGS, BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR),
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_GAP_DEVICE_NAME,
sizeof(CONFIG_BT_GAP_DEVICE_NAME) - 1),
BT_DATA(BT_DATA_SVC_DATA16, service_data, ARRAY_SIZE(service_data))};

static void bt_ready(int err)
{
Expand Down
2 changes: 1 addition & 1 deletion samples/bluetooth/cap_acceptor/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=400
CONFIG_BT_GATT_DYNAMIC_DB=y
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_EXT_ADV=y
CONFIG_BT_DEVICE_NAME="CAP Acceptor"
CONFIG_BT_GAP_DEVICE_NAME="CAP Acceptor"
CONFIG_BT_AUDIO=y
CONFIG_BT_SMP=y
CONFIG_BT_KEYS_OVERWRITE_OLDEST=y
Expand Down
3 changes: 2 additions & 1 deletion samples/bluetooth/cap_acceptor/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ LOG_MODULE_REGISTER(cap_acceptor, LOG_LEVEL_INF);

static const struct bt_data ad[] = {
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1),
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_GAP_DEVICE_NAME,
sizeof(CONFIG_BT_GAP_DEVICE_NAME) - 1),
BT_DATA_BYTES(BT_DATA_UUID16_SOME,
BT_UUID_16_ENCODE(BT_UUID_ASCS_VAL),
BT_UUID_16_ENCODE(BT_UUID_CAS_VAL)),
Expand Down
2 changes: 1 addition & 1 deletion samples/bluetooth/cap_initiator/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CONFIG_BT=y
CONFIG_BT_SMP=y
CONFIG_BT_AUDIO=y
CONFIG_BT_EXT_ADV=y
CONFIG_BT_DEVICE_NAME="CAP Initiator"
CONFIG_BT_GAP_DEVICE_NAME="CAP Initiator"

# CAP support
CONFIG_BT_CAP_INITIATOR=y
Expand Down
2 changes: 1 addition & 1 deletion samples/bluetooth/ccp_call_control_client/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_GATT_AUTO_DISCOVER_CCC=y
CONFIG_BT_AUDIO=y
CONFIG_BT_EXT_ADV=y
CONFIG_BT_DEVICE_NAME="CCP Call Control Client"
CONFIG_BT_GAP_DEVICE_NAME="CCP Call Control Client"

CONFIG_BT_SMP=y
CONFIG_BT_KEYS_OVERWRITE_OLDEST=y
Expand Down
2 changes: 1 addition & 1 deletion samples/bluetooth/ccp_call_control_server/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CONFIG_BT_AUDIO=y
CONFIG_BT_EXT_ADV=y
CONFIG_BT_SMP=y
CONFIG_BT_GATT_DYNAMIC_DB=y
CONFIG_BT_DEVICE_NAME="CCP Call Control Server"
CONFIG_BT_GAP_DEVICE_NAME="CCP Call Control Server"

CONFIG_BT_SMP=y
CONFIG_BT_KEYS_OVERWRITE_OLDEST=y
Expand Down
3 changes: 2 additions & 1 deletion samples/bluetooth/ccp_call_control_server/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ LOG_MODULE_REGISTER(ccp_call_control_server, CONFIG_LOG_DEFAULT_LEVEL);
#define SEM_TIMEOUT K_SECONDS(5)

static const struct bt_data ad[] = {
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1),
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_GAP_DEVICE_NAME,
sizeof(CONFIG_BT_GAP_DEVICE_NAME) - 1),
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
BT_DATA_BYTES(BT_DATA_UUID16_SOME, BT_UUID_16_ENCODE(BT_UUID_GTBS_VAL)),
BT_DATA_BYTES(BT_DATA_SVC_DATA16, BT_UUID_16_ENCODE(BT_UUID_GTBS_VAL)),
Expand Down
2 changes: 1 addition & 1 deletion samples/bluetooth/central_past/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ CONFIG_BT_CENTRAL=y
CONFIG_BT_EXT_ADV=y
CONFIG_BT_PER_ADV_SYNC=y
CONFIG_LOG=y
CONFIG_BT_DEVICE_NAME="Test Central Periodic Advertising Sync Transfer"
CONFIG_BT_GAP_DEVICE_NAME="Test Central Periodic Advertising Sync Transfer"
CONFIG_BT_PER_ADV_SYNC_TRANSFER_SENDER=y
2 changes: 1 addition & 1 deletion samples/bluetooth/direct_adv/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DIS=y
CONFIG_BT_ATT_PREPARE_COUNT=1
CONFIG_BT_PRIVACY=y
CONFIG_BT_DEVICE_NAME="Direct Adv"
CONFIG_BT_GAP_DEVICE_NAME="Direct Adv"
CONFIG_BT_DEVICE_APPEARANCE=833

CONFIG_BT_KEYS_OVERWRITE_OLDEST=y
Expand Down
3 changes: 2 additions & 1 deletion samples/bluetooth/direct_adv/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ BT_GATT_SERVICE_DEFINE(primary_service,
static const struct bt_data ad[] = {
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
BT_DATA_BYTES(BT_DATA_UUID128_ALL, BT_UUID_CUSTOM_SERVICE_VAL),
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1),
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_GAP_DEVICE_NAME,
sizeof(CONFIG_BT_GAP_DEVICE_NAME) - 1),
};

static void connected(struct bt_conn *conn, uint8_t err)
Expand Down
2 changes: 1 addition & 1 deletion samples/bluetooth/direction_finding_central/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

CONFIG_BT=y
CONFIG_LOG=y
CONFIG_BT_DEVICE_NAME="Direction Finding Central"
CONFIG_BT_GAP_DEVICE_NAME="Direction Finding Central"

CONFIG_BT_CENTRAL=y
CONFIG_BT_SMP=y
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CONFIG_BT=y
CONFIG_BT_DEVICE_NAME="DF Connectionless Locator App"
CONFIG_BT_GAP_DEVICE_NAME="DF Connectionless Locator App"

CONFIG_BT_EXT_ADV=y
CONFIG_BT_PER_ADV_SYNC=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <zephyr/bluetooth/hci.h>
#include <zephyr/bluetooth/hci_vs.h>

#define DEVICE_NAME CONFIG_BT_DEVICE_NAME
#define DEVICE_NAME CONFIG_BT_GAP_DEVICE_NAME
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)
#define NAME_LEN 30
#define PEER_NAME_LEN_MAX 30
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CONFIG_BT=y
CONFIG_BT_DEVICE_NAME="DF Connectionless Beacon App"
CONFIG_BT_GAP_DEVICE_NAME="DF Connectionless Beacon App"

CONFIG_BT_EXT_ADV=y
CONFIG_BT_PER_ADV=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ struct bt_df_adv_cte_tx_param cte_params = { .cte_len = CTE_LEN,
};

static const struct bt_data ad[] = {
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1),
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_GAP_DEVICE_NAME,
sizeof(CONFIG_BT_GAP_DEVICE_NAME) - 1),
};

static void adv_sent_cb(struct bt_le_ext_adv *adv,
Expand Down
2 changes: 1 addition & 1 deletion samples/bluetooth/direction_finding_peripheral/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

CONFIG_BT=y
CONFIG_LOG=y
CONFIG_BT_DEVICE_NAME="DF Conn App"
CONFIG_BT_GAP_DEVICE_NAME="DF Conn App"
CONFIG_BT_SMP=y

CONFIG_BT_PERIPHERAL=y
Expand Down
3 changes: 2 additions & 1 deletion samples/bluetooth/direction_finding_peripheral/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
static const struct bt_data ad[] = {
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
BT_DATA_BYTES(BT_DATA_LE_SUPPORTED_FEATURES, BT_LE_SUPP_FEAT_24_ENCODE(DF_FEAT_ENABLED)),
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1),
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_GAP_DEVICE_NAME,
sizeof(CONFIG_BT_GAP_DEVICE_NAME) - 1),
};

/* Latency set to zero, to enforce PDU exchange every connection event */
Expand Down
Loading
Loading