Skip to content

Commit

Permalink
start
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Parfeniuk committed Aug 18, 2022
0 parents commit c74e5b0
Show file tree
Hide file tree
Showing 9 changed files with 545 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
7 changes: 7 additions & 0 deletions .vscode/nrf_settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"restructuredtext.confPath": "",
"cmake.configureArgs": [
"-DBOARD=jupiter_nrf5340_cpuapp",
"-DNO_BUILD_TYPE_WARNING=TRUE",
],
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"restructuredtext.confPath": "",
"cmake.configureArgs": [
"-DBOARD=nucleo_wb55rg",
"-DNO_BUILD_TYPE_WARNING=TRUE",
],
}
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(ibeacon)

target_sources(app PRIVATE src/main.c)

if(IBEACON_RSSI)
zephyr_compile_definitions(IBEACON_RSSI=${IBEACON_RSSI})
endif()
43 changes: 43 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.. _bluetooth-ibeacon-sample:

Bluetooth: iBeacon
##################

Overview
********

This simple application demonstrates the BLE Broadcaster role
functionality by advertising an Apple iBeacon. The calibrated RSSI @ 1
meter distance can be set using an IBEACON_RSSI build variable
(e.g. IBEACON_RSSI=0xb8 for -72 dBm RSSI @ 1 meter), or by manually
editing the default value in the ``main.c`` file.

Because of the hard-coded values of iBeacon UUID, major, and minor,
the application is not suitable for production use, but is quite
convenient for quick demonstrations of iBeacon functionality.

Requirements
************

* A board with Bluetooth LE support, or
* QEMU with BlueZ running on the host

Building and Running
********************

This sample can be found under :zephyr_file:`samples/bluetooth/ibeacon` in the
Zephyr tree.

See :ref:`bluetooth samples section <bluetooth-samples>` for details on how
to run the sample inside QEMU.

For other boards, build and flash the application as follows:

.. zephyr-app-commands::
:zephyr-app: samples/bluetooth/ibeacon
:board: <board>
:goals: flash
:compact:

Refer to your :ref:`board's documentation <boards>` for alternative
flash instructions if your board doesn't support the ``flash`` target.
7 changes: 7 additions & 0 deletions boards/nucleo_wb55rg.----overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* SPDX-License-Identifier: Apache-2.0 */
/*/ {
chosen {
zephyr,bt-mon-uart = &usart1;
zephyr,console = &lpuart1;
};
};*/
31 changes: 31 additions & 0 deletions prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
CONFIG_BT=y
#CONFIG_BT_DEBUG_LOG=y
#CONFIG_BT_LOG_LEVEL_INF=y
#CONFIG_DEBUG=y
#CONFIG_BT_DEBUG_HCI_CORE=y

CONFIG_LOG_BUFFER_SIZE=8192

CONFIG_BT_DEBUG_MONITOR_UART=y
#CONFIG_SERIAL=n
CONFIG_RTT_CONSOLE=y
CONFIG_USE_SEGGER_RTT=y
#CONFIG_UART_CONSOLE=n
#CONFIG_LOG=n

CONFIG_BT_EXT_ADV=y
#CONFIG_BT_EXT_ADV_LEGACY_SUPPORT=y
CONFIG_BT_EXT_ADV_MAX_ADV_SET=2
CONFIG_BT_ID_MAX=2

CONFIG_BT_DIS=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DIS=y
CONFIG_BT_MAX_CONN=16

CONFIG_DEBUG_OPTIMIZATIONS=y
CONFIG_IDLE_STACK_SIZE=2048
CONFIG_BT_RX_STACK_SIZE=4096
CONFIG_PRIVILEGED_STACK_SIZE=4096
CONFIG_MAIN_STACK_SIZE=4096

8 changes: 8 additions & 0 deletions sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sample:
description: Sample code for Zephyr iBeacon Demo
name: iBeacon
tests:
sample.bluetooth.ibeacon:
harness: bluetooth
platform_allow: bbc_microbit qemu_x86
tags: bluetooth
Loading

0 comments on commit c74e5b0

Please sign in to comment.