Skip to content

Commit 1e5e1b4

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. Minor changes have been made in README.rst, samples.yaml CMakeList.txt Some coding style and global variable issues have been fixed. Signed-off-by: Viktor Fisch <viktor.fisch@silabs.com>
1 parent b4fbc98 commit 1e5e1b4

5 files changed

Lines changed: 511 additions & 0 deletions

File tree

samples/bt_blinky/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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(bt_blinky)
7+
8+
target_sources(app PRIVATE src/main.c)
9+
10+
zephyr_library_include_directories(${ZEPHYR_BASE}/samples/bluetooth)

samples/bt_blinky/README.rst

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

0 commit comments

Comments
 (0)