Skip to content

Commit 9386224

Browse files
bluetooth: rename HRS central to HRS client
Rename HRS central to HRS client, both service and sample. Signed-off-by: Eivind Jølsgard <[email protected]>
1 parent 807903e commit 9386224

File tree

16 files changed

+156
-156
lines changed

16 files changed

+156
-156
lines changed

doc/nrf-bm/api/api.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,12 @@ Heart Rate Service
212212

213213
.. doxygengroup:: ble_hrs
214214

215-
.. _api_ble_hrs_central:
215+
.. _api_ble_hrs_client:
216216

217-
Heart Rate Service Central
217+
Heart Rate Service Client
218218
==========================
219219

220-
.. doxygengroup:: ble_hrs_central
220+
.. doxygengroup:: ble_hrs_client
221221

222222
.. _api_human_interface_device_service:
223223

doc/nrf-bm/libraries/bluetooth/services/ble_hrs_central.rst renamed to doc/nrf-bm/libraries/bluetooth/services/ble_hrs_client.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ The HRS Client retrieves information such as the sensor location from a device t
1717
Configuration
1818
*************
1919

20-
Set the :kconfig:option:`CONFIG_BLE_HRS_CENTRAL` Kconfig option to enable the service.
20+
Set the :kconfig:option:`CONFIG_BLE_HRS_CLIENT` Kconfig option to enable the service.
2121

22-
Set the maximum number of RR intervals for each HRM notification using the :kconfig:option:`CONFIG_BLE_HRS_CENTRAL_RR_INTERVALS_MAX_COUNT` Kconfig option.
22+
Set the maximum number of RR intervals for each HRM notification using the :kconfig:option:`CONFIG_BLE_HRS_CLIENT_RR_INTERVALS_MAX_COUNT` Kconfig option.
2323

2424
Initialization
2525
==============
2626

27-
The service instance is declared using the :c:macro:`BLE_HRS_CENTRAL_DEF` macro, specifying the name of the instance.
28-
To initialize the service, call the :c:func:`ble_hrs_central_init` function.
29-
See the :c:struct:`ble_hrs_central_config` structure for configuration details, in addition to the HRS specification.
27+
The service instance is declared using the :c:macro:`BLE_HRS_CLIENT_DEF` macro, specifying the name of the instance.
28+
To initialize the service, call the :c:func:`ble_hrs_client_init` function.
29+
See the :c:struct:`ble_hrs_client_config` structure for configuration details, in addition to the HRS specification.
3030

3131
Usage
3232
*****
@@ -35,10 +35,10 @@ Applications can use the :ref:`lib_ble_scan` library for detecting advertising d
3535

3636
Upon connection, the application can use the :ref:`lib_ble_db_discovery` library to discover the peer's database.
3737
Call the :c:func:`ble_hrs_on_db_disc_evt` function on callback events from the Database Discovery library.
38-
This function sends the :c:enumerator:`BLE_HRS_CENTRAL_EVT_DISCOVERY_COMPLETE` event to the application if the Heart Rate Service is discovered in the peer's database.
39-
The application must call the :c:func:`ble_hrs_central_handles_assign` function to associate the link with the HRS Client instance.
38+
This function sends the :c:enumerator:`BLE_HRS_CLIENT_EVT_DISCOVERY_COMPLETE` event to the application if the Heart Rate Service is discovered in the peer's database.
39+
The application must call the :c:func:`ble_hrs_client_handles_assign` function to associate the link with the HRS Client instance.
4040

41-
Upon Heart Rate Service discovery, the application can call the :c:func:`ble_hrs_central_hrm_notif_enable` function to request the peer to start sending Heart Rate Measurement notifications.
41+
Upon Heart Rate Service discovery, the application can call the :c:func:`ble_hrs_client_hrm_notif_enable` function to request the peer to start sending Heart Rate Measurement notifications.
4242

4343
Dependencies
4444
************
@@ -54,7 +54,7 @@ The library is expected to be used with the :ref:`lib_ble_scan` |BMshort| librar
5454
API documentation
5555
*****************
5656

