You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now I am working on the new cluster. When I test command, the chip-tool side error log is as follows,I looked up the possible cause of the error and found that there was no problem with the zap file. Finally, I found that the error was in the code of the cluster server implementation. Through MatterThreadBorderRouterManagementPluginServerInitCallback interface cannot directly to add Instance: : Init () interface, So I added a void emberAfThreadBorderRouterManagementClusterInitCallback (chip: : EndpointId EndpointId); The implementation of the function is as follows,I would like to know what is the reason for the error has no delegate and how to solve it. Could someone give me an answer, thank you!!!
void emberAfThreadBorderRouterManagementClusterInitCallback(chip::EndpointId endpointId)
{
// Nothing to do, the server init routine will be done in Instance::Init()
Delegate * delegate = GetDelegate(endpointId);
if (isDelegateNull(delegate, endpointId))
{
ChipLogProgress(Zcl, "ThreadBorderRouter has no delegate set for endpoint:%u", endpoint);
// return;
}
// 创建ServerInstance的实例
ServerInstance serverInstance(endpointId, delegate);
CHIP_ERROR err = serverInstance.Init();
if (err != CHIP_NO_ERROR)
{
ChipLogError(Zcl, "ThreadBorderRouterManagement::serverInstance.Init() error: %" CHIP_ERROR_FORMAT, err.Format());
}
}
You should not create the server instance which's life is within emberAfThreadBorderRouterManagementClusterInitCallback(), and the error log shows that the command handler with the same cluster ID has been registered. Do you call the ServerInstance::Init() function at other place?
@FIREWORKMBY It's really hard to say what's going on here given the small snippet missing larger context, but yes, @wqx6 points out a clear bug in the above code. Past that, I suggest creating a draft PR with the full code involved and asking for help on Slack in the tsg-tt-software-development channel as needed.
Now I am working on the new cluster. When I test command, the chip-tool side error log is as follows,I looked up the possible cause of the error and found that there was no problem with the zap file. Finally, I found that the error was in the code of the cluster server implementation. Through MatterThreadBorderRouterManagementPluginServerInitCallback interface cannot directly to add Instance: : Init () interface, So I added a void emberAfThreadBorderRouterManagementClusterInitCallback (chip: : EndpointId EndpointId); The implementation of the function is as follows,I would like to know what is the reason for the error has no delegate and how to solve it. Could someone give me an answer, thank you!!!
Error:
Here's the error when you run command with chip-tool:
The text was updated successfully, but these errors were encountered: