Bluetooth: samples: Use Kconfig DEVICE_NAME variable when possible

Instead of using a hard-coded string, make the sample use the Kconfig
variable for the device name.

Change-Id: Ib09f594e1cba221f9064318572bd90d38bd2733a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2017-01-27 15:41:59 +02:00
parent 4153b6ca1f
commit eb07178236
29 changed files with 29 additions and 11 deletions

View File

@ -1,2 +1,3 @@
CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_DEBUG_LOG=y
CONFIG_BLUETOOTH_DEVICE_NAME="Test beacon"

View File

@ -2,3 +2,4 @@ CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_CUSTOM=y
CONFIG_NBLE=y
CONFIG_BLUETOOTH_DEBUG_LOG=y
CONFIG_BLUETOOTH_DEVICE_NAME="Test beacon"

View File

@ -14,7 +14,7 @@
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#define DEVICE_NAME "Test beacon"
#define DEVICE_NAME CONFIG_BLUETOOTH_DEVICE_NAME
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)
/*

View File

@ -2,3 +2,4 @@ CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_DEBUG_LOG=y
CONFIG_BLUETOOTH_PERIPHERAL=y
CONFIG_BLUETOOTH_GATT_DYNAMIC_DB=y
CONFIG_BLUETOOTH_DEVICE_NAME="Zephyr Eddystone"

View File

@ -2,3 +2,4 @@ CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_CUSTOM=y
CONFIG_NBLE=y
CONFIG_BLUETOOTH_DEBUG_LOG=y
CONFIG_BLUETOOTH_DEVICE_NAME="Zephyr Eddystone"

View File

@ -21,7 +21,7 @@
#include <bluetooth/uuid.h>
#include <bluetooth/gatt.h>
#define DEVICE_NAME "Zephyr Eddystone"
#define DEVICE_NAME CONFIG_BLUETOOTH_DEVICE_NAME
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)
#define NUMBER_OF_SLOTS 1
#define EDS_VERSION 0x00

View File

@ -22,7 +22,7 @@
#include <bluetooth/uuid.h>
#include <bluetooth/gatt.h>
#define DEVICE_NAME "Test IPSP node"
#define DEVICE_NAME CONFIG_BLUETOOTH_DEVICE_NAME
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)
#define UNKNOWN_APPEARANCE 0x0000

View File

@ -3,6 +3,7 @@ CONFIG_BLUETOOTH_DEBUG_LOG=y
CONFIG_BLUETOOTH_SMP=y
CONFIG_BLUETOOTH_PERIPHERAL=y
CONFIG_BLUETOOTH_L2CAP_DYNAMIC_CHANNEL=y
CONFIG_BLUETOOTH_DEVICE_NAME="Test IPSP node"
CONFIG_NETWORKING=y
CONFIG_NET_IPV6=y
CONFIG_NET_IPV4=n

View File

@ -6,3 +6,4 @@ CONFIG_BLUETOOTH_PERIPHERAL=y
CONFIG_BLUETOOTH_ATT_PREPARE_COUNT=2
CONFIG_BLUETOOTH_GATT_DYNAMIC_DB=y
CONFIG_BLUETOOTH_PRIVACY=y
CONFIG_BLUETOOTH_DEVICE_NAME="Test peripheral"

View File

@ -3,3 +3,4 @@ CONFIG_BLUETOOTH_CUSTOM=y
CONFIG_NBLE=y
CONFIG_BLUETOOTH_DEBUG_LOG=y
CONFIG_BLUETOOTH_ATT_PREPARE_COUNT=2
CONFIG_BLUETOOTH_DEVICE_NAME="Test peripheral"

View File

@ -26,7 +26,7 @@
#include <gatt/bas.h>
#include <gatt/cts.h>
#define DEVICE_NAME "Test peripheral"
#define DEVICE_NAME CONFIG_BLUETOOTH_DEVICE_NAME
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)
#define HEART_RATE_APPEARANCE 0x0341

View File

@ -3,3 +3,4 @@ CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_PERIPHERAL=y
CONFIG_BLUETOOTH_GATT_DYNAMIC_DB=y
CONFIG_BLUETOOTH_DEVICE_NAME="CSC peripheral"

View File

@ -4,3 +4,4 @@ CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_CUSTOM=y
CONFIG_NBLE=y
CONFIG_BLUETOOTH_DEBUG_STDOUT=y
CONFIG_BLUETOOTH_DEVICE_NAME="CSC peripheral"

View File

@ -25,7 +25,7 @@
#include <gatt/dis.h>
#include <gatt/bas.h>
#define DEVICE_NAME "CSC peripheral"
#define DEVICE_NAME CONFIG_BLUETOOTH_DEVICE_NAME
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)
#define CSC_APPEARANCE 0x0485
#define CSC_SUPPORTED_LOCATIONS { CSC_LOC_OTHER, \

View File

@ -1,3 +1,4 @@
CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_PERIPHERAL=y
CONFIG_BLUETOOTH_GATT_DYNAMIC_DB=y
CONFIG_BLUETOOTH_DEVICE_NAME="DIS peripheral"

View File

@ -23,7 +23,7 @@
#include <gatt/gap.h>
#include <gatt/dis.h>
#define DEVICE_NAME "DIS peripheral"
#define DEVICE_NAME CONFIG_BLUETOOTH_DEVICE_NAME
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)
#define APPEARANCE 0x0000

View File

@ -3,3 +3,4 @@ CONFIG_BLUETOOTH_PERIPHERAL=y
CONFIG_BLUETOOTH_GATT_DYNAMIC_DB=y
CONFIG_BLUETOOTH_SMP=y
CONFIG_TINYCRYPT=y
CONFIG_BLUETOOTH_DEVICE_NAME="ESP peripheral"

View File

@ -2,3 +2,4 @@ CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_CUSTOM=y
CONFIG_NBLE=y
CONFIG_BLUETOOTH_DEBUG_LOG=y
CONFIG_BLUETOOTH_DEVICE_NAME="ESP peripheral"

View File

@ -25,7 +25,7 @@
#include <gatt/dis.h>
#include <gatt/bas.h>
#define DEVICE_NAME "ESP peripheral"
#define DEVICE_NAME CONFIG_BLUETOOTH_DEVICE_NAME
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)
#define SENSOR_1_NAME "Temperature Sensor 1"
#define SENSOR_2_NAME "Temperature Sensor 2"

View File

@ -3,3 +3,4 @@ CONFIG_BLUETOOTH_DEBUG_LOG=y
CONFIG_BLUETOOTH_SMP=y
CONFIG_BLUETOOTH_PERIPHERAL=y
CONFIG_BLUETOOTH_GATT_DYNAMIC_DB=y
CONFIG_BLUETOOTH_DEVICE_NAME="Test HoG mouse"

View File

@ -2,3 +2,4 @@ CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_CUSTOM=y
CONFIG_NBLE=y
CONFIG_BLUETOOTH_DEBUG_LOG=y
CONFIG_BLUETOOTH_DEVICE_NAME="Test HoG mouse"

View File

@ -25,7 +25,7 @@
#include <gatt/bas.h>
#include <gatt/hog.h>
#define DEVICE_NAME "Test HoG mouse"
#define DEVICE_NAME CONFIG_BLUETOOTH_DEVICE_NAME
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)
#define HOG_APPEARANCE 0x03c2

View File

@ -3,3 +3,4 @@ CONFIG_BLUETOOTH_DEBUG_LOG=y
CONFIG_BLUETOOTH_SMP=y
CONFIG_BLUETOOTH_PERIPHERAL=y
CONFIG_BLUETOOTH_GATT_DYNAMIC_DB=y
CONFIG_BLUETOOTH_DEVICE_NAME="Zephyr Heartrate Sensor"

View File

@ -2,3 +2,4 @@ CONFIG_BLUETOOTH=y
CONFIG_BLUETOOTH_CUSTOM=y
CONFIG_NBLE=y
CONFIG_BLUETOOTH_DEBUG_LOG=y
CONFIG_BLUETOOTH_DEVICE_NAME="Zephyr Heartrate Sensor"

View File

@ -25,7 +25,7 @@
#include <gatt/dis.h>
#include <gatt/bas.h>
#define DEVICE_NAME "Zephyr Heartrate Sensor"
#define DEVICE_NAME CONFIG_BLUETOOTH_DEVICE_NAME
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)
#define HEART_RATE_APPEARANCE 0x0341

View File

@ -4,3 +4,4 @@ CONFIG_BLUETOOTH_SMP=y
CONFIG_BLUETOOTH_SMP_SC_ONLY=y
CONFIG_BLUETOOTH_TINYCRYPT_ECC=y
CONFIG_BLUETOOTH_MAX_PAIRED=2
CONFIG_BLUETOOTH_DEVICE_NAME="SC only peripheral"

View File

@ -22,7 +22,7 @@
#include <gatt/gap.h>
#define DEVICE_NAME "SC only peripheral"
#define DEVICE_NAME CONFIG_BLUETOOTH_DEVICE_NAME
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)
#define APPEARANCE 0x0000

View File

@ -6,3 +6,4 @@ CONFIG_CONSOLE_HANDLER=y
CONFIG_CONSOLE_SHELL=y
CONFIG_BLUETOOTH_DEBUG_LOG=y
CONFIG_BLUETOOTH_ATT_PREPARE_COUNT=2
CONFIG_BLUETOOTH_DEVICE_NAME="test shell"

View File

@ -34,7 +34,7 @@
#include <gatt/gap.h>
#include <gatt/hrs.h>
#define DEVICE_NAME "test shell"
#define DEVICE_NAME CONFIG_BLUETOOTH_DEVICE_NAME
#define DEVICE_NAME_LEN (sizeof(DEVICE_NAME) - 1)
#define CREDITS 10
#define DATA_MTU (23 * CREDITS)