diff --git a/include/bluetooth/services/hrs.h b/include/bluetooth/services/hrs.h index 1d547707383..b05f4243231 100644 --- a/include/bluetooth/services/hrs.h +++ b/include/bluetooth/services/hrs.h @@ -9,7 +9,7 @@ /** * @brief Heart Rate Service (HRS) - * @defgroup bt_gatt_hrs Heart Rate Service (HRS) + * @defgroup bt_hrs Heart Rate Service (HRS) * @ingroup bluetooth * @{ * @@ -29,7 +29,7 @@ extern "C" { * * @return Zero in case of success and error code in case of error. */ -int bt_gatt_hrs_notify(uint16_t heartrate); +int bt_hrs_notify(uint16_t heartrate); #ifdef __cplusplus } diff --git a/samples/bluetooth/hci_pwr_ctrl/prj.conf b/samples/bluetooth/hci_pwr_ctrl/prj.conf index 6f855e9c146..a562348889b 100644 --- a/samples/bluetooth/hci_pwr_ctrl/prj.conf +++ b/samples/bluetooth/hci_pwr_ctrl/prj.conf @@ -3,7 +3,7 @@ CONFIG_BT_DEBUG_LOG=y CONFIG_BT_PERIPHERAL=y CONFIG_MAIN_STACK_SIZE=512 CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=768 -CONFIG_BT_GATT_HRS=y +CONFIG_BT_HRS=y CONFIG_BT_DEVICE_APPEARANCE=833 CONFIG_BT_DEVICE_NAME="Dynamic test beacon" CONFIG_BT_CTLR_ADVANCED_FEATURES=y diff --git a/samples/bluetooth/hci_pwr_ctrl/src/main.c b/samples/bluetooth/hci_pwr_ctrl/src/main.c index 8bfdc61fb4e..c52b9508883 100644 --- a/samples/bluetooth/hci_pwr_ctrl/src/main.c +++ b/samples/bluetooth/hci_pwr_ctrl/src/main.c @@ -225,7 +225,7 @@ static void hrs_notify(void) heartrate = 90U; } - bt_gatt_hrs_notify(heartrate); + bt_hrs_notify(heartrate); } void modulate_tx_power(void *p1, void *p2, void *p3) diff --git a/samples/bluetooth/peripheral/prj.conf b/samples/bluetooth/peripheral/prj.conf index 56029252b66..79810cb40ff 100644 --- a/samples/bluetooth/peripheral/prj.conf +++ b/samples/bluetooth/peripheral/prj.conf @@ -9,7 +9,7 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_GATT_DIS=y CONFIG_BT_ATT_PREPARE_COUNT=5 CONFIG_BT_BAS=y -CONFIG_BT_GATT_HRS=y +CONFIG_BT_HRS=y CONFIG_BT_PRIVACY=y CONFIG_BT_DEVICE_NAME="Zephyr Peripheral Sample Long Name" CONFIG_BT_DEVICE_APPEARANCE=833 diff --git a/samples/bluetooth/peripheral/src/main.c b/samples/bluetooth/peripheral/src/main.c index ee1b6b5d6c5..cb6d8165cab 100644 --- a/samples/bluetooth/peripheral/src/main.c +++ b/samples/bluetooth/peripheral/src/main.c @@ -315,7 +315,7 @@ static void hrs_notify(void) heartrate = 90U; } - bt_gatt_hrs_notify(heartrate); + bt_hrs_notify(heartrate); } void main(void) diff --git a/samples/bluetooth/peripheral_hr/prj.conf b/samples/bluetooth/peripheral_hr/prj.conf index f9d2c8dcb9b..8040326913b 100644 --- a/samples/bluetooth/peripheral_hr/prj.conf +++ b/samples/bluetooth/peripheral_hr/prj.conf @@ -5,6 +5,6 @@ CONFIG_BT_PERIPHERAL=y CONFIG_BT_GATT_DIS=y CONFIG_BT_GATT_DIS_PNP=n CONFIG_BT_BAS=y -CONFIG_BT_GATT_HRS=y +CONFIG_BT_HRS=y CONFIG_BT_DEVICE_NAME="Zephyr Heartrate Sensor" CONFIG_BT_DEVICE_APPEARANCE=833 diff --git a/samples/bluetooth/peripheral_hr/src/main.c b/samples/bluetooth/peripheral_hr/src/main.c index d3560f6709f..4d338abf0fc 100644 --- a/samples/bluetooth/peripheral_hr/src/main.c +++ b/samples/bluetooth/peripheral_hr/src/main.c @@ -108,7 +108,7 @@ static void hrs_notify(void) heartrate = 90U; } - bt_gatt_hrs_notify(heartrate); + bt_hrs_notify(heartrate); } void main(void) diff --git a/subsys/bluetooth/services/CMakeLists.txt b/subsys/bluetooth/services/CMakeLists.txt index 58cf59612b7..b82b5553f6f 100644 --- a/subsys/bluetooth/services/CMakeLists.txt +++ b/subsys/bluetooth/services/CMakeLists.txt @@ -5,4 +5,4 @@ zephyr_sources_ifdef(CONFIG_BT_GATT_DIS dis.c) zephyr_sources_ifdef(CONFIG_BT_BAS bas.c) -zephyr_sources_ifdef(CONFIG_BT_GATT_HRS hrs.c) +zephyr_sources_ifdef(CONFIG_BT_HRS hrs.c) diff --git a/subsys/bluetooth/services/Kconfig.hrs b/subsys/bluetooth/services/Kconfig.hrs index 31ea97eed0a..6465436e6d4 100644 --- a/subsys/bluetooth/services/Kconfig.hrs +++ b/subsys/bluetooth/services/Kconfig.hrs @@ -3,15 +3,15 @@ # Copyright (c) 2018 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -menuconfig BT_GATT_HRS +menuconfig BT_HRS bool "Enable GATT Heart Rate service" -config BT_GATT_HRS_LOG_LEVEL +config BT_HRS_LOG_LEVEL int "Heart Rate service log level" depends on LOG range 0 4 default 0 - depends on BT_GATT_HRS + depends on BT_HRS help Sets log level for the Heart Rate service. Levels are: diff --git a/subsys/bluetooth/services/hrs.c b/subsys/bluetooth/services/hrs.c index 9bbc4ddfb37..da428cde6e9 100644 --- a/subsys/bluetooth/services/hrs.c +++ b/subsys/bluetooth/services/hrs.c @@ -21,7 +21,7 @@ #include #include -#define LOG_LEVEL CONFIG_BT_GATT_HRS_LOG_LEVEL +#define LOG_LEVEL CONFIG_BT_HRS_LOG_LEVEL #include LOG_MODULE_REGISTER(hrs); @@ -65,7 +65,7 @@ static int hrs_init(const struct device *dev) return 0; } -int bt_gatt_hrs_notify(uint16_t heartrate) +int bt_hrs_notify(uint16_t heartrate) { int rc; static uint8_t hrm[2]; diff --git a/tests/bluetooth/bsim_bt/bsim_test_app/prj_split.conf b/tests/bluetooth/bsim_bt/bsim_test_app/prj_split.conf index 205d1b32559..0110eabfd48 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_app/prj_split.conf +++ b/tests/bluetooth/bsim_bt/bsim_test_app/prj_split.conf @@ -6,7 +6,7 @@ CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_BT_BAS=y -CONFIG_BT_GATT_HRS=y +CONFIG_BT_HRS=y CONFIG_BT_ATT_PREPARE_COUNT=2 CONFIG_BT_GATT_CLIENT=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/bsim_bt/bsim_test_app/prj_split_privacy.conf b/tests/bluetooth/bsim_bt/bsim_test_app/prj_split_privacy.conf index f0c3c05e01b..5074c0b5ac5 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_app/prj_split_privacy.conf +++ b/tests/bluetooth/bsim_bt/bsim_test_app/prj_split_privacy.conf @@ -6,7 +6,7 @@ CONFIG_BT_PRIVACY=y CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_BT_BAS=y -CONFIG_BT_GATT_HRS=y +CONFIG_BT_HRS=y CONFIG_BT_ATT_PREPARE_COUNT=2 CONFIG_BT_GATT_CLIENT=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y diff --git a/tests/bluetooth/bsim_bt/bsim_test_app/src/test_connect2.c b/tests/bluetooth/bsim_bt/bsim_test_app/src/test_connect2.c index 71d89a256bf..c01e96e0052 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_app/src/test_connect2.c +++ b/tests/bluetooth/bsim_bt/bsim_test_app/src/test_connect2.c @@ -140,7 +140,7 @@ static void hrs_notify(void) heartrate = 90U; } - bt_gatt_hrs_notify(heartrate); + bt_hrs_notify(heartrate); } static void test_con2_main(void) diff --git a/tests/bluetooth/shell/mesh.conf b/tests/bluetooth/shell/mesh.conf index c02b4e38b09..caddf5ea8a3 100644 --- a/tests/bluetooth/shell/mesh.conf +++ b/tests/bluetooth/shell/mesh.conf @@ -18,7 +18,7 @@ CONFIG_SHELL=y CONFIG_BT_SHELL=y CONFIG_BT_DEVICE_NAME="test shell" CONFIG_BT_L2CAP_TX_BUF_COUNT=6 -CONFIG_BT_GATT_HRS=y +CONFIG_BT_HRS=y CONFIG_BT_L2CAP_RX_MTU=69 CONFIG_BT_L2CAP_TX_MTU=69 diff --git a/tests/bluetooth/shell/prj.conf b/tests/bluetooth/shell/prj.conf index 0e6f83d3fe2..9e67109328a 100644 --- a/tests/bluetooth/shell/prj.conf +++ b/tests/bluetooth/shell/prj.conf @@ -22,7 +22,7 @@ CONFIG_BT_L2CAP_TX_BUF_COUNT=4 CONFIG_BT_ID_MAX=2 CONFIG_BT_EATT=y CONFIG_BT_GATT_DYNAMIC_DB=y -CONFIG_BT_GATT_HRS=y +CONFIG_BT_HRS=y CONFIG_BT_WHITELIST=y CONFIG_BT_REMOTE_INFO=y CONFIG_BT_REMOTE_VERSION=y diff --git a/tests/bluetooth/shell/prj_br.conf b/tests/bluetooth/shell/prj_br.conf index ee0ead4858e..ddd92ed064f 100644 --- a/tests/bluetooth/shell/prj_br.conf +++ b/tests/bluetooth/shell/prj_br.conf @@ -11,7 +11,7 @@ CONFIG_BT_SMP=y CONFIG_BT_SIGNING=y CONFIG_BT_ATT_PREPARE_COUNT=2 CONFIG_BT_GATT_CLIENT=y -CONFIG_BT_GATT_HRS=y +CONFIG_BT_HRS=y CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y CONFIG_BT_TINYCRYPT_ECC=y CONFIG_BT_DEVICE_NAME="test shell" diff --git a/tests/bluetooth/shell/src/main.c b/tests/bluetooth/shell/src/main.c index 79afda0234a..f5e6ec80257 100644 --- a/tests/bluetooth/shell/src/main.c +++ b/tests/bluetooth/shell/src/main.c @@ -30,7 +30,7 @@ #define DEVICE_NAME CONFIG_BT_DEVICE_NAME -#if defined(CONFIG_BT_GATT_HRS) +#if defined(CONFIG_BT_HRS) static bool hrs_simulate; static const struct bt_data ad[] = { @@ -80,17 +80,17 @@ static int cmd_hrs_simulate(const struct shell *shell, return 0; } -#endif /* CONFIG_BT_GATT_HRS */ +#endif /* CONFIG_BT_HRS */ #define HELP_NONE "[none]" #define HELP_ADDR_LE " " SHELL_STATIC_SUBCMD_SET_CREATE(hrs_cmds, -#if defined(CONFIG_BT_GATT_HRS) +#if defined(CONFIG_BT_HRS) SHELL_CMD_ARG(simulate, NULL, "register and simulate Heart Rate Service ", cmd_hrs_simulate, 2, 0), -#endif /* CONFIG_BT_GATT_HRS*/ +#endif /* CONFIG_BT_HRS*/ SHELL_SUBCMD_SET_END ); @@ -104,7 +104,7 @@ static int cmd_hrs(const struct shell *shell, size_t argc, char **argv) SHELL_CMD_ARG_REGISTER(hrs, &hrs_cmds, "Heart Rate Service shell commands", cmd_hrs, 2, 0); -#if defined(CONFIG_BT_GATT_HRS) +#if defined(CONFIG_BT_HRS) static void hrs_notify(void) { static uint8_t heartrate = 90U; @@ -115,9 +115,9 @@ static void hrs_notify(void) heartrate = 90U; } - bt_gatt_hrs_notify(heartrate); + bt_hrs_notify(heartrate); } -#endif /* CONFIG_BT_GATT_HRS */ +#endif /* CONFIG_BT_HRS */ void main(void) { @@ -128,11 +128,11 @@ void main(void) while (1) { k_sleep(K_SECONDS(1)); -#if defined(CONFIG_BT_GATT_HRS) +#if defined(CONFIG_BT_HRS) /* Heartrate measurements simulation */ if (hrs_simulate) { hrs_notify(); } -#endif /* CONFIG_BT_GATT_HRS */ +#endif /* CONFIG_BT_HRS */ } }