The service area cluster is designed around three core classes: Instance
, StorageDelegate
, and a second Delegate
class.
The Instance
class serves as the primary interface for safely accessing and modifying cluster attributes, adhering to the constraints outlined in the specification document. However, it does not handle the storage of list attributes.
Storage management is delegated to the StorageDelegate
class, which provides a list of virtual methods for the user to implement. These methods are straightforward and do not require input validation, but they should not be used directly.
The business logic specific to the device is encapsulated in a second Delegate
class. This class can access the Instance
through the GetInstance()
method, enabling it to utilize all the attribute access methods provided by the Instance
class. This design allows for a clear separation of concerns, with each class handling a specific aspect of the cluster's functionality.
ServiceArea::StorageDelegate
class.ServiceArea::Delegate
class.Instance
class using the delegate instances.Instance
's Init()
method after the root Server::Init()
.emberAfServiceAreaClusterInitCallback
function.