Skip to content

Commit

Permalink
Bluetooth: Remove _gatt_ infix for Device Information Service (DIS)
Browse files Browse the repository at this point in the history
The _gatt_ infix was determined to be unnecessary as
GATT is implied by it being a Bluetooth service.

Signed-off-by: Emil Gydesen <[email protected]>
  • Loading branch information
Thalley authored and carlescufi committed Sep 4, 2020
1 parent 8d7b5eb commit 9c5db74
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 117 deletions.
2 changes: 1 addition & 1 deletion samples/bluetooth/peripheral/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_SMP=y
CONFIG_BT_SIGNING=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_GATT_DIS=y
CONFIG_BT_DIS=y
CONFIG_BT_ATT_PREPARE_COUNT=5
CONFIG_BT_BAS=y
CONFIG_BT_HRS=y
Expand Down
4 changes: 2 additions & 2 deletions samples/bluetooth/peripheral_csc/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ CONFIG_ENTROPY_GENERATOR=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_GATT_DIS=y
CONFIG_BT_GATT_DIS_PNP=n
CONFIG_BT_DIS=y
CONFIG_BT_DIS_PNP=n
CONFIG_BT_BAS=y
CONFIG_BT_DEVICE_NAME="CSC peripheral"
CONFIG_BT_DEVICE_APPEARANCE=1157
28 changes: 14 additions & 14 deletions samples/bluetooth/peripheral_dis/prj.conf
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y

CONFIG_BT_GATT_DIS=y
CONFIG_BT_GATT_DIS_PNP=n
CONFIG_BT_GATT_DIS_MODEL="Zephyr Model"
CONFIG_BT_GATT_DIS_MANUF="Zephyr"
CONFIG_BT_GATT_DIS_SERIAL_NUMBER=y
CONFIG_BT_GATT_DIS_FW_REV=y
CONFIG_BT_GATT_DIS_HW_REV=y
CONFIG_BT_GATT_DIS_SW_REV=y
CONFIG_BT_GATT_DIS_SERIAL_NUMBER_STR="Zephyr Serial"
CONFIG_BT_GATT_DIS_FW_REV_STR="Zephyr Firmware"
CONFIG_BT_GATT_DIS_HW_REV_STR="Zephyr Hardware"
CONFIG_BT_GATT_DIS_SW_REV_STR="Zephyr Software"
CONFIG_BT_DIS=y
CONFIG_BT_DIS_PNP=n
CONFIG_BT_DIS_MODEL="Zephyr Model"
CONFIG_BT_DIS_MANUF="Zephyr"
CONFIG_BT_DIS_SERIAL_NUMBER=y
CONFIG_BT_DIS_FW_REV=y
CONFIG_BT_DIS_HW_REV=y
CONFIG_BT_DIS_SW_REV=y
CONFIG_BT_DIS_SERIAL_NUMBER_STR="Zephyr Serial"
CONFIG_BT_DIS_FW_REV_STR="Zephyr Firmware"
CONFIG_BT_DIS_HW_REV_STR="Zephyr Hardware"
CONFIG_BT_DIS_SW_REV_STR="Zephyr Software"

CONFIG_BT_DEVICE_NAME="DIS peripheral"

Expand All @@ -22,5 +22,5 @@ CONFIG_SETTINGS_RUNTIME=y
CONFIG_SETTINGS=y
CONFIG_SETTINGS_NONE=y

