22# . ~/esp/esp-idf-v5.5.4/export.sh && . $ESP_MATTER_PATH/export.sh
33# idf.py set-target esp32 && idf.py build flash monitor
44cmake_minimum_required (VERSION 3.16 )
5- set (PROJECT_VER "1.0.7 " )
5+ set (PROJECT_VER "1.0.8 " )
66
77# Unified versioning (issue #77): the Matter softwareVersion INT is DERIVED from PROJECT_VER --
88# MAJOR*10000+MINOR*100+PATCH -> a readable, strictly-monotonic uint32. This keeps the human
@@ -15,6 +15,14 @@ list(GET _ver_parts 1 _ver_minor)
1515list (GET _ver_parts 2 _ver_patch)
1616math (EXPR PROJECT_VER_INT "${_ver_major} *10000 + ${_ver_minor} *100 + ${_ver_patch} " )
1717
18+ # esp-matter's build reads PROJECT_VER_NUMBER (NOT our PROJECT_VER_INT) to set the GN arg
19+ # chip_config_software_version_number -> CHIP_CONFIG_SOFTWARE_VERSION_NUMBER, and that macro is what
20+ # ESP32 ConfigurationManagerImpl::GetSoftwareVersion() returns -- i.e. the BasicInformation
21+ # SoftwareVersion attribute (0/40/9) that HA + Matter OTA see. esp-matter/CMakeLists.txt defaults it
22+ # to 0 when PROJECT_VER_NUMBER is undefined, which is why the device reported softwareVersion 0
23+ # despite the correct semver string. Define the name esp-matter looks for. (issue #77)
24+ set (PROJECT_VER_NUMBER ${PROJECT_VER_INT} )
25+
1826if (NOT DEFINED ENV{ESP_MATTER_PATH})
1927 message (FATAL_ERROR "ESP_MATTER_PATH not set -- run: . <esp-matter>/export.sh" )
2028endif ()
@@ -48,9 +56,9 @@ idf_build_set_property(COMPILE_OPTIONS "-Wno-format-nonliteral;-Wno-format-secur
4856# keeps the literal path out of this tracked file; everything (IDF, esp-matter, project) sits under it.
4957idf_build_set_property (COMPILE_OPTIONS "-ffile-prefix-map=$ENV{HOME} =/build" APPEND )
5058
51- # Force the Matter softwareVersion int from PROJECT_VER (issue #77). Wins over sdkconfig's
52- # CONFIG_DEVICE_SOFTWARE_VERSION_NUMBER because CHIPDeviceConfig.h guards the macro with #ifndef,
53- # so the OTA int can never drift from the semver. (The string stays in sdkconfig.defaults, kept
54- # equal to PROJECT_VER.)
59+ # Also pin CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION (a DIFFERENT macro from the
60+ # CHIP_CONFIG_SOFTWARE_VERSION_NUMBER above that GetSoftwareVersion actually returns) for the CHIP
61+ # code paths that read it (e.g. some OTA-requestor defaults). Belt-and-suspenders; the reported
62+ # softwareVersion attribute comes from PROJECT_VER_NUMBER -> chip_config_software_version_number.
5563idf_build_set_property (COMPILE_DEFINITIONS "CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION=${PROJECT_VER_INT} " APPEND )
5664message (STATUS "hisense: Matter softwareVersion ${PROJECT_VER_INT} (\" ${PROJECT_VER} \" ) [issue #77]" )
0 commit comments