Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nrf noup] Versioning with VERSION file for matter implemented #370

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ config CHIP_DEVICE_HARDWARE_VERSION_STRING
hardware version string is exposed as an attribute of the Basic
Information cluster.

if "$(APPVERSION)"=""
Damian-Nordic marked this conversation as resolved.
Show resolved Hide resolved
LuDuda marked this conversation as resolved.
Show resolved Hide resolved
config CHIP_DEVICE_SOFTWARE_VERSION
int "Software version"
default 0
Expand All @@ -116,6 +117,7 @@ config CHIP_DEVICE_SOFTWARE_VERSION_STRING
software version string is exposed as an attribute of the Basic
Information cluster, and included in the header of the generated Matter
over-the-air (OTA) update image.
endif

config CHIP_DEVICE_MANUFACTURING_DATE
string "Manufacturing date (ISO 8601 format)"
Expand Down
39 changes: 27 additions & 12 deletions config/zephyr/ota-image.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,33 @@ function(chip_ota_image TARGET_NAME)
endif()

# Prepare ota_image_tool.py argument list
set(OTA_ARGS
"--vendor-id"
${CONFIG_CHIP_DEVICE_VENDOR_ID}
"--product-id"
${CONFIG_CHIP_DEVICE_PRODUCT_ID}
"--version"
${CONFIG_CHIP_DEVICE_SOFTWARE_VERSION}
"--version-str"
${CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING}
"--digest-algorithm"
"sha256"
)
if(DEFINED APPVERSION)
set(OTA_ARGS
"--vendor-id"
${CONFIG_CHIP_DEVICE_VENDOR_ID}
"--product-id"
${CONFIG_CHIP_DEVICE_PRODUCT_ID}
"--version"
${APPVERSION}
"--version-str"
${APP_VERSION_STRING}
"--digest-algorithm"
"sha256"
)
else()
set(OTA_ARGS
"--vendor-id"
${CONFIG_CHIP_DEVICE_VENDOR_ID}
"--product-id"
${CONFIG_CHIP_DEVICE_PRODUCT_ID}
"--version"
${CONFIG_CHIP_DEVICE_SOFTWARE_VERSION}
"--version-str"
${CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING}
"--digest-algorithm"
"sha256"
)
endif()

separate_arguments(OTA_EXTRA_ARGS NATIVE_COMMAND "${CHIP_OTA_IMAGE_EXTRA_ARGS}")

Expand Down
11 changes: 11 additions & 0 deletions src/platform/nrfconnect/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

#pragma once

#ifndef CONFIG_CHIP_DEVICE_SOFTWARE_VERSION
#include "app_version.h"
#endif
#include "autoconf.h"

// ==================== Platform Adaptations ====================
Expand Down Expand Up @@ -80,11 +83,19 @@
#endif

#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION
#ifdef CONFIG_CHIP_DEVICE_SOFTWARE_VERSION
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION CONFIG_CHIP_DEVICE_SOFTWARE_VERSION
#else
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION APPVERSION
#endif
#endif

#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING
#ifdef CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING
#else
#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING APP_VERSION_STRING
#endif
#endif

#ifdef CONFIG_NET_L2_OPENTHREAD
Expand Down
Loading