CHIP_ERROR AppTask::Init()
{
/* Initialize Matter stack */
ReturnErrorOnFailure(Nrf::Matter::PrepareServer(Nrf::Matter::InitData{ .mPreServerInitClbk = [] {
CHIP_ERROR err = ReportSensorManager::Instance().Init();
if(err != CHIP_NO_ERROR) {
LOG_ERR("ReportSensorManager Init fial");
return err;
}
} }));
if (!Nrf::GetBoard().Init()) {
LOG_ERR("User interface initialization failed.");
return CHIP_ERROR_INCORRECT_STATE;
}
/* Register Matter event handler that controls the connectivity status LED based on the captured Matter network
* state. */
ReturnErrorOnFailure(Nrf::Matter::RegisterEventHandler(Nrf::Board::DefaultMatterEventHandler, 0));
return Nrf::Matter::StartServer();
}
CHIP_ERROR ReportSensorManager::Init()
{
k_timer_init(&sSensorTimer, &ReportSensorManager::TimerEventHandler, nullptr);
k_timer_start(&sSensorTimer, K_MSEC(kSensorTimerPeriodMs), K_MSEC(kSensorTimerPeriodMs));
/* Workaround: Default null values are not correctly propagated from the zap file. Set it manually to make sure
* the starting value is cleared. */
// sensor measurement api
// ReportSensorManager::Instance().SetHumidity(5000);
ReportSensorManager::Instance().SetTemperature(2700);
// ReportSensorManager::Instance().SetIlluminance(5000);
// ReportSensorManager::Instance().SetOccupancy(1);
return CHIP_NO_ERROR;
}
void ReportSensorManager::SetTemperature(int16_t temperature)
{
PlatformMgr().LockChipStack();
app::Clusters::TemperatureMeasurement::Attributes::MeasuredValue::Set(kTemperatureEndpoint, temperature);
PlatformMgr().UnlockChipStack();
}
this is my code,why it report the err "I: 1339 [ZCL]0xbebb8 ep 4 clus 0x0000_0402 attr 0x0000_0000 not supported
E: ReportSensorManager Init fial"
