Skip to content

Commit c3f2da1

Browse files
piruncarlescufi
authored andcommitted
samples: bluetooth: adding central_otc sample
Added a Bluetooth Central sample that demonstrates how to use GATT Object Transfer Profile. Signed-off-by: Pirun Lee <[email protected]>
1 parent c4bd693 commit c3f2da1

File tree

5 files changed

+671
-0
lines changed

5 files changed

+671
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
cmake_minimum_required(VERSION 3.20.0)
4+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
5+
project(central_otc)
6+
7+
target_sources(app PRIVATE
8+
src/main.c
9+
)
10+
11+
zephyr_library_include_directories(${ZEPHYR_BASE}/samples/bluetooth)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.. _central_otc:
2+
3+
Bluetooth: Central OTC
4+
######################
5+
6+
Overview
7+
********
8+
9+
Similar to the :ref:`Central <bluetooth_central>` sample, except that this
10+
application specifically looks for the OTS (Object Transfer) GATT Service.
11+
And this sample is to select object sequentially, to read metadata, to write data,
12+
to read data of selected ojects.
13+
14+
Requirements
15+
************
16+
17+
* A board with BLE support and 4 buttons.
18+
19+
Building and Running
20+
********************
21+
This sample can be found under :zephyr_file:`samples/bluetooth/central_otc` in the
22+
Zephyr tree.
23+
24+
See :ref:`bluetooth samples section <bluetooth-samples>` for details.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CONFIG_BT=y
2+
CONFIG_BT_CENTRAL=y
3+
CONFIG_BT_OTS=y
4+
CONFIG_BT_SMP=y
5+
CONFIG_BT_OTS_CLIENT=y
6+
# This example requires more workqueue stack
7+
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192
8+
9+
CONFIG_LOG=y
10+
CONFIG_ASSERT=y
11+
CONFIG_BT_L2CAP_TX_BUF_COUNT=8
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
sample:
2+
name: Bluetooth Central Object transfer client
3+
tests:
4+
sample.bluetooth.central_otc:
5+
harness: bluetooth
6+
platform_allow: nrf21540dk_nrf52840 nrf52840dk_nrf52840 nrf52833dk_nrf52833
7+
tags: bluetooth

0 commit comments

Comments
 (0)