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:
parent
4153b6ca1f
commit
eb07178236
@ -1,2 +1,3 @@
|
||||
CONFIG_BLUETOOTH=y
|
||||
CONFIG_BLUETOOTH_DEBUG_LOG=y
|
||||
CONFIG_BLUETOOTH_DEVICE_NAME="Test beacon"
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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)
|
||||
|
||||
/*
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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, \
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
CONFIG_BLUETOOTH=y
|
||||
CONFIG_BLUETOOTH_PERIPHERAL=y
|
||||
CONFIG_BLUETOOTH_GATT_DYNAMIC_DB=y
|
||||
CONFIG_BLUETOOTH_DEVICE_NAME="DIS peripheral"
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user