Skip to content

Commit

Permalink
Bluetooth Applications v2.0.0 (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
silabs-DanielN authored Mar 13, 2024
1 parent 5cba423 commit 06d2cfd
Show file tree
Hide file tree
Showing 239 changed files with 5,164 additions and 2,748 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@

# Silicon Labs Bluetooth Applications #

[![Version Badge](https://img.shields.io/badge/-v2.0.0-green)](https://github.com/SiliconLabs/bluetooth_applications/releases)
[![GSDK Badge](https://img.shields.io/badge/GSDK-v4.4.0-green)](https://github.com/SiliconLabs/gecko_sdk/releases)
[![TPHD Version Badge](https://img.shields.io/badge/TPHD-v2.0.0+-green)](https://github.com/SiliconLabs/third_party_hw_drivers_extension/releases)
![License badge](https://img.shields.io/badge/License-Zlib-green)

The Silicon Labs Bluetooth stack allows for a wide variety applications to be built on its foundation. This repo showcases some example applications using the Silicon Labs Bluetooth stack.

This repository provides both SLCP projects (as External Repositories) and SLS projects as standalone projects, which are configured for development boards.
Expand Down Expand Up @@ -75,14 +80,15 @@ This repository provides both SLCP projects (as External Repositories) and SLS p
| 52 | Bluetooth - HID Tripwire | [Click Here](./bluetooth_hid_tripwire) |
| 53 | Bluetooth - Ir Generator | [Click Here](./bluetooth_ir_generator) |
| 54 | Bluetooth - BTHome v2 - Server Example | [Click Here](./bluetooth_bthome_v2_server/) |

| 55 | Bluetooth - HID Multiple Reports | [Click Here](./bluetooth_hid_multiple_reports/) |
| 56 | Bluetooth - ESL Tag with E-Paper display 1,54inch 200x200 dots from Mikroe | [Click Here](./bluetooth_esl_tag_mikroe_eink154_e_paper_display) |

## Requirements ##

1. Silicon Labs EFR32 Development Kit
2. Simplicity Studio 5
3. Gecko SDK Suite 4.2.1, available via Simplicity Studio or [here](https://github.com/SiliconLabs/gecko_sdk)
4. Third-Party Hardware Drivers extension, available [here](https://github.com/SiliconLabs/third_party_hw_drivers_extension)
3. Compatible GSDK version that specified in each project's readme file. You can install it via Simplicity Studio or download it from our GitHub [gecko_sdk](https://github.com/SiliconLabs/gecko_sdk)
4. Compatible Third-Party Hardware Drivers extension that also specified in each project's readme file, available [here](https://github.com/SiliconLabs/third_party_hw_drivers_extension)

## Working with Projects ##

Expand Down
12 changes: 6 additions & 6 deletions bluetooth_accelerometer_bma400/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ The following picture shows the system view of how it works.

## Gecko SDK Suite version ##

- GSDK v4.2.3
- Third party hardware drivers extension v1.3.0
- GSDK v4.4.0
- [Third-Party Hardware Drivers v2.0.0.0](https://github.com/SiliconLabs/third_party_hw_drivers_extension)

## Hardware Required ##

Expand Down Expand Up @@ -80,7 +80,7 @@ To test this application, you can either create a project based on an example pr

- Select the **CONFIGURATION TOOLS** tab and open the **Bluetooth GATT Configurator**.

- Find the Import button and import the attached [gatt_configuration.btconf](config/btconf/gatt_configuration.btconf) file.
- Find the Import button and import the attached `config/gatt_configuration.btconf` file.

- Save the GATT configuration (ctrl-s).

Expand Down Expand Up @@ -126,10 +126,10 @@ Follow the below steps to test the example:

4. Enable notify on the unknown characteristic. Try to move your kit in some direction and check the value.

![](image/unknown_service.png)
![](image/unknown_service.png)

You can launch the Console that is integrated in Simplicity Studio or can use a third-party terminal tool like TeraTerm to receive the logs from the virtual COM port.
5. You can launch the Console that is integrated in Simplicity Studio or can use a third-party terminal tool like TeraTerm to receive the logs from the virtual COM port.

![](image/console.png)
![](image/console.png)

*Note*: The LED blinks once if the accelerometer initialization is successful. If the LED stays on, the initialization has been failed. The reason is typically wrong sensor I2C address (see "I2C ADD" resistors) or wrongly configured Click board mode (SPI-mode instead I2C) or if using some own ways to connect the sensor.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ config_file:

sdk_extension:
- id: third_party_hw_drivers
version: 1.3.0
version: 2.0.0

tag:
- hardware:rf:band:2400
Expand Down Expand Up @@ -98,6 +98,6 @@ configuration:

ui_hints:
highlight:
- path: ../config/gatt_configuration.btconf
- path: config/btconf/gatt_configuration.btconf
- path: README.md
focus: true
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ config_file:

sdk_extension:
- id: third_party_hw_drivers
version: 1.3.0
version: 2.0.0

tag:
- hardware:rf:band:2400
Expand Down Expand Up @@ -98,6 +98,6 @@ configuration:

ui_hints:
highlight:
- path: ../config/gatt_configuration.btconf
- path: config/btconf/gatt_configuration.btconf
- path: README.md
focus: true
5 changes: 2 additions & 3 deletions bluetooth_ai_ml_hand_signal_recognition/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ The hand gestures:

## Gecko SDK Suite version ##

- GSDK v4.2.1
- [Third Party Hardware Drivers v1.2.0](https://github.com/SiliconLabs/third_party_hw_drivers_extension)
- GSDK v4.4.0
- [Third Party Hardware Drivers v2.0.0](https://github.com/SiliconLabs/third_party_hw_drivers_extension)

## Hardware Required ##

Expand Down Expand Up @@ -73,7 +73,6 @@ Listed below are the port and pin mappings for working with this example.

To test this application, you can either create a project based on an example project or start with a "Bluetooth - SoC Empty" project based on your hardware.


**NOTE:**

- Make sure that the [SDK extension](https://github.com/SiliconLabs/third_party_hw_drivers_extension) is already installed and this repository is added to [Preferences > Simplicity Studio > External Repos](https://docs.silabs.com/simplicity-studio-5-users-guide/latest/ss-5-users-guide-about-the-launcher/welcome-and-device-tabs).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ toolchain_settings:

sdk_extension:
- id: third_party_hw_drivers
version: 1.2.0
version: 2.0.0

other_file:
- path: ../images/app_loop.png
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <cstdint>

#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/micro/micro_error_reporter.h"
#include "tensorflow/lite/micro/tflite_bridge/micro_error_reporter.h"
#include "hand_signal_app.h"

#define MAX_RESULT_COUNT 32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

#include "sl_sleeptimer.h"

#include "tensorflow/lite/micro/micro_error_reporter.h"
#include "tensorflow/lite/micro/tflite_bridge/micro_error_reporter.h"
#include "tensorflow/lite/micro/micro_interpreter.h"
#include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
#include "tensorflow/lite/schema/schema_generated.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void hand_signal_characteristic_status(sl_bt_msg_t *evt)
{
// Notification or Indication status changed for Hand signal
if (evt->data.evt_gatt_server_characteristic_status.status_flags
== gatt_server_client_config) {
== sl_bt_gatt_server_client_config) {
notifications_enabled
= evt->data.evt_gatt_server_characteristic_status.client_config_flags;
}
Expand Down
4 changes: 2 additions & 2 deletions bluetooth_air_quality_monitor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ This code example referred to the following code examples. More detailed informa

## Gecko SDK version ##

- GSDK v4.3.1
- [Third-Party Hardware Drivers v1.8.0](https://github.com/SiliconLabs/third_party_hw_drivers_extension)
- GSDK v4.4.0
- [Third-Party Hardware Drivers v2.0.0.0](https://github.com/SiliconLabs/third_party_hw_drivers_extension)

## Hardware Required ##

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ other_file:

sdk_extension:
- id: third_party_hw_drivers
version: 1.8.0
version: 2.0.0

ui_hints:
highlight:
- path: ../config/btconf/gatt_configuration.btconf
- path: ../README.md
- path: config/btconf/gatt_configuration.btconf
- path: README.md
focus: true
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--Custom BLE GATT-->
<gatt gatt_caching="true" generic_attribute_service="true" header="gatt_db.h" name="Custom BLE GATT" out="gatt_db.c" prefix="gattdb_">

<!--Generic Access-->
<service advertise="false" name="Generic Access" requirement="mandatory" sourceId="org.bluetooth.service.generic_access" type="primary" uuid="1800">
<informativeText>Abstract: The generic_access service contains generic information about the device. All available Characteristics are readonly. </informativeText>

<!--Device Name-->
<characteristic const="false" id="device_name" name="Device Name" sourceId="org.bluetooth.characteristic.gap.device_name" uuid="2A00">
<informativeText/>
<value length="11" type="utf-8" variable_length="false">Air Quality</value>
<value length="13" type="utf-8" variable_length="false">Empty Example</value>
<properties>
<read authenticated="false" bonded="false" encrypted="false"/>
<write authenticated="false" bonded="false" encrypted="false"/>
</properties>
</characteristic>

<!--Appearance-->
<characteristic const="true" name="Appearance" sourceId="org.bluetooth.characteristic.gap.appearance" uuid="2A01">
<informativeText>Abstract: The external appearance of this device. The values are composed of a category (10-bits) and sub-categories (6-bits). </informativeText>
Expand All @@ -25,78 +24,104 @@
</properties>
</characteristic>
</service>

<!--Device Information-->
<service advertise="false" id="device_information" name="Device Information" requirement="mandatory" sourceId="org.bluetooth.service.device_information" type="primary" uuid="180A">
<informativeText>Abstract: The Device Information Service exposes manufacturer and/or vendor information about a device. Summary: This service exposes manufacturer information about a device. The Device Information Service is instantiated as a Primary Service. Only one instance of the Device Information Service is exposed on a device. </informativeText>
<informativeText>Abstract: The Device Information Service exposes manufacturer and/or vendor information about a device. Summary: This service exposes manufacturer information about a device. The Device Information Service is instantiated as a Primary Service. Only one instance of the Device Information Service is exposed on a device.</informativeText>

<!--Manufacturer Name String-->
<characteristic const="true" id="manufacturer_name_string" name="Manufacturer Name String" sourceId="org.bluetooth.characteristic.manufacturer_name_string" uuid="2A29">
<informativeText>Abstract: The value of this characteristic is a UTF-8 string representing the name of the manufacturer of the device. </informativeText>
<informativeText>Abstract: The value of this characteristic is a UTF-8 string representing the name of the manufacturer of the device.</informativeText>
<value length="12" type="utf-8" variable_length="false">Silicon Labs</value>
<properties>
<read authenticated="false" bonded="false" encrypted="false"/>
</properties>
</characteristic>


<!--Model Number String-->
<characteristic const="false" id="model_number_string" name="Model Number String" sourceId="org.bluetooth.characteristic.model_number_string" uuid="2A24">
<informativeText>Abstract: The value of this characteristic is a UTF-8 string representing the model number assigned by the device vendor.</informativeText>
<value length="8" type="utf-8" variable_length="false">00000000</value>
<properties>
<read authenticated="false" bonded="false" encrypted="false"/>
</properties>
</characteristic>

<!--Hardware Revision String-->
<characteristic const="false" id="hardware_revision_string" name="Hardware Revision String" sourceId="org.bluetooth.characteristic.hardware_revision_string" uuid="2A27">
<informativeText>Summary: The value of this characteristic is a UTF-8 string representing the hardware revision for the hardware within the device.</informativeText>
<value length="3" type="utf-8" variable_length="false">000</value>
<properties>
<read authenticated="false" bonded="false" encrypted="false"/>
</properties>
</characteristic>

<!--Firmware Revision String-->
<characteristic const="false" id="firmware_revision_string" name="Firmware Revision String" sourceId="org.bluetooth.characteristic.firmware_revision_string" uuid="2A26">
<informativeText>Summary: The value of this characteristic is a UTF-8 string representing the firmware revision for the firmware within the device.</informativeText>
<value length="5" type="utf-8" variable_length="false">0.0.0</value>
<properties>
<read authenticated="false" bonded="false" encrypted="false"/>
</properties>
</characteristic>

<!--System ID-->
<characteristic const="false" id="system_id" name="System ID" sourceId="org.bluetooth.characteristic.system_id" uuid="2A23">
<informativeText>Abstract: The SYSTEM ID characteristic consists of a structure with two fields. The first field are the LSOs and the second field contains the MSOs. This is a 64-bit structure which consists of a 40-bit manufacturer-defined identifier concatenated with a 24 bit unique Organizationally Unique Identifier (OUI). The OUI is issued by the IEEE Registration Authority (http://standards.ieee.org/regauth/index.html) and is required to be used in accordance with IEEE Standard 802-2001.6 while the least significant 40 bits are manufacturer defined. If System ID generated based on a Bluetooth Device Address, it is required to be done as follows. System ID and the Bluetooth Device Address have a very similar structure: a Bluetooth Device Address is 48 bits in length and consists of a 24 bit Company Assigned Identifier (manufacturer defined identifier) concatenated with a 24 bit Company Identifier (OUI). In order to encapsulate a Bluetooth Device Address as System ID, the Company Identifier is concatenated with 0xFFFE followed by the Company Assigned Identifier of the Bluetooth Address. For more guidelines related to EUI-64, refer to http://standards.ieee.org/develop/regauth/tut/eui64.pdf. Examples: If the system ID is based of a Bluetooth Device Address with a Company Identifier (OUI) is 0x123456 and the Company Assigned Identifier is 0x9ABCDE, then the System Identifier is required to be 0x123456FFFE9ABCDE. </informativeText>
<informativeText>Abstract: The SYSTEM ID characteristic consists of a structure with two fields. The first field are the LSOs and the second field contains the MSOs. This is a 64-bit structure which consists of a 40-bit manufacturer-defined identifier concatenated with a 24 bit unique Organizationally Unique Identifier (OUI). The OUI is issued by the IEEE Registration Authority (http://standards.ieee.org/regauth/index.html) and is required to be used in accordance with IEEE Standard 802-2001.6 while the least significant 40 bits are manufacturer defined. If System ID generated based on a Bluetooth Device Address, it is required to be done as follows. System ID and the Bluetooth Device Address have a very similar structure: a Bluetooth Device Address is 48 bits in length and consists of a 24 bit Company Assigned Identifier (manufacturer defined identifier) concatenated with a 24 bit Company Identifier (OUI). In order to encapsulate a Bluetooth Device Address as System ID, the Company Identifier is concatenated with 0xFFFE followed by the Company Assigned Identifier of the Bluetooth Address. For more guidelines related to EUI-64, refer to http://standards.ieee.org/develop/regauth/tut/eui64.pdf. Examples: If the system ID is based of a Bluetooth Device Address with a Company Identifier (OUI) is 0x123456 and the Company Assigned Identifier is 0x9ABCDE, then the System Identifier is required to be 0x123456FFFE9ABCDE.</informativeText>
<value length="8" type="hex" variable_length="false"/>
<properties>
<read authenticated="false" bonded="false" encrypted="false"/>
</properties>
</characteristic>
</service>

<!--Air Quality-->
<service advertise="false" name="Air Quality" requirement="mandatory" sourceId="" type="primary" uuid="3a79c933-c922-45c7-b5e7-9bdefd126dd9">
<informativeText/>


<!--CO2-->
<characteristic const="false" id="co2_data" name="CO2" sourceId="custom.type" uuid="1b621ff2-b789-4b7c-985f-b62a50802bbf">
<characteristic const="false" id="co2_data" name="CO2" sourceId="" uuid="1b621ff2-b789-4b7c-985f-b62a50802bbf">
<informativeText>Custom characteristic for CO2</informativeText>
<value length="0" type="user" variable_length="false"/>
<value length="0" type="user" variable_length="false">00</value>
<properties>
<read authenticated="false" bonded="false" encrypted="false"/>
<write authenticated="false" bonded="true" encrypted="true"/>
</properties>
</characteristic>

<!--tVOC-->
<characteristic const="false" id="tvoc_data" name="tVOC" sourceId="custom.type" uuid="ec099dd9-7887-4ca6-a169-92a5e9ed7926">
<characteristic const="false" id="tvoc_data" name="tVOC" sourceId="" uuid="ec099dd9-7887-4ca6-a169-92a5e9ed7926">
<informativeText>Custom characteristic for VOC</informativeText>
<value length="0" type="user" variable_length="false"/>
<value length="0" type="user" variable_length="false">00</value>
<properties>
<read authenticated="false" bonded="false" encrypted="false"/>
<write authenticated="false" bonded="true" encrypted="true"/>
</properties>
</characteristic>

<!--Buzzer-->
<characteristic const="false" id="buzzer_data" name="Buzzer" sourceId="custom.type" uuid="c5fd8492-9c55-4c18-b761-99b8cf9bca77">
<characteristic const="false" id="buzzer_data" name="Buzzer" sourceId="" uuid="c5fd8492-9c55-4c18-b761-99b8cf9bca77">
<informativeText>Custom characteristic for Buzzer</informativeText>
<value length="0" type="user" variable_length="false"/>
<value length="0" type="user" variable_length="false">00</value>
<properties>
<read authenticated="false" bonded="false" encrypted="false"/>
<write authenticated="false" bonded="true" encrypted="true"/>
</properties>
</characteristic>

<!--Notification-->
<characteristic const="false" id="notification_data" name="Notification" sourceId="custom.type" uuid="ec26adea-75af-409d-b267-51a4e753e9ea">
<informativeText/>
<value length="0" type="user" variable_length="false"/>
<characteristic const="false" id="notification_data" name="Notification" sourceId="" uuid="ec26adea-75af-409d-b267-51a4e753e9ea">
<informativeText>Custom characteristic for CO2</informativeText>
<value length="0" type="user" variable_length="false">00</value>
<properties>
<read authenticated="false" bonded="false" encrypted="false"/>
<write authenticated="false" bonded="true" encrypted="true"/>
</properties>
</characteristic>

<!--Measurement update period-->
<characteristic const="false" id="measurement_period_data" name="Measurement update period" sourceId="custom.type" uuid="98205b49-a9e1-4bfc-a18d-60d36798397f">
<informativeText/>
<value length="0" type="user" variable_length="false"/>
<characteristic const="false" id="measurement_period_data" name="Measurement update period" sourceId="" uuid="98205b49-a9e1-4bfc-a18d-60d36798397f">
<informativeText>Custom characteristic for CO2</informativeText>
<value length="0" type="user" variable_length="false">00</value>
<properties>
<read authenticated="false" bonded="false" encrypted="false"/>
<write authenticated="false" bonded="true" encrypted="true"/>
Expand Down
4 changes: 4 additions & 0 deletions bluetooth_air_quality_monitor/src/air_quality_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,10 @@ static uint16_t air_quality_moving_average(uint16_t *data)
uint16_t min, max;
uint8_t i;

if (!samples_counter) {
return 0;
}

// Calculate average value
min = max = data[0];
for (i = 0; i < samples_counter && i < DATA_BUFFER_SIZE; i++) {
Expand Down
Loading

0 comments on commit 06d2cfd

Please sign in to comment.