Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bluetooth: services: Move Heart rate service
This commit moves the BLE GATT heart rate service from samples/bluetooth/gatt to subsys/bluetooth/services and adds a Kconfig entry to enable and configure the service. Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
- Loading branch information
Showing
23 changed files
with
171 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright (c) 2016 Intel Corporation | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_HRS_H_ | ||
#define ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_HRS_H_ | ||
|
||
/** | ||
* @brief Heart Rate Service (HRS) | ||
* @defgroup bt_gatt_hrs Heart Rate Service (HRS) | ||
* @ingroup bluetooth | ||
* @{ | ||
* | ||
* [Experimental] Users should note that the APIs can change | ||
* as a part of ongoing development. | ||
*/ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** @brief Notify heart rate measurement. | ||
* | ||
* This will send a GATT notification to all current subscribers. | ||
* | ||
* @param heartrate The heartrate measuremennt in beats per minute. | ||
* | ||
* @return Zero in case of success and error code in case of error. | ||
*/ | ||
int bt_gatt_hrs_notify(u16_t heartrate); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
/** | ||
* @} | ||
*/ | ||
|
||
#endif /* ZEPHYR_INCLUDE_BLUETOOTH_SERVICES_HRS_H_ */ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ project(peripheral) | |
|
||
target_sources(app PRIVATE | ||
src/main.c | ||
../gatt/hrs.c | ||
../gatt/cts.c | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Kconfig - Bluetooth GATT Heart Rate service | ||
# | ||
# Copyright (c) 2018 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
menuconfig BT_GATT_HRS | ||
bool "Enable GATT Heart Rate service" | ||
default n | ||
|
||
if BT_GATT_HRS | ||
|
||
config BT_GATT_HRS_LOG_LEVEL | ||
int "Heart Rate service log level" | ||
depends on LOG | ||
range 0 4 | ||
default 0 | ||
help | ||
Sets log level for the Heart Rate service. | ||
Levels are: | ||
0 OFF, do not write | ||
1 ERROR, only write LOG_ERR | ||
2 WARNING, write LOG_WRN in addition to previous level | ||
3 INFO, write LOG_INF in addition to previous levels | ||
4 DEBUG, write LOG_DBG in addition to previous levels | ||
|
||
endif #BT_GATT_BAS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.