tree: 0314237566eaec413408b9464c91b6d71fe9115a
  1. tests/
  2. app_config_dependent_sources.cmake
  3. app_config_dependent_sources.gni
  4. BUILD.gn
  5. CodegenIntegration.cpp
  6. CodegenIntegration.h
  7. MediaFileManagementCluster.cpp
  8. MediaFileManagementCluster.h
  9. MediaFileManagementDelegate.h
  10. README.md
src/app/clusters/media-file-management-server/README.md

Media File Management Cluster (0x0511)

Code-driven implementation of the Media File Management cluster, built on DefaultServerCluster.

Architecture

  • MediaFileManagementCluster (MediaFileManagementCluster.h/.cpp) — the ServerClusterInterface implementation. Owns the feature map and all attribute/command metadata. Delegates application data and command behavior to a Delegate.
  • Delegate (MediaFileManagementDelegate.h) — application-implemented interface providing storage stats, the AvailableFiles / SupportedMimeTypes lists (index-based), and command handlers. Command handlers return an IM Status; the two commands with data responses (AddFile, GetSharedFile) populate a response struct by reference.
  • MediaFileManagementServer (CodegenIntegration.h/.cpp) — ZAP/Ember integration wrapper. Reads the feature map from the ZAP attribute store and registers the cluster with the codegen data model provider. Applications using ZAP instantiate one MediaFileManagementServer per endpoint and call Init().

New (non-ZAP) code can use MediaFileManagementCluster directly.

Features

FeatureBitEffect
MediaSharing0Enables RequestSharedFiles / GetSharedFile / OfferFile

When MediaSharing is not enabled, only AddFile and DeleteFile are accepted, and only AddFileResponse is generated.

Events

SharedFilesAdded is emitted via MediaFileManagementCluster::GenerateSharedFilesAddedEvent() — call it from the application when files become available for sharing in response to a RequestSharedFiles command.

Notes

  • This cluster is provisional in the Matter specification.
  • Storage attributes (TotalStorage, AvailableStorage) require Manage privilege for read, per the spec.