Skip to content

Commit

Permalink
tlv: add generic TLV parser/writer
Browse files Browse the repository at this point in the history
create module to handle TLV data with flexible backend
The implementation alow to handle TLV data stored in FLASH and
in RAM Buffers. The API is open for new backend implementations.

Those two backends are needed for handling the mfg data.

Signed-off-by: Robert Gałat <[email protected]>
  • Loading branch information
RobertGalatNordic committed Jul 26, 2024
1 parent 22eaa93 commit 0fa2a80
Show file tree
Hide file tree
Showing 14 changed files with 928 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/unit_tests/tlv/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Copyright (c) 2023 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
set(SIDEWALK_BASE $ENV{ZEPHYR_BASE}/../sidewalk)

project(device)

FILE(GLOB app_sources src/*.c)

target_sources(app PRIVATE
${app_sources}
${SIDEWALK_BASE}/utils/tlv/tlv.c
${SIDEWALK_BASE}/utils/tlv/tlv_ram_storage_impl.c
)

target_include_directories(app PRIVATE
.
src
${SIDEWALK_BASE}/utils/include
)
8 changes: 8 additions & 0 deletions tests/unit_tests/tlv/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Copyright (c) 2023 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

source "${ZEPHYR_BASE}/../sidewalk/utils/Kconfig"
source "Kconfig.zephyr"
9 changes: 9 additions & 0 deletions tests/unit_tests/tlv/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# Copyright (c) 2023 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
CONFIG_ZTEST=y
CONFIG_SIDEWALK_TLV=y
CONFIG_SIDEWALK_TLV_RAM=y
CONFIG_SIDEWALK_TLV_FLASH=n
Loading

0 comments on commit 0fa2a80

Please sign in to comment.