docs/platforms/esp32/providers.md
The ESP32 platform has implemented several providers that can be used with data stored in the factory or by setting fixed data.
Below are the providers that have been implemented:
More information can be found in the factory data guide.
Currently, there are two implementations for this provider:
StaticESP32DeviceInfoProvider. Utilize the
Set...() APIs to set the fixed data.Set...() APIs to set the fixed data.#include <platform/ESP32/StaticESP32FactoryDataProvider.h>
DeviceLayer::StaticESP32DeviceInfoProvider deviceInfoProvider;
// Define array for Supported Calendar Types
using namespace chip::app::Clusters::TimeFormatLocalization::CalendarTypeEnum;
CalendarTypeEnum supportedCalendarTypes[] = {
CalendarTypeEnum::kGregorian,
};
// Define array for Supported Locales
const char* supportedLocales[] = {
"en-US",
"en-GB",
};
// Define array for Fixed labels { EndpointId, Label, Value }
struct StaticESP32DeviceInfoProvider::FixedLabelEntry fixedLabels[] = {
{ 0, "Orientation", "North" },
{ 0, "Direction", "Up" },
};
Span<CalendarTypeEnum> sSupportedCalendarTypes(supportedCalendarTypes);
Span<const char*> sSupportedLocales(supportedLocales);
Span<StaticESP32DeviceInfoProvider::FixedLabelEntry> sFixedLabels(fixedLabels);
{
deviceInfoProvider.SetSupportedLocales(sSupportedLocales);
deviceInfoProvider.SetSupportedCalendarTypes(sSupportedCalendarTypes);
deviceInfoProvider.SetFixedLabels(sFixedLabels);
DeviceLayer::SetDeviceInfoProvider(&deviceInfoProvider);
}