When should I call chip::DeviceLayer::SetDeviceInfoProvider?

Hi,

I'm working through building my own Matter device. Building on MacOS, VSCode on 2.7.0. I'm using an nrf52840DK for now.

I have two endpoints that contain a temperature measurement and that is working well. 

Next I want to name those endpoints. I know this won't work with iOS HomeKit, but it should work with Home Assistant's matter implementation.

I've cloned the sample DeviceInfoProvider from the connectedhomeip examples - /connectedhomeip/examples/all-clusters-app/nrfconnect/third_party/connectedhomeip/examples/providers

I add a call to SetDeviceInfoProvider into the AppTask::Init(), but I'm not sure if that's in the right place.
CHIP_ERROR AppTask::Init()
{
/* Initialize Matter stack */
ReturnErrorOnFailure(Nrf::Matter::PrepareServer());

/* Register the DeviceInfoProvider */
chip::DeviceLayer::SetDeviceInfoProvider(&gDeviceInfoProvider);
if (!Nrf::GetBoard().Init())
{
LOG_ERR("User interface initialization failed.");
return CHIP_ERROR_INCORRECT_STATE;
}
Do you have any guidance?
Parents Reply Children
No Data
Related