57-
| Header file: :file:`include/bm/bluetooth/services/ble_hrs_central.h`
58-
| Source files: :file:`subsys/bluetooth/services/ble_hrs_central/`
57+
| Header file: :file:`include/bm/bluetooth/services/ble_hrs_client.h`
58+
| Source files: :file:`subsys/bluetooth/services/ble_hrs_client/`
5959
60-
:ref:`Heart Rate Service API reference <api_ble_hrs_central>`
60+
:ref:`Heart Rate Service API reference <api_ble_hrs_client>`

doc/nrf-bm/release_notes/release_notes_1.0.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ Bluetooth LE samples
425425

426426
* :ref:`ble_radio_ntf_sample` sample.
427427
* :ref:`ble_bms_sample` sample.
428-
* :ref:`ble_hrs_central_sample` sample.
428+
* :ref:`ble_hrs_client_sample` sample.
429429

430430
* Updated:
431431

doc/nrf-bm/release_notes/release_notes_changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ No changes since the latest nRF Connect SDK Bare Metal release.
8787
Bluetooth LE samples
8888
--------------------
8989

90-
No changes since the latest nRF Connect SDK Bare Metal release.
90+
* Renamed the ``ble_hrs_central`` sample to the :ref:`ble_hrs_client_sample` sample.
9191

9292
NFC samples
9393
-----------

include/bm/bluetooth/services/ble_hrs_central.h renamed to include/bm/bluetooth/services/ble_hrs_client.h

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/**
77
* @file
88
*
9-
* @defgroup ble_hrs_central Heart Rate Service Client
9+
* @defgroup ble_hrs_client Heart Rate Service Client
1010
* @{
1111
* @brief Heart Rate Service Client.
1212
*
@@ -23,8 +23,8 @@
2323
* the application.
2424
*/
2525

26-
#ifndef BLE_HRS_CENTRAL_H__
27-
#define BLE_HRS_CENTRAL_H__
26+
#ifndef BLE_HRS_CLIENT_H__
27+
#define BLE_HRS_CLIENT_H__
2828