CONFIG_BT_GATT_DIS_SETTINGS=y
CONFIG_BT_GATT_DIS_STR_MAX=21
CONFIG_BT_DIS_SETTINGS=y
CONFIG_BT_DIS_STR_MAX=21
26 changes: 13 additions & 13 deletions samples/bluetooth/peripheral_dis/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,32 +47,32 @@ static struct bt_conn_cb conn_callbacks = {

static int settings_runtime_load(void)
{
#if defined(CONFIG_BT_GATT_DIS_SETTINGS)
#if defined(CONFIG_BT_DIS_SETTINGS)
settings_runtime_set("bt/dis/model",
"Zephyr Model",
sizeof("Zephyr Model"));
settings_runtime_set("bt/dis/manuf",
"Zephyr Manufacturer",
sizeof("Zephyr Manufacturer"));
#if defined(CONFIG_BT_GATT_DIS_SERIAL_NUMBER)
#if defined(CONFIG_BT_DIS_SERIAL_NUMBER)
settings_runtime_set("bt/dis/serial",
CONFIG_BT_GATT_DIS_SERIAL_NUMBER_STR,
sizeof(CONFIG_BT_GATT_DIS_SERIAL_NUMBER_STR));
CONFIG_BT_DIS_SERIAL_NUMBER_STR,
sizeof(CONFIG_BT_DIS_SERIAL_NUMBER_STR));
#endif
#if defined(CONFIG_BT_GATT_DIS_SW_REV)
#if defined(CONFIG_BT_DIS_SW_REV)
settings_runtime_set("bt/dis/sw",
CONFIG_BT_GATT_DIS_SW_REV_STR,
sizeof(CONFIG_BT_GATT_DIS_SW_REV_STR));
CONFIG_BT_DIS_SW_REV_STR,
sizeof(CONFIG_BT_DIS_SW_REV_STR));
#endif
#if defined(CONFIG_BT_GATT_DIS_FW_REV)
#if defined(CONFIG_BT_DIS_FW_REV)
settings_runtime_set("bt/dis/fw",
CONFIG_BT_GATT_DIS_FW_REV_STR,
sizeof(CONFIG_BT_GATT_DIS_FW_REV_STR));
CONFIG_BT_DIS_FW_REV_STR,
sizeof(CONFIG_BT_DIS_FW_REV_STR));
#endif
#if defined(CONFIG_BT_GATT_DIS_HW_REV)
#if defined(CONFIG_BT_DIS_HW_REV)
settings_runtime_set("bt/dis/hw",
CONFIG_BT_GATT_DIS_HW_REV_STR,
sizeof(CONFIG_BT_GATT_DIS_HW_REV_STR));
CONFIG_BT_DIS_HW_REV_STR,
sizeof(CONFIG_BT_DIS_HW_REV_STR));
#endif
#endif
return 0;
Expand Down
4 changes: 2 additions & 2 deletions samples/bluetooth/peripheral_esp/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CONFIG_BT_PERIPHERAL=y
CONFIG_BT_SMP=y
CONFIG_TINYCRYPT=y
CONFIG_BT_DEVICE_NAME="ESP peripheral"
CONFIG_BT_GATT_DIS=y
CONFIG_BT_GATT_DIS_PNP=n
CONFIG_BT_DIS=y
CONFIG_BT_DIS_PNP=n
CONFIG_BT_BAS=y
CONFIG_BT_DEVICE_APPEARANCE=768
2 changes: 1 addition & 1 deletion samples/bluetooth/peripheral_hids/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CONFIG_BT=y
CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_SMP=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_GATT_DIS=y
CONFIG_BT_DIS=y
CONFIG_BT_BAS=y
CONFIG_BT_DEVICE_NAME="Test HoG mouse"
CONFIG_BT_DEVICE_APPEARANCE=962
Expand Down
4 changes: 2 additions & 2 deletions samples/bluetooth/peripheral_hr/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ CONFIG_BT=y
CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_SMP=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_GATT_DIS=y
CONFIG_BT_GATT_DIS_PNP=n
CONFIG_BT_DIS=y
CONFIG_BT_DIS_PNP=n
CONFIG_BT_BAS=y
CONFIG_BT_HRS=y
CONFIG_BT_DEVICE_NAME="Zephyr Heartrate Sensor"
Expand Down
4 changes: 2 additions & 2 deletions samples/bluetooth/peripheral_ht/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ CONFIG_BT=y
CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_SMP=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_GATT_DIS=y
CONFIG_BT_GATT_DIS_PNP=n
CONFIG_BT_DIS=y
CONFIG_BT_DIS_PNP=n
CONFIG_BT_BAS=y
CONFIG_BT_DEVICE_NAME="Zephyr Health Thermometer"
CONFIG_BT_DEVICE_APPEARANCE=768
Expand Down
2 changes: 1 addition & 1 deletion subsys/bluetooth/services/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: Apache-2.0


zephyr_sources_ifdef(CONFIG_BT_GATT_DIS dis.c)
zephyr_sources_ifdef(CONFIG_BT_DIS dis.c)

zephyr_sources_ifdef(CONFIG_BT_BAS bas.c)

Expand Down
54 changes: 27 additions & 27 deletions subsys/bluetooth/services/Kconfig.dis
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,46 @@
# Copyright (c) 2018 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

menuconfig BT_GATT_DIS
menuconfig BT_DIS
bool "Enable GATT Device Information service"

if BT_GATT_DIS
if BT_DIS

config BT_GATT_DIS_SETTINGS
config BT_DIS_SETTINGS
bool "Enable Settings usage in Device Information Service"
help
Enable Settings usage in Device Information Service.

