From 4906757d1c0fabbae391af4fbcb06a4f4b5222e6 Mon Sep 17 00:00:00 2001 From: Markus Becker Date: Thu, 25 Nov 2021 15:25:51 +0100 Subject: [PATCH] Use serial number and manufacturing date in Basic Cluster (#10706) * Use serial number and manufacturing date in Basic Cluster Basic Cluster is usually using the values from the zap file. This means that all devices will have the same Serial Number and ManufacturingDate. At least Serial Number and Manufacturing Date should be taken from ConfigurationMgr. Also: * Use descriptive values for char arrays in basic cluster. * Fix-up software and hardware version to match names in specification. Co-authored-by: Boris Zbarsky * regenerated file Co-authored-by: Boris Zbarsky --- .github/.wordlist.txt | 3 +- config/esp32/components/chip/Kconfig | 20 ++++---- docs/guides/nrfconnect_examples_cli.md | 8 +-- .../guides/python_chip_controller_building.md | 2 +- .../p6/include/CHIPProjectConfig.h | 20 ++++---- examples/all-clusters-app/p6/src/AppTask.cpp | 2 +- examples/common/pigweed/rpc_services/Device.h | 21 +++++++- .../efr32/include/CHIPProjectConfig.h | 18 +++---- examples/lighting-app/efr32/src/AppTask.cpp | 2 +- .../k32w/k32w0/include/CHIPProjectConfig.h | 26 +++++----- .../nxp/k32w/k32w0/main/AppTask.cpp | 6 +-- examples/lighting-app/qpg/src/AppTask.cpp | 2 +- .../main/include/CHIPProjectConfig.h | 18 +++---- .../efr32/include/CHIPProjectConfig.h | 18 +++---- examples/lock-app/efr32/src/AppTask.cpp | 2 +- .../k32w/k32w0/include/CHIPProjectConfig.h | 26 +++++----- .../lock-app/nxp/k32w/k32w0/main/AppTask.cpp | 6 +-- .../lock-app/p6/include/CHIPProjectConfig.h | 18 +++---- examples/lock-app/p6/src/AppTask.cpp | 2 +- examples/lock-app/qpg/src/AppTask.cpp | 2 +- .../include/CHIPProjectConfig.h | 18 +++---- .../efr32/include/CHIPProjectConfig.h | 18 +++---- .../efr32/include/CHIPProjectConfig.h | 18 +++---- .../qpg/project_include/CHIPProjectConfig.h | 18 +++---- .../main/include/CHIPProjectConfig.h | 18 +++---- .../main/include/CHIPProjectConfig.h | 18 +++---- examples/shell/README_DEVICE.md | 4 +- .../shell/efr32/include/CHIPProjectConfig.h | 18 +++---- .../k32w/k32w0/include/CHIPProjectConfig.h | 26 +++++----- .../shell/nxp/k32w/k32w0/main/AppTask.cpp | 6 +-- .../efr32/include/CHIPProjectConfig.h | 18 +++---- src/app/clusters/basic/basic.cpp | 51 +++++++++++++------ src/include/platform/CHIPDeviceConfig.h | 34 ++++++------- src/include/platform/ConfigurationManager.h | 25 ++++++--- .../GenericConfigurationManagerImpl.cpp | 34 ++++++------- .../GenericConfigurationManagerImpl.h | 14 ++--- src/lib/shell/commands/Config.cpp | 14 ++--- src/platform/Ameba/AmebaConfig.cpp | 2 +- src/platform/Ameba/AmebaConfig.h | 2 +- src/platform/Darwin/PosixConfig.cpp | 2 +- src/platform/Darwin/PosixConfig.h | 2 +- src/platform/EFR32/EFR32Config.h | 2 +- src/platform/ESP32/CHIPDevicePlatformConfig.h | 4 +- src/platform/ESP32/ESP32Config.cpp | 2 +- src/platform/ESP32/ESP32Config.h | 2 +- src/platform/Linux/PosixConfig.cpp | 2 +- src/platform/Linux/PosixConfig.h | 2 +- src/platform/P6/P6Config.cpp | 2 +- src/platform/P6/P6Config.h | 2 +- src/platform/Tizen/PosixConfig.cpp | 2 +- src/platform/Tizen/PosixConfig.h | 2 +- src/platform/Zephyr/ZephyrConfig.cpp | 2 +- src/platform/Zephyr/ZephyrConfig.h | 2 +- src/platform/android/AndroidConfig.cpp | 2 +- src/platform/android/AndroidConfig.h | 2 +- .../chip/platform/ConfigurationManager.java | 2 +- .../cc13x2_26x2/CC13X2_26X2Config.cpp | 2 +- src/platform/cc13x2_26x2/CC13X2_26X2Config.h | 2 +- src/platform/fake/ConfigurationManagerImpl.h | 10 ++-- src/platform/mbed/MbedConfig.cpp | 2 +- src/platform/mbed/MbedConfig.h | 2 +- src/platform/nxp/k32w/k32w0/K32W0Config.h | 2 +- src/platform/qpg/qpgConfig.h | 2 +- src/platform/tests/TestConfigurationMgr.cpp | 12 ++--- .../efr32/include/CHIPProjectConfig.h | 18 +++---- 65 files changed, 356 insertions(+), 310 deletions(-) diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 871d66ee2d8c53..9e5d03248c6df2 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -430,6 +430,7 @@ Gv gz hardcoded hardknott +hardwarever HardwareVersion HardwareVersionString hci @@ -743,8 +744,6 @@ prj ProductID ProductLabel ProductName -productrev -ProductRevision ProductURL proto protobuf diff --git a/config/esp32/components/chip/Kconfig b/config/esp32/components/chip/Kconfig index 904c657f6bf1df..3ab41d517b8a50 100644 --- a/config/esp32/components/chip/Kconfig +++ b/config/esp32/components/chip/Kconfig @@ -400,26 +400,26 @@ menu "CHIP Device Layer" The device product id (in hex). This is a unique id assigned by the device vendor to identify the product or device type. Defaults to a CHIP-assigned id designating a non-production or test "product". - config DEFAULT_DEVICE_PRODUCT_REVISION - int "Default Device Product Revision" + config DEFAULT_DEVICE_HARDWARE_VERSION + int "Default Device Hardware Version" range 0 65535 default 0 help - The default device product revision. + The default device hardware version. - Product revisions are specific to a particular device vendor and product id, and typically - correspond to a revision of the physical device, a change to its packaging, and/or a change + Hardware versions are specific to a particular device vendor and product id, and typically + correspond to a version of the physical device, a change to its packaging, and/or a change to its marketing presentation. This value is generally *not* incremented for device software - revisions. + versions. - This is a default value which is used when a product revision has not been stored in device + This is a default value which is used when a hardware version has not been stored in device persistent storage (e.g. by a factory provisioning process). - config DEVICE_FIRMWARE_REVISION - string "Device Firmware Revision" + config DEVICE_SOFTWARE_VERSION + string "Device Software Version" default "" help - A string identifying the firmware revision running on the device. + A string identifying the software version running on the device. config DEVICE_TYPE int "Default Device type" diff --git a/docs/guides/nrfconnect_examples_cli.md b/docs/guides/nrfconnect_examples_cli.md index 056fda2ebadf71..5ac2589113d678 100644 --- a/docs/guides/nrfconnect_examples_cli.md +++ b/docs/guides/nrfconnect_examples_cli.md @@ -163,7 +163,7 @@ available configuration data or to add a specific subcommand. ```shell VendorId: 9050 (0x235A) ProductId: 20043 (0x4E4B) -ProductRevision: 1 (0x1) +HardwareVersion: 1 (0x1) FabricId: PinCode: 020202021 Discriminator: f00 @@ -208,12 +208,12 @@ uart:~$ matter config productid 20043 (0x4E4B) ``` -#### productrev +#### hardwarever -Prints the product revision of the device. Takes no arguments. +Prints the hardware version of the device. Takes no arguments. ```shell -uart:~$ matter config productrev +uart:~$ matter config hardwarever 1 (0x1) ``` diff --git a/docs/guides/python_chip_controller_building.md b/docs/guides/python_chip_controller_building.md index 8542bbfc434117..c3f9d65eac0f5f 100644 --- a/docs/guides/python_chip_controller_building.md +++ b/docs/guides/python_chip_controller_building.md @@ -155,7 +155,7 @@ I: 254 [DL]Device Configuration: I: 257 [DL] Serial Number: TEST_SN I: 260 [DL] Vendor Id: 9050 (0x235A) I: 263 [DL] Product Id: 20043 (0x4E4B) -I: 267 [DL] Product Revision: 1 +I: 267 [DL] Hardware Version: 1 I: 270 [DL] Setup Pin Code: 20202021 I: 273 [DL] Setup Discriminator: 3840 (0xF00) I: 278 [DL] Manufacturing Date: (not set) diff --git a/examples/all-clusters-app/p6/include/CHIPProjectConfig.h b/examples/all-clusters-app/p6/include/CHIPProjectConfig.h index a09d73cfe0f276..94c068c5d18f44 100644 --- a/examples/all-clusters-app/p6/include/CHIPProjectConfig.h +++ b/examples/all-clusters-app/p6/include/CHIPProjectConfig.h @@ -48,24 +48,24 @@ #define CHIP_CONFIG_REQUIRE_AUTH 1 /** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * - * The product revision number assigned to device or product by the device vendor. This - * number is scoped to the device product id, and typically corresponds to a revision of the + * The hardware version number assigned to device or product by the device vendor. This + * number is scoped to the device product id, and typically corresponds to a version of the * physical device, a change to its packaging, and/or a change to its marketing presentation. - * This value is generally *not* incremented for device software revisions. + * This value is generally *not* incremented for device software versions. */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 1 +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1 /** - * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING * - * A string identifying the firmware revision running on the device. - * CHIP service currently expects the firmware version to be in the format + * A string identifying the software version running on the device. + * CHIP service currently expects the software version to be in the format * {MAJOR_VERSION}.0d{MINOR_VERSION} */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "0.1ALPHA" +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "0.1ALPHA" #endif /** * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE diff --git a/examples/all-clusters-app/p6/src/AppTask.cpp b/examples/all-clusters-app/p6/src/AppTask.cpp index 9dbb22fd3eb8c9..e2ce865f6fc39f 100644 --- a/examples/all-clusters-app/p6/src/AppTask.cpp +++ b/examples/all-clusters-app/p6/src/AppTask.cpp @@ -107,7 +107,7 @@ CHIP_ERROR AppTask::Init() // Initialise WSTK buttons PB0 and PB1 (including debounce). ButtonHandler::Init(); - P6_LOG("Current Firmware Version: %s", CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING); + P6_LOG("Current Software Version: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING); // Initialize LEDs sStatusLED.Init(SYSTEM_STATE_LED); diff --git a/examples/common/pigweed/rpc_services/Device.h b/examples/common/pigweed/rpc_services/Device.h index 289fe7438fc55f..a02170dbcae165 100644 --- a/examples/common/pigweed/rpc_services/Device.h +++ b/examples/common/pigweed/rpc_services/Device.h @@ -73,23 +73,36 @@ class Device : public generated::Device virtual pw::Status GetDeviceInfo(ServerContext &, const pw_protobuf_Empty & request, chip_rpc_DeviceInfo & response) { + uint16_t vendor_id; if (DeviceLayer::ConfigurationMgr().GetVendorId(vendor_id) == CHIP_NO_ERROR) { response.vendor_id = static_cast(vendor_id); } + else + { + response.vendor_id = CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID; + } uint16_t product_id; if (DeviceLayer::ConfigurationMgr().GetProductId(product_id) == CHIP_NO_ERROR) { response.product_id = static_cast(product_id); } + else + { + response.product_id = CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID; + } uint16_t software_version; - if (DeviceLayer::ConfigurationMgr().GetFirmwareRevision(software_version) == CHIP_NO_ERROR) + if (DeviceLayer::ConfigurationMgr().GetSoftwareVersion(software_version) == CHIP_NO_ERROR) { response.software_version = software_version; } + else + { + response.software_version = CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION; + } uint32_t code; if (DeviceLayer::ConfigurationMgr().GetSetupPinCode(code) == CHIP_NO_ERROR) @@ -105,7 +118,11 @@ class Device : public generated::Device response.has_pairing_info = true; } - DeviceLayer::ConfigurationMgr().GetSerialNumber(response.serial_number, sizeof(response.serial_number)); + if (DeviceLayer::ConfigurationMgr().GetSerialNumber(response.serial_number, sizeof(response.serial_number)) != + CHIP_NO_ERROR) + { + snprintf(response.serial_number, sizeof(response.serial_number), CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER); + } return pw::OkStatus(); } diff --git a/examples/lighting-app/efr32/include/CHIPProjectConfig.h b/examples/lighting-app/efr32/include/CHIPProjectConfig.h index 04ffebbbca202d..230adaefeae985 100644 --- a/examples/lighting-app/efr32/include/CHIPProjectConfig.h +++ b/examples/lighting-app/efr32/include/CHIPProjectConfig.h @@ -61,24 +61,24 @@ #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x534C /** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * - * The product revision number assigned to device or product by the device vendor. This + * The hardware version number assigned to device or product by the device vendor. This * number is scoped to the device product id, and typically corresponds to a revision of the * physical device, a change to its packaging, and/or a change to its marketing presentation. - * This value is generally *not* incremented for device software revisions. + * This value is generally *not* incremented for device software versions. */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 1 +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1 /** - * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING * - * A string identifying the firmware revision running on the device. - * CHIP service currently expects the firmware version to be in the format + * A string identifying the software version running on the device. + * CHIP service currently expects the software version to be in the format * {MAJOR_VERSION}.0d{MINOR_VERSION} */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "0.1ALPHA" +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "0.1ALPHA" #endif /** * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE diff --git a/examples/lighting-app/efr32/src/AppTask.cpp b/examples/lighting-app/efr32/src/AppTask.cpp index eb47d0ce51c497..53a7963fd95f9a 100644 --- a/examples/lighting-app/efr32/src/AppTask.cpp +++ b/examples/lighting-app/efr32/src/AppTask.cpp @@ -173,7 +173,7 @@ CHIP_ERROR AppTask::Init() appError(APP_ERROR_CREATE_TIMER_FAILED); } - EFR32_LOG("Current Firmware Version: %s", CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING); + EFR32_LOG("Current Software Version: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING); err = LightMgr().Init(); if (err != CHIP_NO_ERROR) { diff --git a/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h index b7dbf2fc2ebbf3..93d0990a3fea55 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -65,32 +65,32 @@ #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x4B4C /** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * - * The product revision number assigned to device or product by the device vendor. This + * The hardware version number assigned to device or product by the device vendor. This * number is scoped to the device product id, and typically corresponds to a revision of the * physical device, a change to its packaging, and/or a change to its marketing presentation. - * This value is generally *not* incremented for device software revisions. + * This value is generally *not* incremented for device software versions. */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 100 +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 100 -#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION_STRING "v0.1.0" +#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING "v0.1.0" #endif /** - * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING * - * A string identifying the firmware revision running on the device. - * CHIP currently expects the firmware version to be in the format + * A string identifying the software version running on the device. + * CHIP currently expects the software version to be in the format * {MAJOR_VERSION}.0d{MINOR_VERSION} */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "04-2020-te2" +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "04-2020-te2" #endif -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION 42020 +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION 42020 #endif #ifndef CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME diff --git a/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp index db5e5c3eeec8b9..df21c05d4006ed 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp +++ b/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp @@ -134,15 +134,15 @@ CHIP_ERROR AppTask::Init() } // Print the current software version - char currentFirmwareRev[ConfigurationManager::kMaxFirmwareRevisionLength + 1] = { 0 }; - err = ConfigurationMgr().GetFirmwareRevisionString(currentFirmwareRev, sizeof(currentFirmwareRev)); + char currentSoftwareVer[ConfigurationManager::kMaxSoftwareVersionLength + 1] = { 0 }; + err = ConfigurationMgr().GetSoftwareVersionString(currentSoftwareVer, sizeof(currentSoftwareVer)); if (err != CHIP_NO_ERROR) { K32W_LOG("Get version error"); assert(err == CHIP_NO_ERROR); } - K32W_LOG("Current Firmware Version: %s", currentFirmwareRev); + K32W_LOG("Current Software Version: %s", currentSoftwareVer); #if CONFIG_CHIP_NFC_COMMISSIONING PlatformMgr().AddEventHandler(ThreadProvisioningHandler, 0); diff --git a/examples/lighting-app/qpg/src/AppTask.cpp b/examples/lighting-app/qpg/src/AppTask.cpp index 4d55f3be890ff7..7af78f1dfe1253 100644 --- a/examples/lighting-app/qpg/src/AppTask.cpp +++ b/examples/lighting-app/qpg/src/AppTask.cpp @@ -85,7 +85,7 @@ CHIP_ERROR AppTask::Init() { CHIP_ERROR err = CHIP_NO_ERROR; - ChipLogProgress(NotSpecified, "Current Firmware Version: %s", CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING); + ChipLogProgress(NotSpecified, "Current Software Version: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING); err = LightingMgr().Init(); if (err != CHIP_NO_ERROR) diff --git a/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h b/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h index 659dd91a99f672..ade0aa02ee2ca9 100644 --- a/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h +++ b/examples/lock-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h @@ -83,24 +83,24 @@ #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x434B /** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * - * The product revision number assigned to device or product by the device vendor. This + * The hardware version number assigned to device or product by the device vendor. This * number is scoped to the device product id, and typically corresponds to a revision of the * physical device, a change to its packaging, and/or a change to its marketing presentation. - * This value is generally *not* incremented for device software revisions. + * This value is generally *not* incremented for device software versions. */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 1 +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1 /** - * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING * - * A string identifying the firmware revision running on the device. - * CHIP currently expects the firmware version to be in the format + * A string identifying the software version running on the device. + * CHIP currently expects the software version to be in the format * {MAJOR_VERSION}.0d{MINOR_VERSION} */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "1.0d1" +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "1.0d1" #endif /** * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE diff --git a/examples/lock-app/efr32/include/CHIPProjectConfig.h b/examples/lock-app/efr32/include/CHIPProjectConfig.h index 931f6a0403a9eb..4fdc0865b0e22c 100644 --- a/examples/lock-app/efr32/include/CHIPProjectConfig.h +++ b/examples/lock-app/efr32/include/CHIPProjectConfig.h @@ -58,24 +58,24 @@ #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x534B /** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * - * The product revision number assigned to device or product by the device vendor. This + * The hardware version number assigned to device or product by the device vendor. This * number is scoped to the device product id, and typically corresponds to a revision of the * physical device, a change to its packaging, and/or a change to its marketing presentation. - * This value is generally *not* incremented for device software revisions. + * This value is generally *not* incremented for device software versions. */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 1 +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1 /** - * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING * - * A string identifying the firmware revision running on the device. - * CHIP service currently expects the firmware version to be in the format + * A string identifying the software version running on the device. + * CHIP service currently expects the software version to be in the format * {MAJOR_VERSION}.0d{MINOR_VERSION} */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "0.1ALPHA" +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "0.1ALPHA" #endif /** * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE diff --git a/examples/lock-app/efr32/src/AppTask.cpp b/examples/lock-app/efr32/src/AppTask.cpp index 5362cccf84cf3a..0a67f008a94317 100644 --- a/examples/lock-app/efr32/src/AppTask.cpp +++ b/examples/lock-app/efr32/src/AppTask.cpp @@ -117,7 +117,7 @@ CHIP_ERROR AppTask::Init() appError(APP_ERROR_CREATE_TIMER_FAILED); } - EFR32_LOG("Current Firmware Version: %s", CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING); + EFR32_LOG("Current Software Version: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING); CHIP_ERROR err = BoltLockMgr().Init(); if (err != CHIP_NO_ERROR) { diff --git a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h index 55abba7d4b2f1a..a9446d8c70a984 100644 --- a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -65,32 +65,32 @@ #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x4B4C /** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * - * The product revision number assigned to device or product by the device vendor. This + * The hardware version number assigned to device or product by the device vendor. This * number is scoped to the device product id, and typically corresponds to a revision of the * physical device, a change to its packaging, and/or a change to its marketing presentation. - * This value is generally *not* incremented for device software revisions. + * This value is generally *not* incremented for device software versions. */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 100 +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 100 -#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION_STRING "v0.1.0" +#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING "v0.1.0" #endif /** - * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING * - * A string identifying the firmware revision running on the device. - * CHIP currently expects the firmware version to be in the format + * A string identifying the software version running on the device. + * CHIP currently expects the software version to be in the format * {MAJOR_VERSION}.0d{MINOR_VERSION} */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "04-2020-te2" +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "04-2020-te2" #endif -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION 42020 +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION 42020 #endif #ifndef CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME diff --git a/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp index 44c3beb3bd4945..c44f83a41b499d 100644 --- a/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp +++ b/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp @@ -141,8 +141,8 @@ CHIP_ERROR AppTask::Init() } // Print the current software version - char currentFirmwareRev[ConfigurationManager::kMaxFirmwareRevisionLength + 1] = { 0 }; - err = ConfigurationMgr().GetFirmwareRevisionString(currentFirmwareRev, sizeof(currentFirmwareRev)); + char currentSoftwareVer[ConfigurationManager::kMaxSoftwareVersionLength + 1] = { 0 }; + err = ConfigurationMgr().GetSoftwareVersionString(currentSoftwareVer, sizeof(currentSoftwareVer)); if (err != CHIP_NO_ERROR) { K32W_LOG("Get version error"); @@ -153,7 +153,7 @@ CHIP_ERROR AppTask::Init() PlatformMgr().AddEventHandler(ThreadProvisioningHandler, 0); #endif - K32W_LOG("Current Firmware Version: %s", currentFirmwareRev); + K32W_LOG("Current Software Version: %s", currentSoftwareVer); return err; } diff --git a/examples/lock-app/p6/include/CHIPProjectConfig.h b/examples/lock-app/p6/include/CHIPProjectConfig.h index 4d981fb1fc2b2b..cade0849059233 100644 --- a/examples/lock-app/p6/include/CHIPProjectConfig.h +++ b/examples/lock-app/p6/include/CHIPProjectConfig.h @@ -44,24 +44,24 @@ #define CHIP_CONFIG_REQUIRE_AUTH 1 /** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * - * The product revision number assigned to device or product by the device vendor. This + * The hardware version number assigned to device or product by the device vendor. This * number is scoped to the device product id, and typically corresponds to a revision of the * physical device, a change to its packaging, and/or a change to its marketing presentation. - * This value is generally *not* incremented for device software revisions. + * This value is generally *not* incremented for device software versions. */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 1 +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1 /** - * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING * - * A string identifying the firmware revision running on the device. - * CHIP service currently expects the firmware version to be in the format + * A string identifying the software version running on the device. + * CHIP service currently expects the software version to be in the format * {MAJOR_VERSION}.0d{MINOR_VERSION} */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "0.1ALPHA" +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "0.1ALPHA" #endif /** * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE diff --git a/examples/lock-app/p6/src/AppTask.cpp b/examples/lock-app/p6/src/AppTask.cpp index 2cbcc307d0f775..0729aea5f97816 100644 --- a/examples/lock-app/p6/src/AppTask.cpp +++ b/examples/lock-app/p6/src/AppTask.cpp @@ -122,7 +122,7 @@ CHIP_ERROR AppTask::Init() appError(APP_ERROR_CREATE_TIMER_FAILED); } - P6_LOG("Current Firmware Version: %d", CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION); + P6_LOG("Current Software Version: %d", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION); err = BoltLockMgr().Init(); if (err != CHIP_NO_ERROR) { diff --git a/examples/lock-app/qpg/src/AppTask.cpp b/examples/lock-app/qpg/src/AppTask.cpp index 451f39a38bd82a..4b4cb900e9fb8b 100644 --- a/examples/lock-app/qpg/src/AppTask.cpp +++ b/examples/lock-app/qpg/src/AppTask.cpp @@ -86,7 +86,7 @@ CHIP_ERROR AppTask::Init() { CHIP_ERROR err = CHIP_NO_ERROR; - ChipLogProgress(NotSpecified, "Current Firmware Version: %s", CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING); + ChipLogProgress(NotSpecified, "Current Software Version: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING); err = BoltLockMgr().Init(); if (err != CHIP_NO_ERROR) diff --git a/examples/persistent-storage/cc13x2x7_26x2x7/include/CHIPProjectConfig.h b/examples/persistent-storage/cc13x2x7_26x2x7/include/CHIPProjectConfig.h index 4c2539ae39331d..46f509cb858528 100644 --- a/examples/persistent-storage/cc13x2x7_26x2x7/include/CHIPProjectConfig.h +++ b/examples/persistent-storage/cc13x2x7_26x2x7/include/CHIPProjectConfig.h @@ -83,24 +83,24 @@ #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x434B /** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * - * The product revision number assigned to device or product by the device vendor. This + * The hardware version number assigned to device or product by the device vendor. This * number is scoped to the device product id, and typically corresponds to a revision of the * physical device, a change to its packaging, and/or a change to its marketing presentation. - * This value is generally *not* incremented for device software revisions. + * This value is generally *not* incremented for device software versions. */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 1 +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1 /** - * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING * - * A string identifying the firmware revision running on the device. - * CHIP currently expects the firmware version to be in the format + * A string identifying the software version running on the device. + * CHIP currently expects the software version to be in the format * {MAJOR_VERSION}.0d{MINOR_VERSION} */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "1.0d1" +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "1.0d1" #endif /** * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE diff --git a/examples/persistent-storage/efr32/include/CHIPProjectConfig.h b/examples/persistent-storage/efr32/include/CHIPProjectConfig.h index e2d8d1c4f68791..8c793b2fc84e39 100644 --- a/examples/persistent-storage/efr32/include/CHIPProjectConfig.h +++ b/examples/persistent-storage/efr32/include/CHIPProjectConfig.h @@ -56,24 +56,24 @@ #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0xFD00 /** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * - * The product revision number assigned to device or product by the device vendor. This + * The hardware version number assigned to device or product by the device vendor. This * number is scoped to the device product id, and typically corresponds to a revision of the * physical device, a change to its packaging, and/or a change to its marketing presentation. - * This value is generally *not* incremented for device software revisions. + * This value is generally *not* incremented for device software versions. */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 1 +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1 /** - * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING * - * A string identifying the firmware revision running on the device. - * CHIP service currently expects the firmware version to be in the format + * A string identifying the software version running on the device. + * CHIP service currently expects the software version to be in the format * {MAJOR_VERSION}.0d{MINOR_VERSION} */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "0.1ALPHA" +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "0.1ALPHA" #endif /** * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE diff --git a/examples/pigweed-app/efr32/include/CHIPProjectConfig.h b/examples/pigweed-app/efr32/include/CHIPProjectConfig.h index be0b464a0d8049..a93c9d3ed1c84d 100644 --- a/examples/pigweed-app/efr32/include/CHIPProjectConfig.h +++ b/examples/pigweed-app/efr32/include/CHIPProjectConfig.h @@ -55,24 +55,24 @@ #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x5350 /** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * - * The product revision number assigned to device or product by the device vendor. This + * The hardware version number assigned to device or product by the device vendor. This * number is scoped to the device product id, and typically corresponds to a revision of the * physical device, a change to its packaging, and/or a change to its marketing presentation. - * This value is generally *not* incremented for device software revisions. + * This value is generally *not* incremented for device software versions. */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 1 +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1 /** - * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING * - * A string identifying the firmware revision running on the device. - * CHIP service currently expects the firmware version to be in the format + * A string identifying the software version running on the device. + * CHIP service currently expects the software version to be in the format * {MAJOR_VERSION}.0d{MINOR_VERSION} */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "0.1ALPHA" +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "0.1ALPHA" #endif /** * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE diff --git a/examples/platform/qpg/project_include/CHIPProjectConfig.h b/examples/platform/qpg/project_include/CHIPProjectConfig.h index ba9f57c2157669..b0ad50a26707fa 100644 --- a/examples/platform/qpg/project_include/CHIPProjectConfig.h +++ b/examples/platform/qpg/project_include/CHIPProjectConfig.h @@ -59,24 +59,24 @@ #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x514C /** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * - * The product revision number assigned to device or product by the device vendor. This + * The hardware version number assigned to device or product by the device vendor. This * number is scoped to the device product id, and typically corresponds to a revision of the * physical device, a change to its packaging, and/or a change to its marketing presentation. - * This value is generally *not* incremented for device software revisions. + * This value is generally *not* incremented for device software versions. */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 1 +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1 /** - * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING * - * A string identifying the firmware revision running on the device. - * CHIP service currently expects the firmware version to be in the format + * A string identifying the software version running on the device. + * CHIP service currently expects the software version to be in the format * {MAJOR_VERSION}.0d{MINOR_VERSION} */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "0.1ALPHA" +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "0.1ALPHA" #endif /** * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h b/examples/pump-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h index 34db5edf052d5d..54f16498cf782a 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h +++ b/examples/pump-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h @@ -75,24 +75,24 @@ #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x434B /** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * - * The product revision number assigned to device or product by the device vendor. This + * The hardware version number assigned to device or product by the device vendor. This * number is scoped to the device product id, and typically corresponds to a revision of the * physical device, a change to its packaging, and/or a change to its marketing presentation. - * This value is generally *not* incremented for device software revisions. + * This value is generally *not* incremented for device software versions. */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 1 +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1 /** - * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING * - * A string identifying the firmware revision running on the device. - * CHIP currently expects the firmware version to be in the format + * A string identifying the software version running on the device. + * CHIP currently expects the software version to be in the format * {MAJOR_VERSION}.0d{MINOR_VERSION} */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "1.0d1" +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "1.0d1" #endif /** * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h b/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h index 34db5edf052d5d..54f16498cf782a 100644 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h +++ b/examples/pump-controller-app/cc13x2x7_26x2x7/main/include/CHIPProjectConfig.h @@ -75,24 +75,24 @@ #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x434B /** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * - * The product revision number assigned to device or product by the device vendor. This + * The hardware version number assigned to device or product by the device vendor. This * number is scoped to the device product id, and typically corresponds to a revision of the * physical device, a change to its packaging, and/or a change to its marketing presentation. - * This value is generally *not* incremented for device software revisions. + * This value is generally *not* incremented for device software versions. */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 1 +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1 /** - * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING * - * A string identifying the firmware revision running on the device. - * CHIP currently expects the firmware version to be in the format + * A string identifying the software version running on the device. + * CHIP currently expects the software version to be in the format * {MAJOR_VERSION}.0d{MINOR_VERSION} */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "1.0d1" +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "1.0d1" #endif /** * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE diff --git a/examples/shell/README_DEVICE.md b/examples/shell/README_DEVICE.md index 2ca8ae12a62c83..ea3585f036a34f 100644 --- a/examples/shell/README_DEVICE.md +++ b/examples/shell/README_DEVICE.md @@ -32,7 +32,7 @@ Dump the configuration of the device. > device config VendorId: 235a ProductId: feff -ProductRevision: 0001 +HardwareVersion: 0001 SerialNumber: ServiceId: FabricId: @@ -54,7 +54,7 @@ Where valid parameter names include: - vendorid: Vendor Identifier - productid: Product Identifier -- productrev: Product Revision +- hardwarever: Hardware Version - serial: Serial Number - deviceid: Device Identification Number - cert: Device Certificate diff --git a/examples/shell/efr32/include/CHIPProjectConfig.h b/examples/shell/efr32/include/CHIPProjectConfig.h index f72128e170f735..e5be53a055f434 100644 --- a/examples/shell/efr32/include/CHIPProjectConfig.h +++ b/examples/shell/efr32/include/CHIPProjectConfig.h @@ -58,24 +58,24 @@ #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x534C /** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * - * The product revision number assigned to device or product by the device vendor. This + * The hardware version number assigned to device or product by the device vendor. This * number is scoped to the device product id, and typically corresponds to a revision of the * physical device, a change to its packaging, and/or a change to its marketing presentation. - * This value is generally *not* incremented for device software revisions. + * This value is generally *not* incremented for device software versions. */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 1 +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1 /** - * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING * - * A string identifying the firmware revision running on the device. - * CHIP service currently expects the firmware version to be in the format + * A string identifying the software version running on the device. + * CHIP service currently expects the software version to be in the format * {MAJOR_VERSION}.0d{MINOR_VERSION} */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "0.1ALPHA" +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "0.1ALPHA" #endif /** * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE diff --git a/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h index 5ca2ea8baa6e2a..0980a0e6b31b80 100644 --- a/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/shell/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -65,32 +65,32 @@ #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x4B4C /** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * - * The product revision number assigned to device or product by the device vendor. This + * The hardware version number assigned to device or product by the device vendor. This * number is scoped to the device product id, and typically corresponds to a revision of the * physical device, a change to its packaging, and/or a change to its marketing presentation. - * This value is generally *not* incremented for device software revisions. + * This value is generally *not* incremented for device software versions. */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 100 +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 100 -#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION_STRING "v0.1.0" +#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING "v0.1.0" #endif /** - * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING * - * A string identifying the firmware revision running on the device. - * CHIP currently expects the firmware version to be in the format + * A string identifying the software version running on the device. + * CHIP currently expects the software version to be in the format * {MAJOR_VERSION}.0d{MINOR_VERSION} */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "04-2020-te2" +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "04-2020-te2" #endif -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION 42020 +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION 42020 #endif #ifndef CHIP_DEVICE_CONFIG_DEVICE_VENDOR_NAME diff --git a/examples/shell/nxp/k32w/k32w0/main/AppTask.cpp b/examples/shell/nxp/k32w/k32w0/main/AppTask.cpp index b3e85d164171c3..c68b136b2ba83f 100644 --- a/examples/shell/nxp/k32w/k32w0/main/AppTask.cpp +++ b/examples/shell/nxp/k32w/k32w0/main/AppTask.cpp @@ -110,15 +110,15 @@ CHIP_ERROR AppTask::Init() } // Print the current software version - char currentFirmwareRev[ConfigurationManager::kMaxFirmwareRevisionLength + 1] = { 0 }; - err = ConfigurationMgr().GetFirmwareRevisionString(currentFirmwareRev, sizeof(currentFirmwareRev)); + char softwareVersionString[ConfigurationManager::kMaxSoftwareVersionLength + 1] = { 0 }; + err = ConfigurationMgr().GetSoftwareVersionString(softwareVersionString, sizeof(softwareVersionString)); if (err != CHIP_NO_ERROR) { K32W_LOG("Get version error"); assert(err == CHIP_NO_ERROR); } - K32W_LOG("Current Firmware Version: %s", currentFirmwareRev); + K32W_LOG("Current Software Version: %s", softwareVersionString); #if CONFIG_CHIP_NFC_COMMISSIONING PlatformMgr().AddEventHandler(ThreadProvisioningHandler, 0); diff --git a/examples/window-app/efr32/include/CHIPProjectConfig.h b/examples/window-app/efr32/include/CHIPProjectConfig.h index 78c814c9df78b6..68afab33fad73e 100644 --- a/examples/window-app/efr32/include/CHIPProjectConfig.h +++ b/examples/window-app/efr32/include/CHIPProjectConfig.h @@ -58,24 +58,24 @@ #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x0000 /** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * - * The product revision number assigned to device or product by the device vendor. This + * The hardware version number assigned to device or product by the device vendor. This * number is scoped to the device product id, and typically corresponds to a revision of the * physical device, a change to its packaging, and/or a change to its marketing presentation. - * This value is generally *not* incremented for device software revisions. + * This value is generally *not* incremented for device software versions. */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 1 +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1 /** - * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING * - * A string identifying the firmware revision running on the device. - * CHIP service currently expects the firmware version to be in the format + * A string identifying the software version running on the device. + * CHIP service currently expects the software version to be in the format * {MAJOR_VERSION}.0d{MINOR_VERSION} */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "0.1ALPHA" +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "0.1ALPHA" #endif /** * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE diff --git a/src/app/clusters/basic/basic.cpp b/src/app/clusters/basic/basic.cpp index 02a4be9e1530e5..3b5055c915018b 100644 --- a/src/app/clusters/basic/basic.cpp +++ b/src/app/clusters/basic/basic.cpp @@ -20,6 +20,7 @@ #include #include +#include #include @@ -31,7 +32,7 @@ void emberAfBasicClusterServerInitCallback(chip::EndpointId endpoint) { EmberAfStatus status; - char vendorName[33]; + char vendorName[DeviceLayer::ConfigurationManager::kMaxVendorNameLength + 1]; if (ConfigurationMgr().GetVendorName(vendorName, sizeof(vendorName)) == CHIP_NO_ERROR) { status = Attributes::VendorName::Set(endpoint, chip::CharSpan(vendorName, strlen(vendorName))); @@ -45,7 +46,7 @@ void emberAfBasicClusterServerInitCallback(chip::EndpointId endpoint) VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Error setting Vendor Id: 0x%02x", status)); } - char productName[33]; + char productName[DeviceLayer::ConfigurationManager::kMaxProductNameLength + 1]; if (ConfigurationMgr().GetProductName(productName, sizeof(productName)) == CHIP_NO_ERROR) { status = Attributes::ProductName::Set(endpoint, chip::CharSpan(productName, strlen(productName))); @@ -59,37 +60,55 @@ void emberAfBasicClusterServerInitCallback(chip::EndpointId endpoint) VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Error setting Product Id: 0x%02x", status)); } - char productRevisionString[65]; - if (ConfigurationMgr().GetProductRevisionString(productRevisionString, sizeof(productRevisionString)) == CHIP_NO_ERROR) + char hardwareVersionString[DeviceLayer::ConfigurationManager::kMaxHardwareVersionStringLength + 1]; + if (ConfigurationMgr().GetHardwareVersionString(hardwareVersionString, sizeof(hardwareVersionString)) == CHIP_NO_ERROR) { - status = - Attributes::HardwareVersionString::Set(endpoint, chip::CharSpan(productRevisionString, strlen(productRevisionString))); + status = Attributes::HardwareVersionString::Set(endpoint, CharSpan(hardwareVersionString, strlen(hardwareVersionString))); VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Error setting Hardware Version String: 0x%02x", status)); } - uint16_t productRevision; - if (ConfigurationMgr().GetProductRevision(productRevision) == CHIP_NO_ERROR) + uint16_t hardwareVersion; + if (ConfigurationMgr().GetHardwareVersion(hardwareVersion) == CHIP_NO_ERROR) { - status = Attributes::HardwareVersion::Set(endpoint, productRevision); + status = Attributes::HardwareVersion::Set(endpoint, hardwareVersion); VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Error setting Hardware Version: 0x%02x", status)); } - char firmwareRevisionString[65]; - if (ConfigurationMgr().GetFirmwareRevisionString(firmwareRevisionString, sizeof(firmwareRevisionString)) == CHIP_NO_ERROR) + char softwareVersionString[DeviceLayer::ConfigurationManager::kMaxSoftwareVersionLength + 1]; + if (ConfigurationMgr().GetSoftwareVersionString(softwareVersionString, sizeof(softwareVersionString)) == CHIP_NO_ERROR) { - status = Attributes::SoftwareVersionString::Set(endpoint, - chip::CharSpan(firmwareRevisionString, strlen(firmwareRevisionString))); + status = Attributes::SoftwareVersionString::Set(endpoint, CharSpan(softwareVersionString, strlen(softwareVersionString))); VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Error setting Software Version String: 0x%02x", status)); } - uint16_t firmwareRevision; - if (ConfigurationMgr().GetFirmwareRevision(firmwareRevision) == CHIP_NO_ERROR) + uint16_t softwareVersion; + if (ConfigurationMgr().GetSoftwareVersion(softwareVersion) == CHIP_NO_ERROR) { - status = Attributes::SoftwareVersion::Set(endpoint, firmwareRevision); + status = Attributes::SoftwareVersion::Set(endpoint, softwareVersion); VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Error setting Software Version: 0x%02x", status)); } + + char serialNumberString[DeviceLayer::ConfigurationManager::kMaxSerialNumberLength + 1]; + if (ConfigurationMgr().GetSerialNumber(serialNumberString, sizeof(serialNumberString)) == CHIP_NO_ERROR) + { + status = Attributes::SerialNumber::Set(endpoint, CharSpan(serialNumberString, strlen(serialNumberString))); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(Zcl, "Error setting Serial Number String: 0x%02x", status)); + } + + char manufacturingDateString[DeviceLayer::ConfigurationManager::kMaxManufacturingDateLength + 1]; + uint16_t manufacturingYear; + uint8_t manufacturingMonth; + uint8_t manufacturingDayOfMonth; + if (ConfigurationMgr().GetManufacturingDate(manufacturingYear, manufacturingMonth, manufacturingDayOfMonth) == CHIP_NO_ERROR) + { + snprintf(manufacturingDateString, sizeof(manufacturingDateString), "%04" PRIu16 "-%02" PRIu16 "-%02" PRIu16, + manufacturingYear, manufacturingMonth, manufacturingDayOfMonth); + status = Attributes::ManufacturingDate::Set(endpoint, CharSpan(manufacturingDateString, strlen(manufacturingDateString))); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, + ChipLogError(Zcl, "Error setting Manufacturing Date String: 0x%02x", status)); + } } void MatterBasicPluginServerInitCallback() {} diff --git a/src/include/platform/CHIPDeviceConfig.h b/src/include/platform/CHIPDeviceConfig.h index f69eb6e6791775..318f634a2da4d2 100644 --- a/src/include/platform/CHIPDeviceConfig.h +++ b/src/include/platform/CHIPDeviceConfig.h @@ -185,47 +185,47 @@ #endif /** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION_STRING * * Human readable string identifying version of the product assigned by the device vendor. */ -#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION_STRING "TEST_VERSION" +#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING "TEST_VERSION" #endif /** - * CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION + * CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION * - * The default product revision number assigned to the device or product by the device vendor. + * The default hardware version number assigned to the device or product by the device vendor. * - * Product revisions are specific to a particular device vendor and product id, and typically + * Hardware versions are specific to a particular device vendor and product id, and typically * correspond to a revision of the physical device, a change to its packaging, and/or a change * to its marketing presentation. This value is generally *not* incremented for device software * revisions. * - * This is a default value which is used when a product revision has not been stored in device + * This is a default value which is used when a hardware version has not been stored in device * persistent storage (e.g. by a factory provisioning process). */ -#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION -#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION 0 +#ifndef CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION +#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION 0 #endif /** - * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING * - * A string identifying the firmware revision running on the device. + * A string identifying the software version running on the device. */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "prerelease" +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "prerelease" #endif /** - * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION * - * A monothonic number identifying the firmware revision running on the device. + * A monothonic number identifying the software version running on the device. */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION 0 +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION 0 #endif /** diff --git a/src/include/platform/ConfigurationManager.h b/src/include/platform/ConfigurationManager.h index f6f2a04df6e421..7e293478ba09d4 100644 --- a/src/include/platform/ConfigurationManager.h +++ b/src/include/platform/ConfigurationManager.h @@ -58,8 +58,19 @@ class ConfigurationManager enum { - kMaxSerialNumberLength = 32, - kMaxFirmwareRevisionLength = 32, + kMaxVendorNameLength = 32, + kMaxProductNameLength = 32, + kMaxNodeLabelLength = 32, + kMaxLocationLength = 2, + kMaxHardwareVersionStringLength = 64, + kMaxSoftwareVersionLength = 64, + kMaxManufacturingDateLength = 16, + kMaxPartNumberLength = 32, + kMaxProductURLLength = 256, + kMaxProductLabelLength = 64, + kMaxSerialNumberLength = 32, + kMaxUniqueIDLength = 32, + #if CHIP_DEVICE_CONFIG_ENABLE_THREAD kPrimaryMACAddressLength = 8, #else @@ -72,15 +83,15 @@ class ConfigurationManager virtual CHIP_ERROR GetVendorId(uint16_t & vendorId) = 0; virtual CHIP_ERROR GetProductName(char * buf, size_t bufSize) = 0; virtual CHIP_ERROR GetProductId(uint16_t & productId) = 0; - virtual CHIP_ERROR GetProductRevisionString(char * buf, size_t bufSize) = 0; - virtual CHIP_ERROR GetProductRevision(uint16_t & productRev) = 0; + virtual CHIP_ERROR GetHardwareVersionString(char * buf, size_t bufSize) = 0; + virtual CHIP_ERROR GetHardwareVersion(uint16_t & hardwareVer) = 0; virtual CHIP_ERROR GetSerialNumber(char * buf, size_t bufSize) = 0; virtual CHIP_ERROR GetPrimaryMACAddress(MutableByteSpan buf) = 0; virtual CHIP_ERROR GetPrimaryWiFiMACAddress(uint8_t * buf) = 0; virtual CHIP_ERROR GetPrimary802154MACAddress(uint8_t * buf) = 0; virtual CHIP_ERROR GetManufacturingDate(uint16_t & year, uint8_t & month, uint8_t & dayOfMonth) = 0; - virtual CHIP_ERROR GetFirmwareRevisionString(char * buf, size_t bufSize) = 0; - virtual CHIP_ERROR GetFirmwareRevision(uint16_t & firmwareRev) = 0; + virtual CHIP_ERROR GetSoftwareVersionString(char * buf, size_t bufSize) = 0; + virtual CHIP_ERROR GetSoftwareVersion(uint16_t & softwareVer) = 0; virtual CHIP_ERROR GetSetupPinCode(uint32_t & setupPinCode) = 0; virtual CHIP_ERROR GetSetupDiscriminator(uint16_t & setupDiscriminator) = 0; // Lifetime counter is monotonic counter that is incremented only in the case of a factory reset @@ -92,7 +103,7 @@ class ConfigurationManager virtual CHIP_ERROR StorePrimaryWiFiMACAddress(const uint8_t * buf) = 0; virtual CHIP_ERROR StorePrimary802154MACAddress(const uint8_t * buf) = 0; virtual CHIP_ERROR StoreManufacturingDate(const char * mfgDate, size_t mfgDateLen) = 0; - virtual CHIP_ERROR StoreProductRevision(uint16_t productRev) = 0; + virtual CHIP_ERROR StoreHardwareVersion(uint16_t hardwareVer) = 0; virtual CHIP_ERROR StoreSetupPinCode(uint32_t setupPinCode) = 0; virtual CHIP_ERROR StoreSetupDiscriminator(uint16_t setupDiscriminator) = 0; virtual CHIP_ERROR StoreRegulatoryLocation(uint32_t location) = 0; diff --git a/src/include/platform/internal/GenericConfigurationManagerImpl.cpp b/src/include/platform/internal/GenericConfigurationManagerImpl.cpp index 7817ce75f66698..9f13387b745a94 100644 --- a/src/include/platform/internal/GenericConfigurationManagerImpl.cpp +++ b/src/include/platform/internal/GenericConfigurationManagerImpl.cpp @@ -71,10 +71,10 @@ CHIP_ERROR GenericConfigurationManagerImpl::GetProductName(char * b } template -CHIP_ERROR GenericConfigurationManagerImpl::GetFirmwareRevisionString(char * buf, size_t bufSize) +CHIP_ERROR GenericConfigurationManagerImpl::GetSoftwareVersionString(char * buf, size_t bufSize) { - ReturnErrorCodeIf(bufSize < sizeof(CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING), CHIP_ERROR_BUFFER_TOO_SMALL); - strcpy(buf, CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING); + ReturnErrorCodeIf(bufSize < sizeof(CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING), CHIP_ERROR_BUFFER_TOO_SMALL); + strcpy(buf, CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING); return CHIP_NO_ERROR; } @@ -166,37 +166,37 @@ CHIP_ERROR GenericConfigurationManagerImpl::StorePrimary802154MACAd } template -inline CHIP_ERROR GenericConfigurationManagerImpl::GetProductRevisionString(char * buf, size_t bufSize) +inline CHIP_ERROR GenericConfigurationManagerImpl::GetHardwareVersionString(char * buf, size_t bufSize) { - ReturnErrorCodeIf(bufSize < sizeof(CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION_STRING), CHIP_ERROR_BUFFER_TOO_SMALL); - strcpy(buf, CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION_STRING); + ReturnErrorCodeIf(bufSize < sizeof(CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING), CHIP_ERROR_BUFFER_TOO_SMALL); + strcpy(buf, CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION_STRING); return CHIP_NO_ERROR; } template -inline CHIP_ERROR GenericConfigurationManagerImpl::GetProductRevision(uint16_t & productRev) +inline CHIP_ERROR GenericConfigurationManagerImpl::GetHardwareVersion(uint16_t & hardwareVer) { CHIP_ERROR err; uint32_t val; - err = ReadConfigValue(ConfigClass::kConfigKey_ProductRevision, val); + err = ReadConfigValue(ConfigClass::kConfigKey_HardwareVersion, val); if (err == CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND) { - productRev = static_cast(CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION); - err = CHIP_NO_ERROR; + hardwareVer = static_cast(CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION); + err = CHIP_NO_ERROR; } else { - productRev = static_cast(val); + hardwareVer = static_cast(val); } return err; } template -inline CHIP_ERROR GenericConfigurationManagerImpl::StoreProductRevision(uint16_t productRev) +inline CHIP_ERROR GenericConfigurationManagerImpl::StoreHardwareVersion(uint16_t hardwareVer) { - return WriteConfigValue(ConfigClass::kConfigKey_ProductRevision, static_cast(productRev)); + return WriteConfigValue(ConfigClass::kConfigKey_HardwareVersion, static_cast(hardwareVer)); } template @@ -539,12 +539,12 @@ void GenericConfigurationManagerImpl::LogDeviceConfig() } { - uint16_t productRev; - if (GetProductRevision(productRev) != CHIP_NO_ERROR) + uint16_t hardwareVer; + if (GetHardwareVersion(hardwareVer) != CHIP_NO_ERROR) { - productRev = 0; + hardwareVer = 0; } - ChipLogProgress(DeviceLayer, " Product Revision: %" PRIu16, productRev); + ChipLogProgress(DeviceLayer, " Hardware Version: %" PRIu16, hardwareVer); } { diff --git a/src/include/platform/internal/GenericConfigurationManagerImpl.h b/src/include/platform/internal/GenericConfigurationManagerImpl.h index 79cdbacbaf7e04..df551b5feae87c 100644 --- a/src/include/platform/internal/GenericConfigurationManagerImpl.h +++ b/src/include/platform/internal/GenericConfigurationManagerImpl.h @@ -57,11 +57,11 @@ class GenericConfigurationManagerImpl : public ConfigurationManager CHIP_ERROR GetVendorId(uint16_t & vendorId) override; CHIP_ERROR GetProductName(char * buf, size_t bufSize) override; CHIP_ERROR GetProductId(uint16_t & productId) override; - CHIP_ERROR GetProductRevisionString(char * buf, size_t bufSize) override; - CHIP_ERROR GetProductRevision(uint16_t & productRev) override; - CHIP_ERROR StoreProductRevision(uint16_t productRev) override; - CHIP_ERROR GetFirmwareRevisionString(char * buf, size_t bufSize) override; - CHIP_ERROR GetFirmwareRevision(uint16_t & firmwareRev) override; + CHIP_ERROR GetHardwareVersionString(char * buf, size_t bufSize) override; + CHIP_ERROR GetHardwareVersion(uint16_t & hardwareVer) override; + CHIP_ERROR StoreHardwareVersion(uint16_t hardwareVer) override; + CHIP_ERROR GetSoftwareVersionString(char * buf, size_t bufSize) override; + CHIP_ERROR GetSoftwareVersion(uint16_t & softwareVer) override; CHIP_ERROR GetSerialNumber(char * buf, size_t bufSize) override; CHIP_ERROR StoreSerialNumber(const char * serialNum, size_t serialNumLen) override; CHIP_ERROR GetPrimaryMACAddress(MutableByteSpan buf) override; @@ -144,9 +144,9 @@ inline CHIP_ERROR GenericConfigurationManagerImpl::GetProductId(uin } template -inline CHIP_ERROR GenericConfigurationManagerImpl::GetFirmwareRevision(uint16_t & firmwareRev) +inline CHIP_ERROR GenericConfigurationManagerImpl::GetSoftwareVersion(uint16_t & softwareVer) { - firmwareRev = static_cast(CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION); + softwareVer = static_cast(CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION); return CHIP_NO_ERROR; } diff --git a/src/lib/shell/commands/Config.cpp b/src/lib/shell/commands/Config.cpp index b042f6c16b0eb3..d8686c41bc5ba3 100644 --- a/src/lib/shell/commands/Config.cpp +++ b/src/lib/shell/commands/Config.cpp @@ -76,23 +76,23 @@ static CHIP_ERROR ConfigProductId(int argc, char ** argv) return ConfigGetProductId(false); } -static CHIP_ERROR ConfigGetProductRevision(bool printHeader) +static CHIP_ERROR ConfigGetHardwareVersion(bool printHeader) { streamer_t * sout = streamer_get(); uint16_t value16; - ReturnErrorOnFailure(ConfigurationMgr().GetProductRevision(value16)); + ReturnErrorOnFailure(ConfigurationMgr().GetHardwareVersion(value16)); if (printHeader) { - streamer_printf(sout, "ProductRevision: "); + streamer_printf(sout, "HardwareVersion: "); } streamer_printf(sout, "%" PRIu16 " (0x%" PRIX16 ")\r\n", value16, value16); return CHIP_NO_ERROR; } -static CHIP_ERROR ConfigProductRevision(int argc, char ** argv) +static CHIP_ERROR ConfigHardwareVersion(int argc, char ** argv) { - return ConfigGetProductRevision(false); + return ConfigGetHardwareVersion(false); } static CHIP_ERROR ConfigGetSetupPinCode(bool printHeader) @@ -166,7 +166,7 @@ static CHIP_ERROR PrintAllConfigs() { ReturnErrorOnFailure(ConfigGetVendorId(true)); ReturnErrorOnFailure(ConfigGetProductId(true)); - ReturnErrorOnFailure(ConfigGetProductRevision(true)); + ReturnErrorOnFailure(ConfigGetHardwareVersion(true)); ReturnErrorOnFailure(ConfigGetSetupPinCode(true)); ReturnErrorOnFailure(ConfigGetSetupDiscriminator(true)); @@ -200,7 +200,7 @@ void RegisterConfigCommands() { &ConfigHelpHandler, "help", "Usage: config " }, { &ConfigVendorId, "vendorid", "Get VendorId. Usage: config vendorid" }, { &ConfigProductId, "productid", "Get ProductId. Usage: config productid" }, - { &ConfigProductRevision, "productrev", "Get ProductRevision. Usage: config preductrev" }, + { &ConfigHardwareVersion, "hardwarever", "Get HardwareVersion. Usage: config hardwarever" }, { &ConfigPinCode, "pincode", "Get commissioning pincode. Usage: config pincode" }, { &ConfigDiscriminator, "discriminator", "Get/Set commissioning discriminator. Usage: config discriminator [value]" }, }; diff --git a/src/platform/Ameba/AmebaConfig.cpp b/src/platform/Ameba/AmebaConfig.cpp index cf7bdf87faa65b..f40809dd1249e2 100644 --- a/src/platform/Ameba/AmebaConfig.cpp +++ b/src/platform/Ameba/AmebaConfig.cpp @@ -52,7 +52,7 @@ const AmebaConfig::Key AmebaConfig::kConfigKey_MfrDeviceId = { kConfigNa const AmebaConfig::Key AmebaConfig::kConfigKey_MfrDeviceCert = { kConfigNamespace_ChipFactory, "device-cert" }; const AmebaConfig::Key AmebaConfig::kConfigKey_MfrDeviceICACerts = { kConfigNamespace_ChipFactory, "device-ca-certs" }; const AmebaConfig::Key AmebaConfig::kConfigKey_MfrDevicePrivateKey = { kConfigNamespace_ChipFactory, "device-key" }; -const AmebaConfig::Key AmebaConfig::kConfigKey_ProductRevision = { kConfigNamespace_ChipFactory, "product-rev" }; +const AmebaConfig::Key AmebaConfig::kConfigKey_HardwareVersion = { kConfigNamespace_ChipFactory, "hardware-ver" }; const AmebaConfig::Key AmebaConfig::kConfigKey_ManufacturingDate = { kConfigNamespace_ChipFactory, "mfg-date" }; const AmebaConfig::Key AmebaConfig::kConfigKey_SetupPinCode = { kConfigNamespace_ChipFactory, "pin-code" }; const AmebaConfig::Key AmebaConfig::kConfigKey_SetupDiscriminator = { kConfigNamespace_ChipFactory, "discriminator" }; diff --git a/src/platform/Ameba/AmebaConfig.h b/src/platform/Ameba/AmebaConfig.h index 1f8b323a257f49..eb046e16a412d6 100755 --- a/src/platform/Ameba/AmebaConfig.h +++ b/src/platform/Ameba/AmebaConfig.h @@ -47,7 +47,7 @@ class AmebaConfig static const Key kConfigKey_MfrDeviceCert; static const Key kConfigKey_MfrDeviceICACerts; static const Key kConfigKey_MfrDevicePrivateKey; - static const Key kConfigKey_ProductRevision; + static const Key kConfigKey_HardwareVersion; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; static const Key kConfigKey_FabricId; diff --git a/src/platform/Darwin/PosixConfig.cpp b/src/platform/Darwin/PosixConfig.cpp index 4959b2ff293c5e..5215d7bbf997da 100644 --- a/src/platform/Darwin/PosixConfig.cpp +++ b/src/platform/Darwin/PosixConfig.cpp @@ -48,7 +48,7 @@ const PosixConfig::Key PosixConfig::kConfigKey_MfrDeviceId = { kConfigNa const PosixConfig::Key PosixConfig::kConfigKey_MfrDeviceCert = { kConfigNamespace_ChipFactory, "device-cert" }; const PosixConfig::Key PosixConfig::kConfigKey_MfrDeviceICACerts = { kConfigNamespace_ChipFactory, "device-ca-certs" }; const PosixConfig::Key PosixConfig::kConfigKey_MfrDevicePrivateKey = { kConfigNamespace_ChipFactory, "device-key" }; -const PosixConfig::Key PosixConfig::kConfigKey_ProductRevision = { kConfigNamespace_ChipFactory, "product-rev" }; +const PosixConfig::Key PosixConfig::kConfigKey_HardwareVersion = { kConfigNamespace_ChipFactory, "hardware-ver" }; const PosixConfig::Key PosixConfig::kConfigKey_ManufacturingDate = { kConfigNamespace_ChipFactory, "mfg-date" }; const PosixConfig::Key PosixConfig::kConfigKey_SetupPinCode = { kConfigNamespace_ChipFactory, "pin-code" }; const PosixConfig::Key PosixConfig::kConfigKey_SetupDiscriminator = { kConfigNamespace_ChipFactory, "discriminator" }; diff --git a/src/platform/Darwin/PosixConfig.h b/src/platform/Darwin/PosixConfig.h index 1dcd7158c39431..f45026905d6edd 100644 --- a/src/platform/Darwin/PosixConfig.h +++ b/src/platform/Darwin/PosixConfig.h @@ -57,7 +57,7 @@ class PosixConfig static const Key kConfigKey_MfrDeviceCert; static const Key kConfigKey_MfrDeviceICACerts; static const Key kConfigKey_MfrDevicePrivateKey; - static const Key kConfigKey_ProductRevision; + static const Key kConfigKey_HardwareVersion; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; static const Key kConfigKey_FabricId; diff --git a/src/platform/EFR32/EFR32Config.h b/src/platform/EFR32/EFR32Config.h index f21e0366feb858..a00bd79b335f34 100644 --- a/src/platform/EFR32/EFR32Config.h +++ b/src/platform/EFR32/EFR32Config.h @@ -90,7 +90,7 @@ class EFR32Config static constexpr Key kConfigKey_LastUsedEpochKeyId = EFR32ConfigKey(kChipConfig_KeyBase, 0x05); static constexpr Key kConfigKey_FailSafeArmed = EFR32ConfigKey(kChipConfig_KeyBase, 0x06); static constexpr Key kConfigKey_GroupKey = EFR32ConfigKey(kChipConfig_KeyBase, 0x07); - static constexpr Key kConfigKey_ProductRevision = EFR32ConfigKey(kChipConfig_KeyBase, 0x08); + static constexpr Key kConfigKey_HardwareVersion = EFR32ConfigKey(kChipConfig_KeyBase, 0x08); static constexpr Key kConfigKey_RegulatoryLocation = EFR32ConfigKey(kChipConfig_KeyBase, 0x09); static constexpr Key kConfigKey_CountryCode = EFR32ConfigKey(kChipConfig_KeyBase, 0x0A); static constexpr Key kConfigKey_Breadcrumb = EFR32ConfigKey(kChipConfig_KeyBase, 0x0B); diff --git a/src/platform/ESP32/CHIPDevicePlatformConfig.h b/src/platform/ESP32/CHIPDevicePlatformConfig.h index 93da2b4d5713f9..6698af057f9b73 100644 --- a/src/platform/ESP32/CHIPDevicePlatformConfig.h +++ b/src/platform/ESP32/CHIPDevicePlatformConfig.h @@ -40,8 +40,8 @@ #define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID CONFIG_DEVICE_VENDOR_ID #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID CONFIG_DEVICE_PRODUCT_ID #define CHIP_DEVICE_CONFIG_DEVICE_TYPE CONFIG_DEVICE_TYPE -#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION CONFIG_DEFAULT_DEVICE_PRODUCT_REVISION -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING CONFIG_DEVICE_FIRMWARE_REVISION +#define CHIP_DEVICE_CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION CONFIG_DEFAULT_DEVICE_HARDWARE_VERSION +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING CONFIG_DEVICE_SOFTWARE_VERSION #define CHIP_DEVICE_CONFIG_ENABLE_THREAD CONFIG_OPENTHREAD_ENABLED #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT CONFIG_OPENTHREAD_SRP_CLIENT diff --git a/src/platform/ESP32/ESP32Config.cpp b/src/platform/ESP32/ESP32Config.cpp index 136097c0b5e02f..62fbddfc51ee71 100644 --- a/src/platform/ESP32/ESP32Config.cpp +++ b/src/platform/ESP32/ESP32Config.cpp @@ -55,7 +55,7 @@ const ESP32Config::Key ESP32Config::kConfigKey_MfrDeviceId = { kConfigNa const ESP32Config::Key ESP32Config::kConfigKey_MfrDeviceCert = { kConfigNamespace_ChipFactory, "device-cert" }; const ESP32Config::Key ESP32Config::kConfigKey_MfrDeviceICACerts = { kConfigNamespace_ChipFactory, "device-ca-certs" }; const ESP32Config::Key ESP32Config::kConfigKey_MfrDevicePrivateKey = { kConfigNamespace_ChipFactory, "device-key" }; -const ESP32Config::Key ESP32Config::kConfigKey_ProductRevision = { kConfigNamespace_ChipFactory, "product-rev" }; +const ESP32Config::Key ESP32Config::kConfigKey_HardwareVersion = { kConfigNamespace_ChipFactory, "hardware-ver" }; const ESP32Config::Key ESP32Config::kConfigKey_ManufacturingDate = { kConfigNamespace_ChipFactory, "mfg-date" }; const ESP32Config::Key ESP32Config::kConfigKey_SetupPinCode = { kConfigNamespace_ChipFactory, "pin-code" }; const ESP32Config::Key ESP32Config::kConfigKey_SetupDiscriminator = { kConfigNamespace_ChipFactory, "discriminator" }; diff --git a/src/platform/ESP32/ESP32Config.h b/src/platform/ESP32/ESP32Config.h index face2c0f37e1ba..cfaa4d35a2fcd7 100644 --- a/src/platform/ESP32/ESP32Config.h +++ b/src/platform/ESP32/ESP32Config.h @@ -58,7 +58,7 @@ class ESP32Config static const Key kConfigKey_MfrDeviceCert; static const Key kConfigKey_MfrDeviceICACerts; static const Key kConfigKey_MfrDevicePrivateKey; - static const Key kConfigKey_ProductRevision; + static const Key kConfigKey_HardwareVersion; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; static const Key kConfigKey_FabricId; diff --git a/src/platform/Linux/PosixConfig.cpp b/src/platform/Linux/PosixConfig.cpp index c79aa61b8b137f..eada93c64a6a66 100644 --- a/src/platform/Linux/PosixConfig.cpp +++ b/src/platform/Linux/PosixConfig.cpp @@ -53,7 +53,7 @@ const PosixConfig::Key PosixConfig::kConfigKey_MfrDeviceId = { kConfigNa const PosixConfig::Key PosixConfig::kConfigKey_MfrDeviceCert = { kConfigNamespace_ChipFactory, "device-cert" }; const PosixConfig::Key PosixConfig::kConfigKey_MfrDeviceICACerts = { kConfigNamespace_ChipFactory, "device-ca-certs" }; const PosixConfig::Key PosixConfig::kConfigKey_MfrDevicePrivateKey = { kConfigNamespace_ChipFactory, "device-key" }; -const PosixConfig::Key PosixConfig::kConfigKey_ProductRevision = { kConfigNamespace_ChipFactory, "product-rev" }; +const PosixConfig::Key PosixConfig::kConfigKey_HardwareVersion = { kConfigNamespace_ChipFactory, "hardware-ver" }; const PosixConfig::Key PosixConfig::kConfigKey_ManufacturingDate = { kConfigNamespace_ChipFactory, "mfg-date" }; const PosixConfig::Key PosixConfig::kConfigKey_SetupPinCode = { kConfigNamespace_ChipFactory, "pin-code" }; const PosixConfig::Key PosixConfig::kConfigKey_SetupDiscriminator = { kConfigNamespace_ChipFactory, "discriminator" }; diff --git a/src/platform/Linux/PosixConfig.h b/src/platform/Linux/PosixConfig.h index 50988a5b06dc41..c98738dbd99122 100644 --- a/src/platform/Linux/PosixConfig.h +++ b/src/platform/Linux/PosixConfig.h @@ -59,7 +59,7 @@ class PosixConfig static const Key kConfigKey_MfrDeviceCert; static const Key kConfigKey_MfrDeviceICACerts; static const Key kConfigKey_MfrDevicePrivateKey; - static const Key kConfigKey_ProductRevision; + static const Key kConfigKey_HardwareVersion; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; static const Key kConfigKey_FabricId; diff --git a/src/platform/P6/P6Config.cpp b/src/platform/P6/P6Config.cpp index 9f713e904e268e..51665960ee91d3 100644 --- a/src/platform/P6/P6Config.cpp +++ b/src/platform/P6/P6Config.cpp @@ -53,7 +53,7 @@ const P6Config::Key P6Config::kConfigKey_MfrDeviceId = { kConfigNamespac const P6Config::Key P6Config::kConfigKey_MfrDeviceCert = { kConfigNamespace_ChipFactory, "device-cert" }; const P6Config::Key P6Config::kConfigKey_MfrDeviceICACerts = { kConfigNamespace_ChipFactory, "device-ca-certs" }; const P6Config::Key P6Config::kConfigKey_MfrDevicePrivateKey = { kConfigNamespace_ChipFactory, "device-key" }; -const P6Config::Key P6Config::kConfigKey_ProductRevision = { kConfigNamespace_ChipFactory, "product-rev" }; +const P6Config::Key P6Config::kConfigKey_HardwareVersion = { kConfigNamespace_ChipFactory, "hardware-ver" }; const P6Config::Key P6Config::kConfigKey_ManufacturingDate = { kConfigNamespace_ChipFactory, "mfg-date" }; const P6Config::Key P6Config::kConfigKey_SetupPinCode = { kConfigNamespace_ChipFactory, "pin-code" }; const P6Config::Key P6Config::kConfigKey_SetupDiscriminator = { kConfigNamespace_ChipFactory, "discriminator" }; diff --git a/src/platform/P6/P6Config.h b/src/platform/P6/P6Config.h index bcbc4b232a50c3..280a6d7217d2f7 100644 --- a/src/platform/P6/P6Config.h +++ b/src/platform/P6/P6Config.h @@ -59,7 +59,7 @@ class P6Config static const Key kConfigKey_MfrDeviceCert; static const Key kConfigKey_MfrDeviceICACerts; static const Key kConfigKey_MfrDevicePrivateKey; - static const Key kConfigKey_ProductRevision; + static const Key kConfigKey_HardwareVersion; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; static const Key kConfigKey_FabricId; diff --git a/src/platform/Tizen/PosixConfig.cpp b/src/platform/Tizen/PosixConfig.cpp index d42f02bb2f466f..61acb6720d83fc 100644 --- a/src/platform/Tizen/PosixConfig.cpp +++ b/src/platform/Tizen/PosixConfig.cpp @@ -49,7 +49,7 @@ const PosixConfig::Key PosixConfig::kConfigKey_MfrDeviceId = { kConfigNa const PosixConfig::Key PosixConfig::kConfigKey_MfrDeviceCert = { kConfigNamespace_ChipFactory, "device-cert" }; const PosixConfig::Key PosixConfig::kConfigKey_MfrDeviceICACerts = { kConfigNamespace_ChipFactory, "device-ca-certs" }; const PosixConfig::Key PosixConfig::kConfigKey_MfrDevicePrivateKey = { kConfigNamespace_ChipFactory, "device-key" }; -const PosixConfig::Key PosixConfig::kConfigKey_ProductRevision = { kConfigNamespace_ChipFactory, "product-rev" }; +const PosixConfig::Key PosixConfig::kConfigKey_HardwareVersion = { kConfigNamespace_ChipFactory, "hardware-ver" }; const PosixConfig::Key PosixConfig::kConfigKey_ManufacturingDate = { kConfigNamespace_ChipFactory, "mfg-date" }; const PosixConfig::Key PosixConfig::kConfigKey_SetupPinCode = { kConfigNamespace_ChipFactory, "pin-code" }; const PosixConfig::Key PosixConfig::kConfigKey_SetupDiscriminator = { kConfigNamespace_ChipFactory, "discriminator" }; diff --git a/src/platform/Tizen/PosixConfig.h b/src/platform/Tizen/PosixConfig.h index 8a64e3b921b6d2..6a2c9c5e2f842a 100644 --- a/src/platform/Tizen/PosixConfig.h +++ b/src/platform/Tizen/PosixConfig.h @@ -57,7 +57,7 @@ class PosixConfig static const Key kConfigKey_MfrDeviceCert; static const Key kConfigKey_MfrDeviceICACerts; static const Key kConfigKey_MfrDevicePrivateKey; - static const Key kConfigKey_ProductRevision; + static const Key kConfigKey_HardwareVersion; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; static const Key kConfigKey_FabricId; diff --git a/src/platform/Zephyr/ZephyrConfig.cpp b/src/platform/Zephyr/ZephyrConfig.cpp index febfefa43584ae..7171a55b2f15ae 100644 --- a/src/platform/Zephyr/ZephyrConfig.cpp +++ b/src/platform/Zephyr/ZephyrConfig.cpp @@ -55,7 +55,7 @@ const ZephyrConfig::Key ZephyrConfig::kConfigKey_MfrDeviceId = CONFIG_KE const ZephyrConfig::Key ZephyrConfig::kConfigKey_MfrDeviceCert = CONFIG_KEY(NAMESPACE_FACTORY "device-cert"); const ZephyrConfig::Key ZephyrConfig::kConfigKey_MfrDeviceICACerts = CONFIG_KEY(NAMESPACE_FACTORY "device-ca-certs"); const ZephyrConfig::Key ZephyrConfig::kConfigKey_MfrDevicePrivateKey = CONFIG_KEY(NAMESPACE_FACTORY "device-key"); -const ZephyrConfig::Key ZephyrConfig::kConfigKey_ProductRevision = CONFIG_KEY(NAMESPACE_FACTORY "product-rev"); +const ZephyrConfig::Key ZephyrConfig::kConfigKey_HardwareVersion = CONFIG_KEY(NAMESPACE_FACTORY "hardware-ver"); const ZephyrConfig::Key ZephyrConfig::kConfigKey_ManufacturingDate = CONFIG_KEY(NAMESPACE_FACTORY "mfg-date"); const ZephyrConfig::Key ZephyrConfig::kConfigKey_SetupPinCode = CONFIG_KEY(NAMESPACE_FACTORY "pin-code"); const ZephyrConfig::Key ZephyrConfig::kConfigKey_SetupDiscriminator = CONFIG_KEY(NAMESPACE_FACTORY "discriminator"); diff --git a/src/platform/Zephyr/ZephyrConfig.h b/src/platform/Zephyr/ZephyrConfig.h index fafa55bf9dcf9c..0c3b038fa63c68 100644 --- a/src/platform/Zephyr/ZephyrConfig.h +++ b/src/platform/Zephyr/ZephyrConfig.h @@ -48,7 +48,7 @@ class ZephyrConfig static const Key kConfigKey_MfrDeviceCert; static const Key kConfigKey_MfrDeviceICACerts; static const Key kConfigKey_MfrDevicePrivateKey; - static const Key kConfigKey_ProductRevision; + static const Key kConfigKey_HardwareVersion; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; static const Key kConfigKey_SetupDiscriminator; diff --git a/src/platform/android/AndroidConfig.cpp b/src/platform/android/AndroidConfig.cpp index a70462506a7708..16b0fa7b68dec9 100644 --- a/src/platform/android/AndroidConfig.cpp +++ b/src/platform/android/AndroidConfig.cpp @@ -62,7 +62,7 @@ const AndroidConfig::Key AndroidConfig::kConfigKey_MfrDeviceId = { kConf const AndroidConfig::Key AndroidConfig::kConfigKey_MfrDeviceCert = { kConfigNamespace_ChipFactory, "device-cert" }; const AndroidConfig::Key AndroidConfig::kConfigKey_MfrDeviceICACerts = { kConfigNamespace_ChipFactory, "device-ca-certs" }; const AndroidConfig::Key AndroidConfig::kConfigKey_MfrDevicePrivateKey = { kConfigNamespace_ChipFactory, "device-key" }; -const AndroidConfig::Key AndroidConfig::kConfigKey_ProductRevision = { kConfigNamespace_ChipFactory, "product-rev" }; +const AndroidConfig::Key AndroidConfig::kConfigKey_HardwareVersion = { kConfigNamespace_ChipFactory, "hardware-ver" }; const AndroidConfig::Key AndroidConfig::kConfigKey_ManufacturingDate = { kConfigNamespace_ChipFactory, "mfg-date" }; const AndroidConfig::Key AndroidConfig::kConfigKey_SetupPinCode = { kConfigNamespace_ChipFactory, "pin-code" }; const AndroidConfig::Key AndroidConfig::kConfigKey_SetupDiscriminator = { kConfigNamespace_ChipFactory, "discriminator" }; diff --git a/src/platform/android/AndroidConfig.h b/src/platform/android/AndroidConfig.h index 319da320af9cee..1476ce42358cfd 100644 --- a/src/platform/android/AndroidConfig.h +++ b/src/platform/android/AndroidConfig.h @@ -58,7 +58,7 @@ class AndroidConfig static const Key kConfigKey_MfrDeviceCert; static const Key kConfigKey_MfrDeviceICACerts; static const Key kConfigKey_MfrDevicePrivateKey; - static const Key kConfigKey_ProductRevision; + static const Key kConfigKey_HardwareVersion; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; static const Key kConfigKey_FabricId; diff --git a/src/platform/android/java/chip/platform/ConfigurationManager.java b/src/platform/android/java/chip/platform/ConfigurationManager.java index 14eb64866f987c..c437cd6fa0493d 100644 --- a/src/platform/android/java/chip/platform/ConfigurationManager.java +++ b/src/platform/android/java/chip/platform/ConfigurationManager.java @@ -30,7 +30,7 @@ public interface ConfigurationManager { String kConfigKey_MfrDeviceCert = "device-cert"; String kConfigKey_MfrDeviceICACerts = "device-ca-certs"; String kConfigKey_MfrDevicePrivateKey = "device-key"; - String kConfigKey_ProductRevision = "product-rev"; + String kConfigKey_HardwareVersion = "hardware-ver"; String kConfigKey_ManufacturingDate = "mfg-date"; String kConfigKey_SetupPinCode = "pin-code"; String kConfigKey_SetupDiscriminator = "discriminator"; diff --git a/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp b/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp index 301a1e91c46bc7..68c219597b2c46 100644 --- a/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp +++ b/src/platform/cc13x2_26x2/CC13X2_26X2Config.cpp @@ -53,7 +53,7 @@ const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_MfrDeviceICACerts = .itemID = 0x0004 } }; const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_MfrDevicePrivateKey = { { .systemID = kCC13X2_26X2ChipConfig_Sysid, .itemID = 0x0005 } }; -const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_ProductRevision = { { .systemID = kCC13X2_26X2ChipConfig_Sysid, +const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_HardwareVersion = { { .systemID = kCC13X2_26X2ChipConfig_Sysid, .itemID = 0x0006 } }; const CC13X2_26X2Config::Key CC13X2_26X2Config::kConfigKey_ManufacturingDate = { { .systemID = kCC13X2_26X2ChipConfig_Sysid, .itemID = 0x0007 } }; diff --git a/src/platform/cc13x2_26x2/CC13X2_26X2Config.h b/src/platform/cc13x2_26x2/CC13X2_26X2Config.h index aa06cd1b76ac30..6e3a0f6ca64803 100644 --- a/src/platform/cc13x2_26x2/CC13X2_26X2Config.h +++ b/src/platform/cc13x2_26x2/CC13X2_26X2Config.h @@ -50,7 +50,7 @@ class CC13X2_26X2Config static const Key kConfigKey_MfrDeviceCert; static const Key kConfigKey_MfrDeviceICACerts; static const Key kConfigKey_MfrDevicePrivateKey; - static const Key kConfigKey_ProductRevision; + static const Key kConfigKey_HardwareVersion; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; static const Key kConfigKey_SetupDiscriminator; diff --git a/src/platform/fake/ConfigurationManagerImpl.h b/src/platform/fake/ConfigurationManagerImpl.h index f4653a96bfbd42..37398aad8328b8 100644 --- a/src/platform/fake/ConfigurationManagerImpl.h +++ b/src/platform/fake/ConfigurationManagerImpl.h @@ -39,11 +39,11 @@ class ConfigurationManagerImpl : public ConfigurationManager CHIP_ERROR GetVendorId(uint16_t & vendorId) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetProductName(char * buf, size_t bufSize) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetProductId(uint16_t & productId) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR GetProductRevisionString(char * buf, size_t bufSize) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR GetProductRevision(uint16_t & productRev) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR StoreProductRevision(uint16_t productRev) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR GetFirmwareRevisionString(char * buf, size_t bufSize) override { return CHIP_ERROR_NOT_IMPLEMENTED; } - CHIP_ERROR GetFirmwareRevision(uint16_t & firmwareRev) override { return CHIP_ERROR_NOT_IMPLEMENTED; } + CHIP_ERROR GetHardwareVersionString(char * buf, size_t bufSize) override { return CHIP_ERROR_NOT_IMPLEMENTED; } + CHIP_ERROR GetHardwareVersion(uint16_t & hardwareVer) override { return CHIP_ERROR_NOT_IMPLEMENTED; } + CHIP_ERROR StoreHardwareVersion(uint16_t hardwareVer) override { return CHIP_ERROR_NOT_IMPLEMENTED; } + CHIP_ERROR GetSoftwareVersionString(char * buf, size_t bufSize) override { return CHIP_ERROR_NOT_IMPLEMENTED; } + CHIP_ERROR GetSoftwareVersion(uint16_t & softwareVer) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetSerialNumber(char * buf, size_t bufSize) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR StoreSerialNumber(const char * serialNum, size_t serialNumLen) override { return CHIP_ERROR_NOT_IMPLEMENTED; } CHIP_ERROR GetPrimaryMACAddress(MutableByteSpan buf) override { return CHIP_ERROR_NOT_IMPLEMENTED; } diff --git a/src/platform/mbed/MbedConfig.cpp b/src/platform/mbed/MbedConfig.cpp index 89a57234d0d70b..ac5e8f43168b62 100644 --- a/src/platform/mbed/MbedConfig.cpp +++ b/src/platform/mbed/MbedConfig.cpp @@ -64,7 +64,7 @@ const MbedConfig::Key MbedConfig::kConfigKey_MfrDeviceId = { FACTORY_KEY const MbedConfig::Key MbedConfig::kConfigKey_MfrDeviceCert = { FACTORY_KEY("device-cert") }; const MbedConfig::Key MbedConfig::kConfigKey_MfrDeviceICACerts = { FACTORY_KEY("device-ca-certs") }; const MbedConfig::Key MbedConfig::kConfigKey_MfrDevicePrivateKey = { FACTORY_KEY("device-key") }; -const MbedConfig::Key MbedConfig::kConfigKey_ProductRevision = { FACTORY_KEY("product-rev") }; +const MbedConfig::Key MbedConfig::kConfigKey_HardwareVersion = { FACTORY_KEY("hardware-ver") }; const MbedConfig::Key MbedConfig::kConfigKey_ManufacturingDate = { FACTORY_KEY("mfg-date") }; const MbedConfig::Key MbedConfig::kConfigKey_SetupPinCode = { FACTORY_KEY("pin-code") }; const MbedConfig::Key MbedConfig::kConfigKey_SetupDiscriminator = { FACTORY_KEY("discriminator") }; diff --git a/src/platform/mbed/MbedConfig.h b/src/platform/mbed/MbedConfig.h index ce47ef78c2d1fe..aeb57463930cbf 100644 --- a/src/platform/mbed/MbedConfig.h +++ b/src/platform/mbed/MbedConfig.h @@ -56,7 +56,7 @@ class MbedConfig static const Key kConfigKey_MfrDeviceCert; static const Key kConfigKey_MfrDeviceICACerts; static const Key kConfigKey_MfrDevicePrivateKey; - static const Key kConfigKey_ProductRevision; + static const Key kConfigKey_HardwareVersion; static const Key kConfigKey_ManufacturingDate; static const Key kConfigKey_SetupPinCode; static const Key kConfigKey_FabricId; diff --git a/src/platform/nxp/k32w/k32w0/K32W0Config.h b/src/platform/nxp/k32w/k32w0/K32W0Config.h index aa33eabd9b7cb4..ed7cf9c61f1764 100644 --- a/src/platform/nxp/k32w/k32w0/K32W0Config.h +++ b/src/platform/nxp/k32w/k32w0/K32W0Config.h @@ -74,7 +74,7 @@ class K32WConfig static constexpr Key kConfigKey_ManufacturingDate = K32WConfigKey(kPDMId_ChipFactory, 0x04); static constexpr Key kConfigKey_SetupPinCode = K32WConfigKey(kPDMId_ChipFactory, 0x05); static constexpr Key kConfigKey_MfrDeviceICACerts = K32WConfigKey(kPDMId_ChipFactory, 0x06); - static constexpr Key kConfigKey_ProductRevision = K32WConfigKey(kPDMId_ChipFactory, 0x07); + static constexpr Key kConfigKey_HardwareVersion = K32WConfigKey(kPDMId_ChipFactory, 0x07); static constexpr Key kConfigKey_SetupDiscriminator = K32WConfigKey(kPDMId_ChipFactory, 0x08); // CHIP Config Keys static constexpr Key kConfigKey_FabricId = K32WConfigKey(kPDMId_ChipConfig, 0x00); diff --git a/src/platform/qpg/qpgConfig.h b/src/platform/qpg/qpgConfig.h index 72f230e28c9f09..731b157e8e963f 100644 --- a/src/platform/qpg/qpgConfig.h +++ b/src/platform/qpg/qpgConfig.h @@ -81,7 +81,7 @@ class QPGConfig static constexpr Key kConfigKey_LastUsedEpochKeyId = QorvoConfigKey(kFileId_ChipConfig, 0x05); static constexpr Key kConfigKey_FailSafeArmed = QorvoConfigKey(kFileId_ChipConfig, 0x06); static constexpr Key kConfigKey_GroupKey = QorvoConfigKey(kFileId_ChipConfig, 0x07); - static constexpr Key kConfigKey_ProductRevision = QorvoConfigKey(kFileId_ChipConfig, 0x08); + static constexpr Key kConfigKey_HardwareVersion = QorvoConfigKey(kFileId_ChipConfig, 0x08); static constexpr Key kConfigKey_RegulatoryLocation = QorvoConfigKey(kFileId_ChipConfig, 0x09); static constexpr Key kConfigKey_CountryCode = QorvoConfigKey(kFileId_ChipConfig, 0x0A); static constexpr Key kConfigKey_Breadcrumb = QorvoConfigKey(kFileId_ChipConfig, 0x0B); diff --git a/src/platform/tests/TestConfigurationMgr.cpp b/src/platform/tests/TestConfigurationMgr.cpp index 1d0b6398f86e68..f54022b7a63c12 100644 --- a/src/platform/tests/TestConfigurationMgr.cpp +++ b/src/platform/tests/TestConfigurationMgr.cpp @@ -107,18 +107,18 @@ static void TestConfigurationMgr_ManufacturingDate(nlTestSuite * inSuite, void * NL_TEST_ASSERT(inSuite, dayOfMonth == 20); } -static void TestConfigurationMgr_ProductRevision(nlTestSuite * inSuite, void * inContext) +static void TestConfigurationMgr_HardwareVersion(nlTestSuite * inSuite, void * inContext) { CHIP_ERROR err = CHIP_NO_ERROR; - uint16_t productRev; + uint16_t hardwareVer; - err = ConfigurationMgr().StoreProductRevision(1234); + err = ConfigurationMgr().StoreHardwareVersion(1234); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - err = ConfigurationMgr().GetProductRevision(productRev); + err = ConfigurationMgr().GetHardwareVersion(hardwareVer); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, productRev == 1234); + NL_TEST_ASSERT(inSuite, hardwareVer == 1234); } static void TestConfigurationMgr_SetupPinCode(nlTestSuite * inSuite, void * inContext) @@ -252,7 +252,7 @@ static const nlTest sTests[] = { #endif NL_TEST_DEF("Test ConfigurationMgr::SerialNumber", TestConfigurationMgr_SerialNumber), NL_TEST_DEF("Test ConfigurationMgr::ManufacturingDate", TestConfigurationMgr_ManufacturingDate), - NL_TEST_DEF("Test ConfigurationMgr::ProductRevision", TestConfigurationMgr_ProductRevision), + NL_TEST_DEF("Test ConfigurationMgr::HardwareVersion", TestConfigurationMgr_HardwareVersion), NL_TEST_DEF("Test ConfigurationMgr::SetupPinCode", TestConfigurationMgr_SetupPinCode), NL_TEST_DEF("Test ConfigurationMgr::SetupDiscriminator", TestConfigurationMgr_SetupDiscriminator), NL_TEST_DEF("Test ConfigurationMgr::RegulatoryLocation", TestConfigurationMgr_RegulatoryLocation), diff --git a/src/test_driver/efr32/include/CHIPProjectConfig.h b/src/test_driver/efr32/include/CHIPProjectConfig.h index be0b464a0d8049..a93c9d3ed1c84d 100644 --- a/src/test_driver/efr32/include/CHIPProjectConfig.h +++ b/src/test_driver/efr32/include/CHIPProjectConfig.h @@ -55,24 +55,24 @@ #define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x5350 /** - * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION * - * The product revision number assigned to device or product by the device vendor. This + * The hardware version number assigned to device or product by the device vendor. This * number is scoped to the device product id, and typically corresponds to a revision of the * physical device, a change to its packaging, and/or a change to its marketing presentation. - * This value is generally *not* incremented for device software revisions. + * This value is generally *not* incremented for device software versions. */ -#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 1 +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1 /** - * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING * - * A string identifying the firmware revision running on the device. - * CHIP service currently expects the firmware version to be in the format + * A string identifying the software version running on the device. + * CHIP service currently expects the software version to be in the format * {MAJOR_VERSION}.0d{MINOR_VERSION} */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING -#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "0.1ALPHA" +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "0.1ALPHA" #endif /** * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE