From e6c9cb0a64ef6d04f208c82d647b5b6240514392 Mon Sep 17 00:00:00 2001 From: Jerry-ESP <107675966+Jerry-ESP@users.noreply.github.com> Date: Wed, 15 Feb 2023 22:43:18 +0800 Subject: [PATCH] add all the get factory info interface (#24406) --- .../ESP32/ESP32FactoryDataProvider.cpp | 20 +++++++++++++++++++ src/platform/ESP32/ESP32FactoryDataProvider.h | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/src/platform/ESP32/ESP32FactoryDataProvider.cpp b/src/platform/ESP32/ESP32FactoryDataProvider.cpp index e86e1b514bf73a..951d39132df3c6 100644 --- a/src/platform/ESP32/ESP32FactoryDataProvider.cpp +++ b/src/platform/ESP32/ESP32FactoryDataProvider.cpp @@ -230,6 +230,26 @@ CHIP_ERROR ESP32FactoryDataProvider::GetRotatingDeviceIdUniqueId(MutableByteSpan #endif return err; } + +CHIP_ERROR ESP32FactoryDataProvider::GetSerialNumber(char * buf, size_t bufSize) +{ + return GenericDeviceInstanceInfoProvider::GetSerialNumber(buf, bufSize); +} + +CHIP_ERROR ESP32FactoryDataProvider::GetManufacturingDate(uint16_t & year, uint8_t & month, uint8_t & day) +{ + return GenericDeviceInstanceInfoProvider::GetManufacturingDate(year, month, day); +} + +CHIP_ERROR ESP32FactoryDataProvider::GetHardwareVersion(uint16_t & hardwareVersion) +{ + return GenericDeviceInstanceInfoProvider::GetHardwareVersion(hardwareVersion); +} + +CHIP_ERROR ESP32FactoryDataProvider::GetPartNumber(char * buf, size_t bufSize) +{ + return GenericDeviceInstanceInfoProvider::GetPartNumber(buf, bufSize); +} #endif // CHIP_DEVICE_CONFIG_ENABLE_DEVICE_INSTANCE_INFO_PROVIDER } // namespace DeviceLayer diff --git a/src/platform/ESP32/ESP32FactoryDataProvider.h b/src/platform/ESP32/ESP32FactoryDataProvider.h index 7647b8a617f553..d69e64ffd1fcc1 100644 --- a/src/platform/ESP32/ESP32FactoryDataProvider.h +++ b/src/platform/ESP32/ESP32FactoryDataProvider.h @@ -70,6 +70,10 @@ class ESP32FactoryDataProvider : public CommissionableDataProvider, CHIP_ERROR GetProductLabel(char * buf, size_t bufSize) override; CHIP_ERROR GetHardwareVersionString(char * buf, size_t bufSize) override; CHIP_ERROR GetRotatingDeviceIdUniqueId(MutableByteSpan & uniqueIdSpan) override; + CHIP_ERROR GetSerialNumber(char * buf, size_t bufSize) override; + CHIP_ERROR GetManufacturingDate(uint16_t & year, uint8_t & month, uint8_t & day) override; + CHIP_ERROR GetPartNumber(char * buf, size_t bufSize) override; + CHIP_ERROR GetHardwareVersion(uint16_t & hardwareVersion) override; #endif // CHIP_DEVICE_CONFIG_ENABLE_DEVICE_INSTANCE_INFO_PROVIDER };