2929
#include <stdint.h>
3030
#include <ble.h>
@@ -37,27 +37,27 @@ extern "C" {
3737
#endif
3838

3939
/**
40-
* @brief Macro for defining a ble_hrs_central instance.
40+
* @brief Macro for defining a ble_hrs_client instance.
4141
*
4242
* @param _name Name of the instance.
4343
* @hideinitializer
4444
*/
45-
#define BLE_HRS_CENTRAL_DEF(_name) \
46-
static struct ble_hrs_central _name; \
47-
NRF_SDH_BLE_OBSERVER(_name##_obs, ble_hrs_central_on_ble_evt, &_name, USER_LOW)
45+
#define BLE_HRS_CLIENT_DEF(_name) \
46+
static struct ble_hrs_client _name; \
47+
NRF_SDH_BLE_OBSERVER(_name##_obs, ble_hrs_client_on_ble_evt, &_name, USER_LOW)
4848

4949
/**
5050
* @brief HRS Client event type.
5151
*/
52-
enum ble_hrs_central_evt_type {
52+
enum ble_hrs_client_evt_type {
5353
/** Event indicating that the Heart Rate Service was discovered at the peer. */
54-
BLE_HRS_CENTRAL_EVT_DISCOVERY_COMPLETE,
54+
BLE_HRS_CLIENT_EVT_DISCOVERY_COMPLETE,
5555
/** Event indicating that a notification of the Heart Rate Measurement characteristic was
5656
* received from the peer.
5757
*/
58-
BLE_HRS_CENTRAL_EVT_HRM_NOTIFICATION,
58+
BLE_HRS_CLIENT_EVT_HRM_NOTIFICATION,
5959
/** Error. */
60-
BLE_HRS_CENTRAL_EVT_ERROR,
60+
BLE_HRS_CLIENT_EVT_ERROR,
6161
};
6262

6363
/**
@@ -69,7 +69,7 @@ struct ble_hrm {
6969
/** Number of RR intervals. */
7070
uint8_t rr_intervals_cnt;
7171
/** RR intervals. */
72-
uint16_t rr_intervals[CONFIG_BLE_HRS_CENTRAL_RR_INTERVALS_MAX_COUNT];
72+
uint16_t rr_intervals[CONFIG_BLE_HRS_CLIENT_RR_INTERVALS_MAX_COUNT];
7373
};
7474

7575
/**
@@ -85,22 +85,22 @@ struct hrs_db {
8585
/**
8686
* @brief Heart Rate Event.
8787
*/
88-
struct ble_hrs_central_evt {
88+
struct ble_hrs_client_evt {
8989
/** Type of the event. */
90-
enum ble_hrs_central_evt_type evt_type;
90+
enum ble_hrs_client_evt_type evt_type;
9191
/** Connection handle on which the Heart Rate service was discovered on the peer device. */
9292
uint16_t conn_handle;
9393
union {
9494
/** Handles related to the Heart Rate, found on the peer device.
95-
* This is filled if the evt_type is @ref BLE_HRS_CENTRAL_EVT_DISCOVERY_COMPLETE.
95+
* This is filled if the evt_type is @ref BLE_HRS_CLIENT_EVT_DISCOVERY_COMPLETE.
9696
*/
9797
struct hrs_db peer_db;
9898
/** Heart Rate Measurement received. This is filled if the evt_type
99-
* is @ref BLE_HRS_CENTRAL_EVT_HRM_NOTIFICATION.
99+
* is @ref BLE_HRS_CLIENT_EVT_HRM_NOTIFICATION.
100100
*/
101101
struct ble_hrm hrm;
102102
/** Error event. This is filled if the evt_type
103-
* is @ref BLE_HRS_CENTRAL_EVT_ERROR.
103+
* is @ref BLE_HRS_CLIENT_EVT_ERROR.
104104
*/
105105
struct {
106106
/** Error reason */
@@ -110,41 +110,41 @@ struct ble_hrs_central_evt {
110110
};
111111

112112
/** Forward declaration. */
113-
struct ble_hrs_central;
113+
struct ble_hrs_client;
114114

115115
/**
116116
* @brief Event handler type.
117117
*
118118
* @details This is the type of the event handler that is to be provided by the application
119119
* of this module to receive events.
120120
*/
121-
typedef void (*ble_hrs_central_evt_handler_t)(struct ble_hrs_central *ble_hrs_central,
122-
struct ble_hrs_central_evt *evt);
121+
typedef void (*ble_hrs_client_evt_handler_t)(struct ble_hrs_client *ble_hrs_client,
122+
struct ble_hrs_client_evt *evt);
123123

124124
/**
125125
* @brief Heart Rate Client.
126126
*/
127-
struct ble_hrs_central {
127+
struct ble_hrs_client {
128128
/** Connection handle, as provided by the SoftDevice. */
129129
uint16_t conn_handle;
130130
/** Handles related to HRS on the peer. */
131131
struct hrs_db peer_hrs_db;
132132
/** Application event handler to be called when there
133133
* is an event related to the Heart Rate Service.
134134
*/
135-
ble_hrs_central_evt_handler_t evt_handler;
135+
ble_hrs_client_evt_handler_t evt_handler;
136136
/** Bluetooth LE GATT Queue instance. */
137137
const struct ble_gq *gatt_queue;
138138
};
139139

140140
/**
141141
* @brief Heart Rate Client configuration structure.
142142
*/
143-
struct ble_hrs_central_config {
143+
struct ble_hrs_client_config {
144144
/** Event handler to be called by the Heart Rate Client module when
145145
* there is an event related to the Heart Rate Service.
146146
*/
147-
ble_hrs_central_evt_handler_t evt_handler;
147+
ble_hrs_client_evt_handler_t evt_handler;
148148
/** Bluetooth LE GATT Queue instance. */
149149
const struct ble_gq *gatt_queue;
150150
/** Database discovery instance. */
@@ -158,15 +158,15 @@ struct ble_hrs_central_config {
158158
* The module looks for the presence of a Heart Rate Service instance at the peer
159159
* when a discovery is started.
160160
*
161-
* @param[in] ble_hrs_central Heart Rate Client structure.
162-
* @param[in] ble_hrs_central_config Heart rate service central configuration.
161+
* @param[in] ble_hrs_client Heart Rate Client structure.
162+
* @param[in] ble_hrs_client_config Heart rate service client configuration.
163163
*
164164
* @retval NRF_SUCCESS On successful initialization.
165165
* @return Otherwise, this function propagates the error code returned by the
166166
* Database Discovery module API @ref ble_db_discovery_service_register.
167167
*/
168-
uint32_t ble_hrs_central_init(struct ble_hrs_central *ble_hrs_central,
169-
struct ble_hrs_central_config *ble_hrs_central_config);
168+
uint32_t ble_hrs_client_init(struct ble_hrs_client *ble_hrs_client,
169+
struct ble_hrs_client_config *ble_hrs_client_config);
170170

171171
/**
172172
* @brief Handle Bluetooth LE events from the SoftDevice.
@@ -179,20 +179,20 @@ uint32_t ble_hrs_central_init(struct ble_hrs_central *ble_hrs_central,
179179
* @param[in] ble_evt Bluetooth LE event.
180180
* @param[in] ctx Heart Rate Client structure.
181181
*/
182-
void ble_hrs_central_on_ble_evt(const ble_evt_t *ble_evt, void *ctx);
182+
void ble_hrs_client_on_ble_evt(const ble_evt_t *ble_evt, void *ctx);
183183

184184
/**
185185
* @brief Request the peer to start sending notification of Heart Rate Measurement.
186186
*
187187
* @details This function enables notification of the Heart Rate Measurement at the peer
188188
* by writing to the CCCD of the Heart Rate Measurement characteristic.
189189
*
190-
* @param ble_hrs_central Heart Rate Client structure.
190+
* @param ble_hrs_client Heart Rate Client structure.
191191
*
192192
* @retval NRF_SUCCESS If the SoftDevice is requested to write to the CCCD of the peer.
193193
* @return Error code returned by the SoftDevice API @ref sd_ble_gattc_write.
194194
*/
195-
uint32_t ble_hrs_central_hrm_notif_enable(struct ble_hrs_central *ble_hrs_central);
195+
uint32_t ble_hrs_client_hrm_notif_enable(struct ble_hrs_client *ble_hrs_client);
196196

197197
/**
198198
* @brief Handle events from the Database Discovery module.
@@ -204,12 +204,12 @@ uint32_t ble_hrs_central_hrm_notif_enable(struct ble_hrs_central *ble_hrs_centra
204204
* Service was discovered at the peer. The function also populates the event with
205205
* service-related information before providing it to the application.
206206
*
207-
* @param[in] ble_hrs_central Heart Rate Client structure instance for
207+
* @param[in] ble_hrs_client Heart Rate Client structure instance for
208208
* associating the link.
209209
* @param[in] evt Event received from the Database Discovery module.
210210
*
211211
*/
212-
void ble_hrs_on_db_disc_evt(struct ble_hrs_central *ble_hrs_central,
212+
void ble_hrs_on_db_disc_evt(struct ble_hrs_client *ble_hrs_client,
213213
const struct ble_db_discovery_evt *evt);
214214

215215
/**
@@ -219,23 +219,23 @@ void ble_hrs_on_db_disc_evt(struct ble_hrs_central *ble_hrs_central,
219219
* associate the link to this instance of the module. This association makes it
220220
* possible to handle several links and associate each link to a particular
221221
* instance of this module. The connection handle and attribute handles are
222-
* provided from the discovery event @ref BLE_HRS_CENTRAL_EVT_DISCOVERY_COMPLETE.
222+
* provided from the discovery event @ref BLE_HRS_CLIENT_EVT_DISCOVERY_COMPLETE.
223223
*
224-
* @param[in] ble_hrs_central Heart Rate Client structure instance for
224+
* @param[in] ble_hrs_client Heart Rate Client structure instance for
225225
* associating the link.
226226
* @param[in] conn_handle Connection handle to associate with the given Heart Rate
227227
* Client Instance.
228228
* @param[in] peer_hrs_handles Attribute handles for the HRS server you want this HRS_C
229229
* client to interact with.
230230
*/
231-
uint32_t ble_hrs_central_handles_assign(struct ble_hrs_central *ble_hrs_central,
231+
uint32_t ble_hrs_client_handles_assign(struct ble_hrs_client *ble_hrs_client,
232232
uint16_t conn_handle,
233233
const struct hrs_db *peer_hrs_handles);
234234

235235
#ifdef __cplusplus
236236
}
237237
#endif
238238

239-
#endif /* BLE_HRS_CENTRAL_H__ */
239+
#endif /* BLE_HRS_CLIENT_H__ */
240240

241241
/** @} */

samples/bluetooth/ble_hrs_central/CMakeLists.txt renamed to samples/bluetooth/ble_hrs_client/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
cmake_minimum_required(VERSION 3.20.0)
88

99
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
10-
project(ble_hrs_central)
10+
project(ble_hrs_client)
1111

1212
target_sources(app PRIVATE src/main.c)
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

7-
menu "BLE HRS central sample"
7+
menu "BLE HRS client sample"
88

99
config APP_USE_TARGET_PERIPHERAL_NAME
1010
bool "Use target peripheral name"
@@ -30,10 +30,10 @@ config APP_TARGET_PERIPHERAL_ADDR
3030

3131
endif # APP_USE_TARGET_PERIPHERAL_ADDR
3232

33-
module=APP_BLE_HRS_CENTRAL_SAMPLE
34-
module-str=BLE Heart Rate Central Service Sample
33+
module=APP_BLE_HRS_CLIENT_SAMPLE
34+
module-str=BLE Heart Rate Client Service Sample
3535
source "$(ZEPHYR_BASE)/subsys/logging/Kconfig.template.log_config"
3636

37-
endmenu # "BLE HRS central sample"
37+
endmenu # "BLE HRS client sample"
3838

3939
source "Kconfig.zephyr"

samples/bluetooth/ble_hrs_central/README.rst renamed to samples/bluetooth/ble_hrs_client/README.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
.. _ble_hrs_central_sample:
1+
.. _ble_hrs_client_sample:
22

3-
Bluetooth: Heart Rate Service Central
4-
#####################################
3+
Bluetooth: Heart Rate Service Client
4+
####################################
55

66
.. contents::
77
:local:
88
:depth: 2
99

10-
The Heart Rate Service Central sample demonstrates how you can implement the Heart Rate profile as a central using |BMlong|.
10+
The Heart Rate Service Client sample demonstrates how you can implement the Heart Rate profile as a client using |BMlong|.
1111

1212
Requirements
1313
************
@@ -71,12 +71,12 @@ This sample scans for devices that advertise with the :ref:`lib_ble_service_hrs`
7171
When a device is connected, the sample starts the service discovery procedure.
7272
If this succeeds, the sample subscribes to the Heart Rate Measurement characteristic to receive heart rate notifications.
7373

74-
.. _ble_hrs_central_sample_testing:
74+
.. _ble_hrs_client_sample_testing:
7575

7676
Building and running
7777
********************
7878

79-
This sample can be found under :file:`samples/bluetooth/ble_hrs_central/` in the |BMshort| folder structure.
79+
This sample can be found under :file:`samples/bluetooth/ble_hrs_client/` in the |BMshort| folder structure.
8080

8181
For details on how to create, configure, and program a sample, see :ref:`getting_started_with_the_samples`.
8282

@@ -88,7 +88,7 @@ This sample requires two devices to test, one running this sample and another on
8888
Complete the following steps to test the sample:
8989

9090
1. Compile and program the application.
91-
#. In the Serial Terminal, observe that the ``BLE HRS Central sample started`` message is printed.
91+
#. In the Serial Terminal, observe that the ``BLE HRS Client sample started`` message is printed.
9292
#. Program the other development kit with the :ref:`ble_hrs_sample` sample and reset it.
9393
#. Observe that the ``Scan filter match`` message is printed, followed by ``Connecting to target`` and ``Connected``.
9494
#. Observe that the ``Heart rate service discovered.`` message is printed.

samples/bluetooth/ble_hrs_central/prj.conf renamed to samples/bluetooth/ble_hrs_client/prj.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ CONFIG_MBEDTLS_PSA_CRYPTO_C=y
1414
CONFIG_PSA_WANT_GENERATE_RANDOM=y
1515

1616
# BLE Heart rate client
17-
CONFIG_BLE_HRS_CENTRAL=y
17+
CONFIG_BLE_HRS_CLIENT=y
1818

1919
# BLE connection parameter
2020
CONFIG_BLE_CONN_PARAMS=y

0 commit comments

Comments
 (0)