/**
 *    Copyright (c) 2023 Project CHIP Authors
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

#pragma once

/**
 * Declarations of function that can be used to query the endpoint configuration
 * for the device.
 */

#include <app/util/af-types.h>

/**
 * Returns the total number of possible endpoints (dynamic and pre-compiled).
 * Not all those endpoints might be enabled, and the dynamic ones might not even
 * have an EmberAfEndpointType defined.
 *
 * Typically only used for endpoint index iteration.
 */
uint16_t emberAfEndpointCount(void);

/**
 * Returns whether the endpoint at the specified index (which must be less than
 * emberAfEndpointCount() is enabled.  If an endpoint is disabled, it is not
 * guaranteed to have an EmberAfEndpointType.
 */
bool emberAfEndpointIndexIsEnabled(uint16_t index);

/**
 * Returns the endpoint id of the endpoint at the given index.  Will return
 * kInvalidEndpointId for endpoints that are not actually configured.
 */
chip::EndpointId emberAfEndpointFromIndex(uint16_t index);

/**
 * Returns the endpoint descriptor for the given endpoint id if there is an
 * enabled endpoint with that endpoint id.  Otherwise returns null.
 */
const EmberAfEndpointType * emberAfFindEndpointType(chip::EndpointId endpointId);

/**
 * Returns the cluster descriptor for the given cluster on the given endpoint.
 *
 * If the given endpoint does not exist or is disabled, returns null.
 *
 * If the given endpoint does not have the given cluster, returns null.
 */
const EmberAfCluster * emberAfFindServerCluster(chip::EndpointId endpoint, chip::ClusterId clusterId);

/**
 * Returns true if the given endpoint exists, is enabled, has the given cluster,
 * and that cluster has the given attribute.
 */
bool emberAfContainsAttribute(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId);
