| {{> header}} |
| |
| #include <app-common/zap-generated/callback.h> |
| #include <app-common/zap-generated/cluster-id.h> |
| #include <lib/support/Span.h> |
| #include <protocols/interaction_model/Constants.h> |
| |
| using namespace chip; |
| |
| // Cluster Init Functions |
| void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) |
| { |
| switch (clusterId) |
| { |
| {{#all_user_clusters_names}} |
| case ZCL_{{asDelimitedMacro define}}_ID : |
| emberAf{{asUpperCamelCase name}}ClusterInitCallback(endpoint); |
| break; |
| {{/all_user_clusters_names}} |
| default: |
| // Unrecognized cluster ID |
| break; |
| } |
| } |
| |
| {{#all_user_clusters_names}} |
| void __attribute__((weak)) emberAf{{asUpperCamelCase name}}ClusterInitCallback(EndpointId endpoint) |
| { |
| // To prevent warning |
| (void) endpoint; |
| } |
| {{/all_user_clusters_names}} |
| |
| // |
| // Non-Cluster Related Callbacks |
| // |
| |
| void __attribute__((weak)) emberAfAddToCurrentAppTasksCallback(EmberAfApplicationTask tasks) {} |
| |
| void __attribute__((weak)) emberAfRemoveFromCurrentAppTasksCallback(EmberAfApplicationTask tasks) {} |
| |
| EmberAfAttributeWritePermission __attribute__((weak)) emberAfAllowNetworkWriteAttributeCallback( |
| EndpointId endpoint, ClusterId clusterId, |
| AttributeId attributeId, |
| uint8_t * value, uint8_t type) |
| { |
| return EMBER_ZCL_ATTRIBUTE_WRITE_PERMISSION_ALLOW_WRITE_NORMAL; // Default |
| } |
| |
| bool __attribute__((weak)) emberAfAttributeReadAccessCallback( |
| EndpointId endpoint, ClusterId clusterId, AttributeId attributeId) |
| { |
| return true; |
| } |
| |
| bool __attribute__((weak)) emberAfAttributeWriteAccessCallback( |
| EndpointId endpoint, ClusterId clusterId, AttributeId attributeId) |
| { |
| return true; |
| } |
| |
| bool __attribute__((weak)) emberAfDefaultResponseCallback( |
| ClusterId clusterId, CommandId commandId, EmberAfStatus status) |
| { |
| return false; |
| } |
| |
| bool __attribute__((weak)) emberAfPreMessageSendCallback( |
| EmberAfMessageStruct * messageStruct, EmberStatus * status) |
| { |
| return false; |
| } |
| |
| bool __attribute__((weak)) emberAfMessageSentCallback( |
| const MessageSendDestination & destination, |
| EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, |
| EmberStatus status) |
| { |
| return false; |
| } |
| |
| EmberAfStatus __attribute__((weak)) emberAfExternalAttributeReadCallback( |
| EndpointId endpoint, ClusterId clusterId, |
| const EmberAfAttributeMetadata * attributeMetadata, |
| uint8_t * buffer, uint16_t maxReadLength) |
| { |
| return EMBER_ZCL_STATUS_FAILURE; |
| } |
| |
| EmberAfStatus __attribute__((weak)) emberAfExternalAttributeWriteCallback( |
| EndpointId endpoint, ClusterId clusterId, |
| const EmberAfAttributeMetadata * attributeMetadata, |
| uint8_t * buffer) |
| { |
| return EMBER_ZCL_STATUS_FAILURE; |
| } |
| |
| uint32_t __attribute__((weak)) emberAfGetCurrentTimeCallback() |
| { |
| return 0; |
| } |
| |
| bool __attribute__((weak)) emberAfGetEndpointInfoCallback( |
| EndpointId endpoint, uint8_t * returnNetworkIndex, |
| EmberAfEndpointInfoStruct * returnEndpointInfo) |
| { |
| return false; |
| } |
| |
| void __attribute__((weak)) emberAfRegistrationAbortCallback() {} |
| |
| EmberStatus __attribute__((weak)) emberAfInterpanSendMessageCallback( |
| EmberAfInterpanHeader * header, uint16_t messageLength, uint8_t * message) |
| { |
| return EMBER_LIBRARY_NOT_PRESENT; |
| } |
| |
| bool __attribute__((weak)) emberAfStartMoveCallback() |
| { |
| return false; |
| } |
| |
| chip::Protocols::InteractionModel::Status __attribute__((weak)) MatterPreAttributeChangeCallback( |
| const chip::app::ConcreteAttributePath & attributePath, |
| uint8_t type, uint16_t size, uint8_t * value) |
| { |
| return chip::Protocols::InteractionModel::Status::Success; |
| } |
| |
| void __attribute__((weak)) MatterPostAttributeChangeCallback( |
| const chip::app::ConcreteAttributePath & attributePath, |
| uint8_t type, uint16_t size, uint8_t * value) |
| { |
| } |