Skip to content

Commit a92b59a

Browse files
samples: bluetooth: silabs: Bluetooth blinky
Similar to Silabs' SOC Blinky sample, implements two GATT characteristics. One characteristic controls the state of the LED via write operations from a GATT client. Second characteristic sends notifications to subscribed clients when the button state changes on the board. Signed-off-by: Viktor Fisch <viktor.fisch@silabs.com>
1 parent b4fbc98 commit a92b59a

5 files changed

Lines changed: 514 additions & 0 deletions

File tree

samples/bt_blinky/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
cmake_minimum_required(VERSION 3.20.0)
4+
5+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
6+
project(peripheral_hr)
7+
8+
FILE(GLOB app_sources src/*.c)
9+
target_sources(app PRIVATE
10+
${app_sources}
11+
)
12+
13+
zephyr_library_include_directories(${ZEPHYR_BASE}/samples/bluetooth)

samples/bt_blinky/README.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.. zephyr:code-sample:: bt_blinky
2+
:name: Blueooth blinky (Peripheral)
3+
:relevant-api: bluetooth
4+
5+
Similar to Silabs SOC Blinky
6+
7+
Overview
8+
********
9+
10+
Similar to the SOC Blinky sample, implements a simple custom GATT service with two characteristics.
11+
One characteristic controls the state of the LED (ON/OFF) via write operations from a GATT client,
12+
and the second characteristic sends notifications to subscribed clients when the button state changes
13+
(pressed or released).
14+
15+
Requirements
16+
************
17+
18+
* BlueZ running on the host, or
19+
* A board with Bluetooth LE support
20+
21+
Building and Running
22+
********************
23+
24+
Building a minimal variant
25+
--------------------------
26+
27+
.. zephyr-app-commands::
28+
:zephyr-app: samples/bt_blinky
29+
:board: qemu_cortex_m3
30+
:goals: build

samples/bt_blinky/prj.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CONFIG_BT=y
2+
CONFIG_LOG=y
3+
CONFIG_BT_SMP=y
4+
CONFIG_BT_PERIPHERAL=y
5+
CONFIG_BT_DIS=y
6+
CONFIG_BT_DIS_PNP=n
7+
CONFIG_BT_BAS=y
8+
CONFIG_BT_HRS=n
9+
CONFIG_BT_DEVICE_NAME="Blinky Example"
10+
CONFIG_BT_DEVICE_APPEARANCE=000

samples/bt_blinky/sample.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
sample:
2+
name: Bluetooth Blinky
3+
description: Similar to Silabs SOC Blinky
4+
tests:
5+
sample.bt_blinky:
6+
harness: bluetooth
7+
integration_platforms:
8+
- frdm_k64f
9+
- qemu_cortex_m3
10+
tags:
11+
- bluetooth
12+
- LED
13+
- gpio
14+
build_only: true

0 commit comments

Comments
 (0)