diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2017-01-27 15:41:59 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2017-01-28 08:43:41 +0200 |
commit | eb07178236a40d51949f4e7e26ca7d9e34976ec9 (patch) | |
tree | 65c8f08adbc0872dda2cff3cc7b7fcfe17a873dd /samples | |
parent | 4153b6ca1f430cb87785a233385c9c4e9ae830ea (diff) |
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>
Diffstat (limited to 'samples')
27 files changed, 27 insertions, 10 deletions
diff --git a/samples/bluetooth/beacon/prj.conf b/samples/bluetooth/beacon/prj.conf index 86d640fbc..4421133cd 100644 --- a/samples/bluetooth/beacon/prj.conf +++ b/samples/bluetooth/beacon/prj.conf @@ -1,2 +1,3 @@ CONFIG_BLUETOOTH=y CONFIG_BLUETOOTH_DEBUG_LOG=y +CONFIG_BLUETOOTH_DEVICE_NAME="Test beacon" diff --git a/samples/bluetooth/beacon/prj_nble.conf b/samples/bluetooth/beacon/prj_nble.conf index fa1c977c6..c564ced58 100644 --- a/samples/bluetooth/beacon/prj_nble.conf +++ b/samples/bluetooth/beacon/prj_nble.conf @@ -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" diff --git a/samples/bluetooth/beacon/src/main.c b/samples/bluetooth/beacon/src/main.c index c122ad2f3..dfdd4e19c 100644 --- a/samples/bluetooth/beacon/src/main.c +++ b/samples/bluetooth/beacon/src/main.c @@ -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) /* diff --git a/samples/bluetooth/eddystone/prj.conf b/samples/bluetooth/eddystone/prj.conf index 4b7e9da2d..093dc5fe5 100644 --- a/samples/bluetooth/eddystone/prj.conf +++ b/samples/bluetooth/eddystone/prj.conf @@ -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" diff --git a/samples/bluetooth/eddystone/prj_nble.conf b/samples/bluetooth/eddystone/prj_nble.conf index fa1c977c6..a2e5c11cd 100644 --- a/samples/bluetooth/eddystone/prj_nble.conf +++ b/samples/bluetooth/eddystone/prj_nble.conf @@ -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" diff --git a/samples/bluetooth/eddystone/src/main.c b/samples/bluetooth/eddystone/src/main.c index 96d3ab7bf..de846469c 100644 --- a/samples/bluetooth/eddystone/src/main.c +++ b/samples/bluetooth/eddystone/src/main.c @@ -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 diff --git a/samples/bluetooth/gatt/ipss.c b/samples/bluetooth/gatt/ipss.c index d2460802a..9299d88da 100644 --- a/samples/bluetooth/gatt/ipss.c +++ b/samples/bluetooth/gatt/ipss.c @@ -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 diff --git a/samples/bluetooth/ipsp/prj.conf b/samples/bluetooth/ipsp/prj.conf index c69c7026a..e0ab82257 100644 --- a/samples/bluetooth/ipsp/prj.conf +++ b/samples/bluetooth/ipsp/prj.conf @@ -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 diff --git a/samples/bluetooth/peripheral/prj.conf b/samples/bluetooth/peripheral/prj.conf index cf2033f46..ccb9c82ce 100644 --- a/samples/bluetooth/peripheral/prj.conf +++ b/samples/bluetooth/peripheral/prj.conf @@ -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" diff --git a/samples/bluetooth/peripheral/prj_nble.conf b/samples/bluetooth/peripheral/prj_nble.conf index 08982e791..a1dd29d5e 100644 --- a/samples/bluetooth/peripheral/prj_nble.conf +++ b/samples/bluetooth/peripheral/prj_nble.conf @@ -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" diff --git a/samples/bluetooth/peripheral/src/main.c b/samples/bluetooth/peripheral/src/main.c index 4b1f86e75..019505b63 100644 --- a/samples/bluetooth/peripheral/src/main.c +++ b/samples/bluetooth/peripheral/src/main.c @@ -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 diff --git a/samples/bluetooth/peripheral_csc/prj.conf b/samples/bluetooth/peripheral_csc/prj.conf index 765e41525..0430a4fa5 100644 --- a/samples/bluetooth/peripheral_csc/prj.conf +++ b/samples/bluetooth/peripheral_csc/prj.conf @@ -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" diff --git a/samples/bluetooth/peripheral_csc/prj_nble.conf b/samples/bluetooth/peripheral_csc/prj_nble.conf index 33a4bce42..3459bb8df 100644 --- a/samples/bluetooth/peripheral_csc/prj_nble.conf +++ b/samples/bluetooth/peripheral_csc/prj_nble.conf @@ -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" diff --git a/samples/bluetooth/peripheral_csc/src/main.c b/samples/bluetooth/peripheral_csc/src/main.c index 35e12c5d6..45ccc6045 100644 --- a/samples/bluetooth/peripheral_csc/src/main.c +++ b/samples/bluetooth/peripheral_csc/src/main.c @@ -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, \ diff --git a/samples/bluetooth/peripheral_dis/prj.conf b/samples/bluetooth/peripheral_dis/prj.conf index a5e5b3bf5..e3eb9f372 100644 --- a/samples/bluetooth/peripheral_dis/prj.conf +++ b/samples/bluetooth/peripheral_dis/prj.conf @@ -1,3 +1,4 @@ CONFIG_BLUETOOTH=y CONFIG_BLUETOOTH_PERIPHERAL=y CONFIG_BLUETOOTH_GATT_DYNAMIC_DB=y +CONFIG_BLUETOOTH_DEVICE_NAME="DIS peripheral" diff --git a/samples/bluetooth/peripheral_dis/src/main.c b/samples/bluetooth/peripheral_dis/src/main.c index 5b6bfe95b..9cafd0621 100644 --- a/samples/bluetooth/peripheral_dis/src/main.c +++ b/samples/bluetooth/peripheral_dis/src/main.c @@ -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 diff --git a/samples/bluetooth/peripheral_esp/prj.conf b/samples/bluetooth/peripheral_esp/prj.conf index 169fb9c04..90bd669b6 100644 --- a/samples/bluetooth/peripheral_esp/prj.conf +++ b/samples/bluetooth/peripheral_esp/prj.conf @@ -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" diff --git a/samples/bluetooth/peripheral_esp/prj_nble.conf b/samples/bluetooth/peripheral_esp/prj_nble.conf index fa1c977c6..d1df4580a 100644 --- a/samples/bluetooth/peripheral_esp/prj_nble.conf +++ b/samples/bluetooth/peripheral_esp/prj_nble.conf @@ -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" diff --git a/samples/bluetooth/peripheral_esp/src/main.c b/samples/bluetooth/peripheral_esp/src/main.c index 1d52b3a34..4893182d7 100644 --- a/samples/bluetooth/peripheral_esp/src/main.c +++ b/samples/bluetooth/peripheral_esp/src/main.c @@ -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" diff --git a/samples/bluetooth/peripheral_hids/prj.conf b/samples/bluetooth/peripheral_hids/prj.conf index a0075b071..aa6f4b2ad 100644 --- a/samples/bluetooth/peripheral_hids/prj.conf +++ b/samples/bluetooth/peripheral_hids/prj.conf @@ -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" diff --git a/samples/bluetooth/peripheral_hids/prj_nble.conf b/samples/bluetooth/peripheral_hids/prj_nble.conf index fa1c977c6..7aaa8acbc 100644 --- a/samples/bluetooth/peripheral_hids/prj_nble.conf +++ b/samples/bluetooth/peripheral_hids/prj_nble.conf @@ -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" diff --git a/samples/bluetooth/peripheral_hids/src/main.c b/samples/bluetooth/peripheral_hids/src/main.c index 21955075b..015c58429 100644 --- a/samples/bluetooth/peripheral_hids/src/main.c +++ b/samples/bluetooth/peripheral_hids/src/main.c @@ -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 diff --git a/samples/bluetooth/peripheral_hr/prj.conf b/samples/bluetooth/peripheral_hr/prj.conf index a0075b071..99664fb1f 100644 --- a/samples/bluetooth/peripheral_hr/prj.conf +++ b/samples/bluetooth/peripheral_hr/prj.conf @@ -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" diff --git a/samples/bluetooth/peripheral_hr/prj_nble.conf b/samples/bluetooth/peripheral_hr/prj_nble.conf index fa1c977c6..cb30e4152 100644 --- a/samples/bluetooth/peripheral_hr/prj_nble.conf +++ b/samples/bluetooth/peripheral_hr/prj_nble.conf @@ -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" diff --git a/samples/bluetooth/peripheral_hr/src/main.c b/samples/bluetooth/peripheral_hr/src/main.c index e23744b4c..f003b2029 100644 --- a/samples/bluetooth/peripheral_hr/src/main.c +++ b/samples/bluetooth/peripheral_hr/src/main.c @@ -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 diff --git a/samples/bluetooth/peripheral_sc_only/prj.conf b/samples/bluetooth/peripheral_sc_only/prj.conf index 8e866b56e..03c24d0d2 100644 --- a/samples/bluetooth/peripheral_sc_only/prj.conf +++ b/samples/bluetooth/peripheral_sc_only/prj.conf @@ -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" diff --git a/samples/bluetooth/peripheral_sc_only/src/main.c b/samples/bluetooth/peripheral_sc_only/src/main.c index 0e7c250d8..f1e172a53 100644 --- a/samples/bluetooth/peripheral_sc_only/src/main.c +++ b/samples/bluetooth/peripheral_sc_only/src/main.c @@ -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 |