Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Some device clusters not reporting attribute changes (by calling MatterReportingAttributeChangeCallback) when the invoked command is calling app::AttributeAccessInterface #34897

Closed
erwinpan1 opened this issue Aug 9, 2024 · 0 comments · Fixed by #35122
Assignees
Labels
bug Something isn't working needs triage tv TV-related features

Comments

@erwinpan1
Copy link
Contributor

Reproduction steps

Currently there are many clusters using AccessInterface to delegate the attributes in the application layer. (e.g. MediaPlayback and MediaInput clusters . When the commands of these clusters are called, the attributes subscriber won't be able to receive the reportData.

Reproducing steps:

e.g.

  1. running the a video player e.g. rootnode_basicvideoplayer_0ff86e943b

  2. running 1st chip-tool to commission it and sharing it to the 2nd chip-tool

  3. After the 2nd chip-tool successfully commissioned the device, subscribe the attribute change by interactive mode

$ ./out/chip-tool/chip-tool interactive start

>>> mediaplayback subscribe current-state 0 100 0x11 1

  1. Then use 1st to invoke the Play or Pause

Expected results

The 2nd chip-tool as the attribute subscriber should get notified

Actual results

The 2nd chip-tool is not notified

Analysis

The current MediaPlayback simply calls the delegate to modify the attribute data but not calling MatterReportingAttributeChangeCallback media-playback-server.cpp

bool emberAfMediaPlaybackClusterPauseCallback(app::CommandHandler * command, const app::ConcreteCommandPath & commandPath,
                                              const Commands::Pause::DecodableType & commandData)
{
...
    Delegate * delegate = GetDelegate(endpoint);
    VerifyOrExit(isDelegateNull(delegate, endpoint) != true, err = CHIP_ERROR_INCORRECT_STATE);

    {
        delegate->HandlePause(responder);
    }
exit:
    if (err != CHIP_NO_ERROR)
    {
        ChipLogError(Zcl, "emberAfMediaPlaybackClusterPauseCallback error: %s", err.AsString());
        command->AddStatus(commandPath, Status::Failure);
    }

    return true;
}

When referring to correct implementation, it should be like the door-lock-server.cpp which calls MatterReportingAttributeChangeCallback after delegate successfully handles data changes.

void DoorLockServer::clearAliroReaderConfigCommandHandler(CommandHandler * commandObj, const ConcreteCommandPath & commandPath)
{
...

    uint8_t buffer[kAliroReaderVerificationKeySize];
    MutableByteSpan readerVerificationKey(buffer);
    CHIP_ERROR err = delegate->GetAliroReaderVerificationKey(readerVerificationKey);
...
    err = delegate->ClearAliroReaderConfig();
    if (err != CHIP_NO_ERROR)
    {
        ChipLogError(Zcl, "[SetAliroReaderConfig] Unable to set aliro reader config [endpointId=%d]", endpointID);
    }
    else
    {
        // Various attributes changed; mark them dirty.
        MatterReportingAttributeChangeCallback(endpointID, Clusters::DoorLock::Id, AliroReaderVerificationKey::Id);
        MatterReportingAttributeChangeCallback(endpointID, Clusters::DoorLock::Id, AliroReaderGroupIdentifier::Id);
        MatterReportingAttributeChangeCallback(endpointID, Clusters::DoorLock::Id, AliroGroupResolvingKey::Id);
    }
    sendClusterResponse(commandObj, commandPath, ClusterStatusCode(StatusIB(err).mStatus));
}

Bug prevalence

Everytime

GitHub hash of the SDK that was being used

2b5194b

Platform

core

Platform Version(s)

No response

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage tv TV-related features
Projects
Archived in project
3 participants