config BT_GATT_DIS_STR_MAX
config BT_DIS_STR_MAX
int "Maximum size in bytes for DIS strings"
depends on BT_GATT_DIS_SETTINGS
depends on BT_DIS_SETTINGS
default 21
range 2 248
help
Bluetooth DIS string storage size. Storage can be up to 248 bytes
long (excluding NULL termination).

config BT_GATT_DIS_MODEL
config BT_DIS_MODEL
string "Model name"
default SOC
help
The device model inside Device Information Service.

config BT_GATT_DIS_MANUF
config BT_DIS_MANUF
string "Manufacturer name"
default "Manufacturer"
help
The device manufacturer inside Device Information Service.

config BT_GATT_DIS_PNP
config BT_DIS_PNP
bool "Enable PnP_ID characteristic"
default y
help
Enable PnP_ID characteristic in Device Information Service.

if BT_GATT_DIS_PNP
if BT_DIS_PNP

config BT_GATT_DIS_PNP_VID_SRC
config BT_DIS_PNP_VID_SRC
int "Vendor ID source"
range 1 2
default 1
Expand All @@ -53,7 +53,7 @@ config BT_GATT_DIS_PNP_VID_SRC
- 1 Bluetooth SIG, the Vendor ID was assigned by the Bluetooth SIG
- 2 USB IF, the Vendor ID was assigned by the USB IF

config BT_GATT_DIS_PNP_VID
config BT_DIS_PNP_VID
hex "Vendor ID"
range 0 0xFFFF
default 0
Expand All @@ -67,7 +67,7 @@ config BT_GATT_DIS_PNP_VID
Device providers should procure the Vendor ID from the USB Implementers
Forum or the Company Identifier from the Bluetooth SIG.

config BT_GATT_DIS_PNP_PID
config BT_DIS_PNP_PID
hex "Product ID"
range 0 0xFFFF
default 0
Expand All @@ -76,7 +76,7 @@ config BT_GATT_DIS_PNP_PID
made by the vendor identified with the Vendor ID field. The vendors
themselves manage Product ID field values.

config BT_GATT_DIS_PNP_VER
config BT_DIS_PNP_VER
hex "Product Version"
range 0 0xFFFF
default 1
Expand All @@ -95,50 +95,50 @@ config BT_GATT_DIS_PNP_VER
made to the device, it is recommended that the major version number be
incremented. The sub-minor version is incremented for bug fixes.

endif # BT_GATT_DIS_PNP
endif # BT_DIS_PNP

config BT_GATT_DIS_SERIAL_NUMBER
config BT_DIS_SERIAL_NUMBER
bool "Enable DIS Serial number characteristic"
help
Enable Serial Number characteristic in Device Information Service.

config BT_GATT_DIS_SERIAL_NUMBER_STR
config BT_DIS_SERIAL_NUMBER_STR
string "Serial Number"
depends on BT_GATT_DIS_SERIAL_NUMBER
depends on BT_DIS_SERIAL_NUMBER
help
Enable Serial Number characteristic in Device Information Service.

config BT_GATT_DIS_FW_REV
config BT_DIS_FW_REV
bool "Enable DIS Firmware Revision characteristic"
help
Enable Firmware Revision characteristic in Device Information Service.

config BT_GATT_DIS_FW_REV_STR
config BT_DIS_FW_REV_STR
string "Firmware revision"
depends on BT_GATT_DIS_FW_REV
depends on BT_DIS_FW_REV
help
Enable firmware revision characteristic in Device Information Service.

config BT_GATT_DIS_HW_REV
config BT_DIS_HW_REV
bool "Enable DIS Hardware Revision characteristic"
help
Enable Hardware Revision characteristic in Device Information Service.

config BT_GATT_DIS_HW_REV_STR
config BT_DIS_HW_REV_STR
string "Hardware revision"
depends on BT_GATT_DIS_HW_REV
depends on BT_DIS_HW_REV
help
Enable hardware revision characteristic in Device Information Service.

config BT_GATT_DIS_SW_REV
config BT_DIS_SW_REV
bool "Enable DIS Software Revision characteristic"
help
Enable Software Revision characteristic in Device Information Service.

config BT_GATT_DIS_SW_REV_STR
config BT_DIS_SW_REV_STR
string "Software revision"
depends on BT_GATT_DIS_SW_REV
depends on BT_DIS_SW_REV
help
Enable software revision characteristic in Device Information Service.

endif # BT_GATT_DIS
endif # BT_DIS
Loading

0 comments on commit 9c5db74

Please sign in to comment.