-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
samples: Bluetooth: add peripheral_esl and central_esl sample
Add a sample running electronic shelf label service as tag role. The sample use LED on DKs to simulate EPD display. This sample provides real EPD reference code as well. Add a sample running esl client as AP role. Signed-off-by: Pirun Lee <pirun.lee@nordicsemi.no>
- Loading branch information
Showing
61 changed files
with
5,217 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 24 additions & 24 deletions
48
doc/nrf/libraries/bluetooth_services/services/esl_client.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
# Copyright (c) 2022 Nordic Semiconductor | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
cmake_minimum_required(VERSION 3.20.0) | ||
|
||
# The application uses the conf/<board> scheme for configuration files. | ||
#set(APPLICATION_CONFIG_DIR "${CMAKE_CURRENT_SOURCE_DIR}/conf/\${BOARD}") | ||
|
||
set(PM_STATIC_YML_FILE | ||
#"${CMAKE_CURRENT_SOURCE_DIR}/conf/\${BOARD}/pm_static_${BOARD}.yml" | ||
${CMAKE_CURRENT_SOURCE_DIR}/boards/pm_static_${BOARD}.yml | ||
) | ||
|
||
list(APPEND hci_rpmsg_b0n_OVERLAY_CONFIG overlay-minimal-size.conf) | ||
|
||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
project(central_esl) | ||
|
||
# NORDIC SDK APP START | ||
target_sources(app PRIVATE | ||
src/main.c | ||
) | ||
zephyr_library_include_directories(.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# | ||
# Copyright (c) 2022 Nordic Semiconductor | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
source "Kconfig.zephyr" | ||
|
||
menu "Nordic ESL BLE GATT service client sample" | ||
|
||
config BT_ESL_CLIENT_THREAD_STACK_SIZE | ||
int "Thread stack size" | ||
default 1024 | ||
help | ||
Stack size used in each of the two threads | ||
|
||
config BT_ESL_SECURITY_ENABLED | ||
bool "Enable security" | ||
select BT_SMP | ||
select BT_BONDABLE | ||
select BT_BONDING_REQUIRED | ||
help | ||
"Enable BLE security for the ESL service" | ||
|
||
config BT_ESL_AP_AUTO_MODE | ||
bool "AP auto onboarding Tag mode" | ||
help | ||
"When enabled, AP auto scans and configures the tag. When disabled, AP only accepts shell commands" | ||
|
||
if BT_ESL_AP_AUTO_MODE | ||
config BT_ESL_AP_AUTO_TAG_PER_GROUP | ||
int "Tag per group" | ||
default ESL_CLIENT_MAX_RESPONSE_SLOT_BUFFER | ||
help | ||
"The number of tags to be kept in same group for auto onboarding. | ||
Tags exceeding this number are placed in next group. | ||
Otherwise, response key is not enough for all tags in same group. | ||
How to select this number depends on the desired scenario. | ||
Less or equal to ESL_CLIENT_MAX_RESPONSE_SLOT_BUFFER decrypts the response EAD on the fly. | ||
Greater than ESL_CLIENT_MAX_RESPONSE_SLOT_BUFFER enables the ESL AP to control large amount of tags at the same time." | ||
|
||
config BT_ESL_AP_GROUP_PER_BUTTON | ||
int "Groups for one button" | ||
default 3 | ||
help | ||
"The number of groups controlled by one button. | ||
If this number is greater than 1, an AP can control multiple groups by one button. | ||
Otherwise, an AP controls one group by one button." | ||
endif | ||
|
||
config BT_ESL_AP_AUTO_PAST_TAG | ||
bool "AP auto past mode" | ||
help | ||
"When enabled, the AP sends automatic update complete command and PAST to an unsynchronized tag. When disabled, the AP only accepts shell commands." | ||
|
||
config BT_ESL_AP_PTS | ||
bool "ESL access point for PTS test" | ||
help | ||
Enable PTS test for ESL access point | ||
|
||
module = CENTRAL_ESL | ||
module-str = central esl | ||
source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config" | ||
endmenu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.. _central_esl: | ||
|
||
Bluetooth: Central ESL | ||
###################### | ||
|
||
The Central ESL sample demonstrates how to use the :ref:`esl_service_client_readme` library. | ||
|
||
See the subpages for detailed documentation on the sample and its features. | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:caption: Subpages: | ||
|
||
sample_description.rst | ||
central_esl_subcommands.rst |
42 changes: 42 additions & 0 deletions
42
samples/bluetooth/central_esl/boards/nrf21540dk_nrf52840.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# | ||
# Copyright (c) 2023 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
# External Flash for TAG OTS image storage | ||
# Need this when storage is on flash | ||
CONFIG_MPU_ALLOW_FLASH_WRITE=y | ||
|
||
CONFIG_FLASH=y | ||
CONFIG_FLASH_MAP=y | ||
CONFIG_FLASH_PAGE_LAYOUT=y | ||
CONFIG_FILE_SYSTEM=y | ||
CONFIG_FILE_SYSTEM_LITTLEFS=y | ||
CONFIG_FILE_SYSTEM_SHELL=y | ||
CONFIG_RESET_ON_FATAL_ERROR=n | ||
CONFIG_ESL_CLIENT_MAX_GROUP=64 | ||
|
||
# ESL AP two CDC uart, one for command, one for SMP | ||
CONFIG_USB_DEVICE_STACK=y | ||
CONFIG_USB_DEVICE_PRODUCT="Nordic ESL Access Point sample" | ||
CONFIG_UART_LINE_CTRL=y | ||
|
||
# LOG | ||
# CONFIG_MCUBOOT_UTIL_LOG_LEVEL_WRN=y | ||
# CONFIG_MCUMGR_LOG_LEVEL_DBG=y | ||
# CONFIG_BT_DEBUG_OTS_CLIENT=y | ||
# CONFIG_BT_OTS_CLIENT_LOG_LEVEL_DBG=y | ||
|
||
# PAWR timing | ||
CONFIG_BT_CTLR_SDC_PAWR_ADV_COUNT=1 | ||
CONFIG_BT_CTLR_SDC_PERIODIC_ADV_RSP_TX_BUFFER_COUNT=3 | ||
CONFIG_BT_CTLR_SDC_PERIODIC_ADV_RSP_RX_BUFFER_COUNT=12 | ||
CONFIG_BT_PER_ADV_SYNC_MAX=1 | ||
CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=2500 | ||
CONFIG_BT_BUF_ACL_RX_SIZE=502 | ||
CONFIG_BT_BUF_CMD_TX_SIZE=255 | ||
CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=255 | ||
CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT=0 | ||
CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=73 | ||
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y |
Oops, something went wrong.