-
Notifications
You must be signed in to change notification settings - Fork 802
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/ble_services' into 'master'
feat(ble_services): Add BLE services and examples Closes AEG-486 See merge request ae_group/esp-iot-solution!759
- Loading branch information
Showing
82 changed files
with
6,607 additions
and
0 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
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,11 @@ | ||
## v0.1.0 | ||
|
||
This is the first release version for BLE services component in Espressif Component Registry, more detailed descriptions about the project, please refer to [User_Guide](https://docs.espressif.com/projects/espressif-esp-iot-solution/en/latest/bluetooth/ble_services.html). | ||
|
||
Features: | ||
- ANS: Support Alert Notification Service | ||
- BAS: Support Battery Service | ||
- DIS: Support Device Information Service | ||
- HRS: Support Heart Rate Service | ||
- HTS: Support Health Thermometer Service | ||
- TPS: Support TX Power Service |
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,43 @@ | ||
set(srcs "") | ||
set(req "") | ||
set(include "") | ||
set(priv_includes "") | ||
set(priv_req "") | ||
|
||
if(CONFIG_BLE_ANS) | ||
list(APPEND srcs "ans/src/esp_ans.c") | ||
list(APPEND include "ans/include") | ||
endif() | ||
|
||
if(CONFIG_BLE_DIS) | ||
list(APPEND srcs "dis/src/esp_dis.c") | ||
list(APPEND include "dis/include") | ||
endif() | ||
|
||
if(CONFIG_BLE_BAS) | ||
list(APPEND srcs "bas/src/esp_bas.c") | ||
list(APPEND include "bas/include") | ||
endif() | ||
|
||
if(CONFIG_BLE_HRS) | ||
list(APPEND srcs "hrs/src/esp_hrs.c") | ||
list(APPEND include "hrs/include") | ||
endif() | ||
|
||
if(CONFIG_BLE_HTS) | ||
list(APPEND srcs "hts/src/esp_hts.c") | ||
list(APPEND include "hts/include") | ||
endif() | ||
|
||
if(CONFIG_BLE_TPS) | ||
list(APPEND srcs "tps/src/esp_tps.c") | ||
list(APPEND include "tps/include") | ||
endif() | ||
|
||
list(APPEND req "ble_conn_mgr") | ||
|
||
idf_component_register(SRCS "${srcs}" | ||
INCLUDE_DIRS "${include}" | ||
PRIV_INCLUDE_DIRS "${priv_includes}" | ||
REQUIRES "${req}" | ||
PRIV_REQUIRES "${priv_req}") |
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,10 @@ | ||
menu "BLE Standard Services" | ||
|
||
orsource "./ans/Kconfig.in" | ||
orsource "./dis/Kconfig.in" | ||
orsource "./bas/Kconfig.in" | ||
orsource "./hrs/Kconfig.in" | ||
orsource "./hts/Kconfig.in" | ||
orsource "./tps/Kconfig.in" | ||
|
||
endmenu |
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,45 @@ | ||
## BLE Services Component | ||
|
||
[![Component Registry](https://components.espressif.com/components/espressif/ble_services/badge.svg)](https://components.espressif.com/components/espressif/ble_services) | ||
|
||
- [User Guide](https://docs.espressif.com/projects/espressif-esp-iot-solution/en/latest/bluetooth/ble_services.html) | ||
|
||
The ``ble_services`` component provides a simplified API interface for accessing commonly used standard and custom BLE services functionality on a GATT server. | ||
|
||
### Adding the component to your project | ||
|
||
Please use the component manager command `idf.py add-dependency` to add `ble_services` as a dependency to your project. The component will be downloaded automatically during the CMake step. | ||
|
||
``` | ||
idf.py add-dependency "espressif/ble_services=*" | ||
``` | ||
|
||
### Examples | ||
|
||
To create a project from the example template, please use the component manager command `idf.py create-project-from-example`. | ||
|
||
* BLE Device Information Service | ||
``` | ||
idf.py create-project-from-example "espressif/ble_services=*:ble_dis" | ||
``` | ||
|
||
The example will be downloaded to the current folder. You can navigate into it for building and flashing. | ||
|
||
> You can use this command to download other examples. Or you can download examples from esp-iot-solution repository: | ||
1. [ble_ans](https://github.com/espressif/esp-iot-solution/tree/master/examples/bluetooth/ble_services/ble_ans) | ||
2. [ble_bas](https://github.com/espressif/esp-iot-solution/tree/master/examples/bluetooth/ble_services/ble_bas) | ||
3. [ble_dis](https://github.com/espressif/esp-iot-solution/tree/master/examples/bluetooth/ble_services/ble_dis) | ||
4. [ble_hrs](https://github.com/espressif/esp-iot-solution/tree/master/examples/bluetooth/ble_services/ble_hrs) | ||
5. [ble_hts](https://github.com/espressif/esp-iot-solution/tree/master/examples/bluetooth/ble_services/ble_hts) | ||
5. [ble_tps](https://github.com/espressif/esp-iot-solution/tree/master/examples/bluetooth/ble_services/ble_tps) | ||
|
||
### Q&A | ||
|
||
Q1. I encountered the following problems when using the package manager | ||
|
||
``` | ||
Executing action: create-project-from-example | ||
CMakeLists.txt not found in project directory /home/username | ||
``` | ||
|
||
A1. This is because an older version packege manager was used, please run `pip install -U idf-component-manager` in ESP-IDF environment to update. |
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,8 @@ | ||
# GATT Alert Notification Service | ||
|
||
menuconfig BLE_ANS | ||
bool "GATT Alert Notification Service" | ||
|
||
if BLE_ANS | ||
|
||
endif # BLE_ANS |
Oops, something went wrong.