Skip to content

Commit

Permalink
add all the get factory info interface (#24406)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry-ESP authored and pull[bot] committed Jun 23, 2023
1 parent af66790 commit 8312420
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/platform/ESP32/ESP32FactoryDataProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,26 @@ CHIP_ERROR ESP32FactoryDataProvider::GetRotatingDeviceIdUniqueId(MutableByteSpan
#endif
return err;
}

CHIP_ERROR ESP32FactoryDataProvider::GetSerialNumber(char * buf, size_t bufSize)
{
return GenericDeviceInstanceInfoProvider<ESP32Config>::GetSerialNumber(buf, bufSize);
}

CHIP_ERROR ESP32FactoryDataProvider::GetManufacturingDate(uint16_t & year, uint8_t & month, uint8_t & day)
{
return GenericDeviceInstanceInfoProvider<ESP32Config>::GetManufacturingDate(year, month, day);
}

CHIP_ERROR ESP32FactoryDataProvider::GetHardwareVersion(uint16_t & hardwareVersion)
{
return GenericDeviceInstanceInfoProvider<ESP32Config>::GetHardwareVersion(hardwareVersion);
}

CHIP_ERROR ESP32FactoryDataProvider::GetPartNumber(char * buf, size_t bufSize)
{
return GenericDeviceInstanceInfoProvider<ESP32Config>::GetPartNumber(buf, bufSize);
}
#endif // CHIP_DEVICE_CONFIG_ENABLE_DEVICE_INSTANCE_INFO_PROVIDER

} // namespace DeviceLayer
Expand Down
4 changes: 4 additions & 0 deletions src/platform/ESP32/ESP32FactoryDataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down

0 comments on commit 8312420

Please sign in to comment.