3 * Copyright (c) 2021 Project CHIP Authors
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 // THIS FILE IS GENERATED BY ZAP
20 // Prevent multiple inclusion
23 #include "af-structs.h"
25 #include "basic-types.h"
27 /** @brief Cluster Init
29 * This function is called when a specific cluster is initialized. It gives the
30 * application an opportunity to take care of cluster initialization procedures.
31 * It is called exactly once for each endpoint where cluster is present.
33 * @param endpoint Ver.: always
34 * @param clusterId Ver.: always
36 void emberAfClusterInitCallback(chip::EndpointId endpoint, chip::ClusterId clusterId);
38 // Cluster Init Functions
40 /** @brief Basic Cluster Init
44 * @param endpoint Endpoint that is being initialized
46 void emberAfBasicClusterInitCallback(chip::EndpointId endpoint);
48 /** @brief Level Control Cluster Init
52 * @param endpoint Endpoint that is being initialized
54 void emberAfLevelControlClusterInitCallback(chip::EndpointId endpoint);
56 /** @brief On/off Cluster Init
60 * @param endpoint Endpoint that is being initialized
62 void emberAfOnOffClusterInitCallback(chip::EndpointId endpoint);
64 // Cluster Server/Client Init Functions
67 // Basic Cluster server
70 /** @brief Basic Cluster Server Init
74 * @param endpoint Endpoint that is being initialized
76 void emberAfBasicClusterServerInitCallback(chip::EndpointId endpoint);
78 /** @brief Basic Cluster Server Attribute Changed
80 * Server Attribute Changed
82 * @param endpoint Endpoint that is being initialized
83 * @param attributeId Attribute that changed
85 void emberAfBasicClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId);
87 /** @brief Basic Cluster Server Manufacturer Specific Attribute Changed
89 * Server Manufacturer Specific Attribute Changed
91 * @param endpoint Endpoint that is being initialized
92 * @param attributeId Attribute that changed
93 * @param manufacturerCode Manufacturer Code of the attribute that changed
95 void emberAfBasicClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId,
96 uint16_t manufacturerCode);
98 /** @brief Basic Cluster Server Message Sent
100 * Server Message Sent
102 * @param type The type of message sent
103 * @param indexOrDestination The destination or address to which the message was sent
104 * @param apsFrame The APS frame for the message
105 * @param msgLen The length of the message
106 * @param message The message that was sent
107 * @param status The status of the sent message
109 void emberAfBasicClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination,
110 EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status);
112 /** @brief Basic Cluster Server Pre Attribute Changed
114 * server Pre Attribute Changed
116 * @param endpoint Endpoint that is being initialized
117 * @param attributeId Attribute to be changed
118 * @param attributeType Attribute type
119 * @param size Attribute size
120 * @param value Attribute value
122 EmberAfStatus emberAfBasicClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId,
123 EmberAfAttributeType attributeType, uint8_t size,
126 /** @brief Basic Cluster Server Tick
130 * @param endpoint Endpoint that is being served
132 void emberAfBasicClusterServerTickCallback(chip::EndpointId endpoint);
135 // Level Control Cluster server
138 /** @brief Level Control Cluster Server Init
142 * @param endpoint Endpoint that is being initialized
144 void emberAfLevelControlClusterServerInitCallback(chip::EndpointId endpoint);
146 /** @brief Level Control Cluster Server Attribute Changed
148 * Server Attribute Changed
150 * @param endpoint Endpoint that is being initialized
151 * @param attributeId Attribute that changed
153 void emberAfLevelControlClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId);
155 /** @brief Level Control Cluster Server Manufacturer Specific Attribute Changed
157 * Server Manufacturer Specific Attribute Changed
159 * @param endpoint Endpoint that is being initialized
160 * @param attributeId Attribute that changed
161 * @param manufacturerCode Manufacturer Code of the attribute that changed
163 void emberAfLevelControlClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint,
164 chip::AttributeId attributeId,
165 uint16_t manufacturerCode);
167 /** @brief Level Control Cluster Server Message Sent
169 * Server Message Sent
171 * @param type The type of message sent
172 * @param indexOrDestination The destination or address to which the message was sent
173 * @param apsFrame The APS frame for the message
174 * @param msgLen The length of the message
175 * @param message The message that was sent
176 * @param status The status of the sent message
178 void emberAfLevelControlClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination,
179 EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message,
182 /** @brief Level Control Cluster Server Pre Attribute Changed
184 * server Pre Attribute Changed
186 * @param endpoint Endpoint that is being initialized
187 * @param attributeId Attribute to be changed
188 * @param attributeType Attribute type
189 * @param size Attribute size
190 * @param value Attribute value
192 EmberAfStatus emberAfLevelControlClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId,
193 EmberAfAttributeType attributeType, uint8_t size,
196 /** @brief Level Control Cluster Server Tick
200 * @param endpoint Endpoint that is being served
202 void emberAfLevelControlClusterServerTickCallback(chip::EndpointId endpoint);
205 // On/off Cluster server
208 /** @brief On/off Cluster Server Init
212 * @param endpoint Endpoint that is being initialized
214 void emberAfOnOffClusterServerInitCallback(chip::EndpointId endpoint);
216 /** @brief On/off Cluster Server Attribute Changed
218 * Server Attribute Changed
220 * @param endpoint Endpoint that is being initialized
221 * @param attributeId Attribute that changed
223 void emberAfOnOffClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId);
225 /** @brief On/off Cluster Server Manufacturer Specific Attribute Changed
227 * Server Manufacturer Specific Attribute Changed
229 * @param endpoint Endpoint that is being initialized
230 * @param attributeId Attribute that changed
231 * @param manufacturerCode Manufacturer Code of the attribute that changed
233 void emberAfOnOffClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId,
234 uint16_t manufacturerCode);
236 /** @brief On/off Cluster Server Message Sent
238 * Server Message Sent
240 * @param type The type of message sent
241 * @param indexOrDestination The destination or address to which the message was sent
242 * @param apsFrame The APS frame for the message
243 * @param msgLen The length of the message
244 * @param message The message that was sent
245 * @param status The status of the sent message
247 void emberAfOnOffClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination,
248 EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status);
250 /** @brief On/off Cluster Server Pre Attribute Changed
252 * server Pre Attribute Changed
254 * @param endpoint Endpoint that is being initialized
255 * @param attributeId Attribute to be changed
256 * @param attributeType Attribute type
257 * @param size Attribute size
258 * @param value Attribute value
260 EmberAfStatus emberAfOnOffClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId,
261 EmberAfAttributeType attributeType, uint8_t size,
264 /** @brief On/off Cluster Server Tick
268 * @param endpoint Endpoint that is being served
270 void emberAfOnOffClusterServerTickCallback(chip::EndpointId endpoint);
272 // Cluster Commands Callback
275 * @brief Level Control Cluster Move Command callback
279 * @param optionOverride
282 bool emberAfLevelControlClusterMoveCallback(uint8_t moveMode, uint8_t rate, uint8_t optionMask, uint8_t optionOverride);
285 * @brief Level Control Cluster MoveToLevel Command callback
287 * @param transitionTime
289 * @param optionOverride
292 bool emberAfLevelControlClusterMoveToLevelCallback(uint8_t level, uint16_t transitionTime, uint8_t optionMask,
293 uint8_t optionOverride);
296 * @brief Level Control Cluster MoveToLevelWithOnOff Command callback
298 * @param transitionTime
301 bool emberAfLevelControlClusterMoveToLevelWithOnOffCallback(uint8_t level, uint16_t transitionTime);
304 * @brief Level Control Cluster MoveWithOnOff Command callback
309 bool emberAfLevelControlClusterMoveWithOnOffCallback(uint8_t moveMode, uint8_t rate);
312 * @brief Level Control Cluster Step Command callback
315 * @param transitionTime
317 * @param optionOverride
320 bool emberAfLevelControlClusterStepCallback(uint8_t stepMode, uint8_t stepSize, uint16_t transitionTime, uint8_t optionMask,
321 uint8_t optionOverride);
324 * @brief Level Control Cluster StepWithOnOff Command callback
327 * @param transitionTime
330 bool emberAfLevelControlClusterStepWithOnOffCallback(uint8_t stepMode, uint8_t stepSize, uint16_t transitionTime);
333 * @brief Level Control Cluster Stop Command callback
335 * @param optionOverride
338 bool emberAfLevelControlClusterStopCallback(uint8_t optionMask, uint8_t optionOverride);
341 * @brief Level Control Cluster StopWithOnOff Command callback
344 bool emberAfLevelControlClusterStopWithOnOffCallback();
347 * @brief On/off Cluster Off Command callback
350 bool emberAfOnOffClusterOffCallback();
353 * @brief On/off Cluster On Command callback
356 bool emberAfOnOffClusterOnCallback();
359 * @brief On/off Cluster Toggle Command callback
362 bool emberAfOnOffClusterToggleCallback();
365 // Non-Cluster Related Callbacks
368 /** @brief Add To Current App Tasks
370 * This function is only useful to sleepy end devices. This function will note
371 * the passed item as part of a set of tasks the application has outstanding
372 * (e.g. message sent requiring APS acknwoledgement). This will affect how the
373 * application behaves with regard to sleeping and polling. Until the
374 * outstanding task is completed, the device may poll more frequently and sleep
377 * @param tasks Ver.: always
379 void emberAfAddToCurrentAppTasksCallback(EmberAfApplicationTask tasks);
381 /** @brief Remove From Current App Tasks
383 * This function is only useful to sleepy end devices. This function will
384 * remove the passed item from the set of tasks the application has outstanding
385 * (e.g. message sent requiring APS acknwoledgement). This will affect how the
386 * application behaves with regard to sleeping and polling. Removing the item
387 * from the list of outstanding tasks may allow the device to sleep longer and
388 * poll less frequently. If there are other outstanding tasks the system may
389 * still have to stay away and poll more often.
391 * @param tasks Ver.: always
393 void emberAfRemoveFromCurrentAppTasksCallback(EmberAfApplicationTask tasks);
395 /** @brief Allow Network Write Attribute
397 * This function is called by the application framework before it writes an
398 * attribute in response to a write attribute request from an external device.
399 * The value passed into this callback is the value to which the attribute is to
400 * be set by the framework.
401 Example: In mirroring simple metering data
402 * on an Energy Services Interface (ESI) (formerly called Energy Service Portal
403 * (ESP) in SE 1.0).), a mirrored simple meter needs to write read-only
404 * attributes on its mirror. The-meter-mirror sample application, located in
405 * app/framework/sample-apps, uses this callback to allow the mirrored device to
406 * write simple metering attributes on the mirror regardless of the fact that
407 * most simple metering attributes are defined as read-only by the ZigBee
409 Note: The ZCL specification does not (as of this
410 * writing) specify any permission-level security for writing writeable
411 * attributes. As far as the ZCL specification is concerned, if an attribute is
412 * writeable, any device that has a link key for the device should be able to
413 * write that attribute. Furthermore if an attribute is read only, it should not
414 * be written over the air. Thus, if you implement permissions for writing
415 * attributes as a feature, you MAY be operating outside the specification. This
416 * is unlikely to be a problem for writing read-only attributes, but it may be a
417 * problem for attributes that are writeable according to the specification but
418 * restricted by the application implementing this callback.
420 * @param endpoint Ver.: always
421 * @param clusterId Ver.: always
422 * @param attributeId Ver.: always
423 * @param mask Ver.: always
424 * @param manufacturerCode Ver.: always
425 * @param value Ver.: always
426 * @param type Ver.: always
428 EmberAfAttributeWritePermission emberAfAllowNetworkWriteAttributeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
429 chip::AttributeId attributeId, uint8_t mask,
430 uint16_t manufacturerCode, uint8_t * value, uint8_t type);
432 /** @brief Attribute Read Access
434 * This function is called whenever the Application Framework needs to check
435 * access permission for an attribute read.
437 * @param endpoint Ver.: always
438 * @param clusterId Ver.: always
439 * @param manufacturerCode Ver.: always
440 * @param attributeId Ver.: always
442 bool emberAfAttributeReadAccessCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, uint16_t manufacturerCode,
443 chip::AttributeId attributeId);
445 /** @brief Attribute Write Access
447 * This function is called whenever the Application Framework needs to check
448 * access permission for an attribute write.
450 * @param endpoint Ver.: always
451 * @param clusterId Ver.: always
452 * @param manufacturerCode Ver.: always
453 * @param attributeId Ver.: always
455 bool emberAfAttributeWriteAccessCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, uint16_t manufacturerCode,
456 chip::AttributeId attributeId);
458 /** @brief Default Response
460 * This function is called by the application framework when a Default Response
461 * command is received from an external device. The application should return
462 * true if the message was processed or false if it was not.
464 * @param clusterId The cluster identifier of this response. Ver.: always
465 * @param commandId The command identifier to which this is a response. Ver.:
467 * @param status Specifies either SUCCESS or the nature of the error that was
468 * detected in the received command. Ver.: always
470 bool emberAfDefaultResponseCallback(chip::ClusterId clusterId, chip::CommandId commandId, EmberAfStatus status);
472 /** @brief Configure Reporting Response
474 * This function is called by the application framework when a Configure
475 * Reporting Response command is received from an external device. The
476 * application should return true if the message was processed or false if it
479 * @param clusterId The cluster identifier of this response. Ver.: always
480 * @param buffer Buffer containing the list of attribute status records. Ver.:
482 * @param bufLen The length in bytes of the list. Ver.: always
484 bool emberAfConfigureReportingResponseCallback(chip::ClusterId clusterId, uint8_t * buffer, uint16_t bufLen);
486 /** @brief Read Reporting Configuration Response
488 * This function is called by the application framework when a Read Reporting
489 * Configuration Response command is received from an external device. The
490 * application should return true if the message was processed or false if it
493 * @param clusterId The cluster identifier of this response. Ver.: always
494 * @param buffer Buffer containing the list of attribute reporting configuration
495 * records. Ver.: always
496 * @param bufLen The length in bytes of the list. Ver.: always
498 bool emberAfReadReportingConfigurationResponseCallback(chip::ClusterId clusterId, uint8_t * buffer, uint16_t bufLen);
500 /** @brief Discover Attributes Response
502 * This function is called by the application framework when a Discover
503 * Attributes Response or Discover Attributes Extended Response command is
504 * received from an external device. The Discover Attributes Response command
505 * contains a bool indicating if discovery is complete and a list of zero or
506 * more attribute identifier/type records. The final argument indicates whether
507 * the response is in the extended format or not. The application should return
508 * true if the message was processed or false if it was not.
510 * @param clusterId The cluster identifier of this response. Ver.: always
511 * @param discoveryComplete Indicates whether there are more attributes to be
512 * discovered. true if there are no more attributes to be discovered. Ver.:
514 * @param buffer Buffer containing the list of attribute identifier/type
515 * records. Ver.: always
516 * @param bufLen The length in bytes of the list. Ver.: always
517 * @param extended Indicates whether the response is in the extended format or
520 bool emberAfDiscoverAttributesResponseCallback(chip::ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, uint16_t bufLen,
523 /** @brief Discover Commands Generated Response
525 * This function is called by the framework when Discover Commands Generated
526 * Response is received.
528 * @param clusterId The cluster identifier of this response. Ver.: always
529 * @param manufacturerCode Manufacturer code Ver.: always
530 * @param discoveryComplete Indicates whether there are more commands to be
531 * discovered. Ver.: always
532 * @param commandIds Buffer containing the list of command identifiers. Ver.:
534 * @param commandIdCount The length of bytes of the list, whish is the same as
535 * the number of identifiers. Ver.: always
537 bool emberAfDiscoverCommandsGeneratedResponseCallback(chip::ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete,
538 chip::CommandId * commandIds, uint16_t commandIdCount);
540 /** @brief Discover Commands Received Response
542 * This function is called by the framework when Discover Commands Received
543 * Response is received.
545 * @param clusterId The cluster identifier of this response. Ver.: always
546 * @param manufacturerCode Manufacturer code Ver.: always
547 * @param discoveryComplete Indicates whether there are more commands to be
548 * discovered. Ver.: always
549 * @param commandIds Buffer containing the list of command identifiers. Ver.:
551 * @param commandIdCount The length of bytes of the list, whish is the same as
552 * the number of identifiers. Ver.: always
554 bool emberAfDiscoverCommandsReceivedResponseCallback(chip::ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete,
555 chip::CommandId * commandIds, uint16_t commandIdCount);
557 /** @brief Pre Command Received
559 * This callback is the second in the Application Framework's message processing
560 * chain. At this point in the processing of incoming over-the-air messages, the
561 * application has determined that the incoming message is a ZCL command. It
562 * parses enough of the message to populate an EmberAfClusterCommand struct. The
563 * Application Framework defines this struct value in a local scope to the
564 * command processing but also makes it available through a global pointer
565 * called emberAfCurrentCommand, in app/framework/util/util.c. When command
566 * processing is complete, this pointer is cleared.
568 * @param cmd Ver.: always
570 bool emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd);
572 /** @brief Pre Message Send
574 * This function is called by the framework when it is about to pass a message
575 * to the stack primitives for sending. This message may or may not be ZCL,
576 * ZDO, or some other protocol. This is called prior to
578 * fragmentation that may be done. If the function returns true it is assumed
579 * the callback has consumed and processed the message. The callback must also
580 * set the EmberStatus status code to be passed back to the caller. The
581 * framework will do no further processing on the message.
583 * function returns false then it is assumed that the callback has not processed
584 * the mesasge and the framework will continue to process accordingly.
586 * @param messageStruct The structure containing the parameters of the APS
587 * message to be sent. Ver.: always
588 * @param status A pointer to the status code value that will be returned to the
589 * caller. Ver.: always
591 bool emberAfPreMessageSendCallback(EmberAfMessageStruct * messageStruct, EmberStatus * status);
593 /** @brief Message Sent
595 * This function is called by the application framework from the message sent
596 * handler, when it is informed by the stack regarding the message sent status.
597 * All of the values passed to the emberMessageSentHandler are passed on to this
598 * callback. This provides an opportunity for the application to verify that its
599 * message has been sent successfully and take the appropriate action. This
600 * callback should return a bool value of true or false. A value of true
601 * indicates that the message sent notification has been handled and should not
602 * be handled by the application framework.
604 * @param type Ver.: always
605 * @param indexOrDestination Ver.: always
606 * @param apsFrame Ver.: always
607 * @param msgLen Ver.: always
608 * @param message Ver.: always
609 * @param status Ver.: always
611 bool emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, EmberApsFrame * apsFrame,
612 uint16_t msgLen, uint8_t * message, EmberStatus status);
614 /** @brief Pre Attribute Change
616 * This function is called by the application framework before it changes an
617 * attribute value. The value passed into this callback is the value to which
618 * the attribute is to be set by the framework. The application should return
619 * ::EMBER_ZCL_STATUS_SUCCESS to permit the change or any other ::EmberAfStatus
622 * @param endpoint Ver.: always
623 * @param clusterId Ver.: always
624 * @param attributeId Ver.: always
625 * @param mask Ver.: always
626 * @param manufacturerCode Ver.: always
627 * @param type Ver.: always
628 * @param size Ver.: always
629 * @param value Ver.: always
631 EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId,
632 uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size,
635 /** @brief Post Attribute Change
637 * This function is called by the application framework after it changes an
638 * attribute value. The value passed into this callback is the value to which
639 * the attribute was set by the framework.
641 * @param endpoint Ver.: always
642 * @param clusterId Ver.: always
643 * @param attributeId Ver.: always
644 * @param mask Ver.: always
645 * @param manufacturerCode Ver.: always
646 * @param type Ver.: always
647 * @param size Ver.: always
648 * @param value Ver.: always
650 void emberAfPostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId,
651 uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value);
653 /** @brief Read Attributes Response
655 * This function is called by the application framework when a Read Attributes
656 * Response command is received from an external device. The application should
657 * return true if the message was processed or false if it was not.
659 * @param clusterId The cluster identifier of this response. Ver.: always
660 * @param buffer Buffer containing the list of read attribute status records.
662 * @param bufLen The length in bytes of the list. Ver.: always
664 bool emberAfReadAttributesResponseCallback(chip::ClusterId clusterId, uint8_t * buffer, uint16_t bufLen);
666 /** @brief External Attribute Read
668 * Like emberAfExternalAttributeWriteCallback above, this function is called
669 * when the framework needs to read an attribute that is not stored within the
670 * Application Framework's data structures.
672 * information about the attribute itself is passed as a pointer to an
673 * EmberAfAttributeMetadata struct, which is stored within the application and
674 * used to manage the attribute. A complete description of the
675 * EmberAfAttributeMetadata struct is provided in
676 * app/framework/include/af-types.h
677 This function assumes that the
678 * application is able to read the attribute, write it into the passed buffer,
679 * and return immediately. Any attributes that require a state machine for
680 * reading and writing are not really candidates for externalization at the
681 * present time. The Application Framework does not currently include a state
682 * machine for reading or writing attributes that must take place across a
683 * series of application ticks. Attributes that cannot be read in a timely
684 * manner should be stored within the Application Framework and updated
685 * occasionally by the application code from within the
686 * emberAfMainTickCallback.
687 If the application was successfully able to
688 * read the attribute and write it into the passed buffer, it should return a
689 * value of EMBER_ZCL_STATUS_SUCCESS. Ensure that the size of the externally
690 * managed attribute value is smaller than what the buffer can hold. In the case
691 * of a buffer overflow throw an appropriate error such as
692 * EMBER_ZCL_STATUS_INSUFFICIENT_SPACE. Any other return value indicates the
693 * application was not able to read the attribute.
695 * @param endpoint Ver.: always
696 * @param clusterId Ver.: always
697 * @param attributeMetadata Ver.: always
698 * @param manufacturerCode Ver.: always
699 * @param buffer Ver.: always
700 * @param maxReadLength Ver.: always
702 EmberAfStatus emberAfExternalAttributeReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
703 EmberAfAttributeMetadata * attributeMetadata, uint16_t manufacturerCode,
704 uint8_t * buffer, uint16_t maxReadLength);
706 /** @brief Write Attributes Response
708 * This function is called by the application framework when a Write Attributes
709 * Response command is received from an external device. The application should
710 * return true if the message was processed or false if it was not.
712 * @param clusterId The cluster identifier of this response. Ver.: always
713 * @param buffer Buffer containing the list of write attribute status records.
715 * @param bufLen The length in bytes of the list. Ver.: always
717 bool emberAfWriteAttributesResponseCallback(chip::ClusterId clusterId, uint8_t * buffer, uint16_t bufLen);
719 /** @brief External Attribute Write
721 * This function is called whenever the Application Framework needs to write an
722 * attribute which is not stored within the data structures of the Application
723 * Framework itself. One of the new features in Version 2 is the ability to
724 * store attributes outside the Framework. This is particularly useful for
725 * attributes that do not need to be stored because they can be read off the
726 * hardware when they are needed, or are stored in some central location used by
727 * many modules within the system. In this case, you can indicate that the
728 * attribute is stored externally. When the framework needs to write an external
729 * attribute, it makes a call to this callback.
730 This callback is very
731 * useful for host micros which need to store attributes in persistent memory.
732 * Because each host micro (used with an Ember NCP) has its own type of
733 * persistent memory storage, the Application Framework does not include the
734 * ability to mark attributes as stored in flash the way that it does for Ember
735 * SoCs like the EM35x. On a host micro, any attributes that need to be stored
736 * in persistent memory should be marked as external and accessed through the
737 * external read and write callbacks. Any host code associated with the
738 * persistent storage should be implemented within this callback.
740 * the important information about the attribute itself is passed as a pointer
741 * to an EmberAfAttributeMetadata struct, which is stored within the application
742 * and used to manage the attribute. A complete description of the
743 * EmberAfAttributeMetadata struct is provided in
744 * app/framework/include/af-types.h.
745 This function assumes that the
746 * application is able to write the attribute and return immediately. Any
747 * attributes that require a state machine for reading and writing are not
748 * candidates for externalization at the present time. The Application Framework
749 * does not currently include a state machine for reading or writing attributes
750 * that must take place across a series of application ticks. Attributes that
751 * cannot be written immediately should be stored within the Application
752 * Framework and updated occasionally by the application code from within the
753 * emberAfMainTickCallback.
754 If the application was successfully able to
755 * write the attribute, it returns a value of EMBER_ZCL_STATUS_SUCCESS. Any
756 * other return value indicates the application was not able to write the
759 * @param endpoint Ver.: always
760 * @param clusterId Ver.: always
761 * @param attributeMetadata Ver.: always
762 * @param manufacturerCode Ver.: always
763 * @param buffer Ver.: always
765 EmberAfStatus emberAfExternalAttributeWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
766 EmberAfAttributeMetadata * attributeMetadata, uint16_t manufacturerCode,
769 /** @brief Report Attributes
771 * This function is called by the application framework when a Report Attributes
772 * command is received from an external device. The application should return
773 * true if the message was processed or false if it was not.
775 * @param clusterId The cluster identifier of this command. Ver.: always
776 * @param buffer Buffer containing the list of attribute report records. Ver.:
778 * @param bufLen The length in bytes of the list. Ver.: always
780 bool emberAfReportAttributesCallback(chip::ClusterId clusterId, uint8_t * buffer, uint16_t bufLen);
782 /** @brief Get Current Time
784 * This callback is called when device attempts to get current time from the
785 * hardware. If this device has means to retrieve exact time, then this method
786 * should implement it. If the callback can't provide the exact time it should
787 * return 0 to indicate failure. Default action is to return 0, which indicates
788 * that device does not have access to real time.
791 uint32_t emberAfGetCurrentTimeCallback();
793 /** @brief Get Endpoint Info
795 * This function is a callback to an application implemented endpoint that
796 * operates outside the normal application framework. When the framework wishes
797 * to perform operations with that endpoint it uses this callback to retrieve
798 * the endpoint's information. If the endpoint exists and the application can
799 * provide data then true shall be returned. Otherwise the callback must return
802 * @param endpoint The endpoint to retrieve data for. Ver.: always
803 * @param returnNetworkIndex The index corresponding to the ZigBee network the
804 * endpoint belongs to. If not using a multi-network device, 0 must be
805 * returned. Otherwise on a multi-network device the stack will switch to this
806 * network before sending the message. Ver.: always
807 * @param returnEndpointInfo A pointer to a data struct that will be written
808 * with information about the endpoint. Ver.: always
810 bool emberAfGetEndpointInfoCallback(chip::EndpointId endpoint, uint8_t * returnNetworkIndex,
811 EmberAfEndpointInfoStruct * returnEndpointInfo);
813 /** @brief Get Source Route Overhead
815 * This function is called by the framework to determine the overhead required
816 * in the network frame for source routing to a particular destination.
818 * @param destination The node id of the destination Ver.: always
820 uint8_t emberAfGetSourceRouteOverheadCallback(chip::NodeId destination);
822 /** @brief Registration Abort
824 * This callback is called when the device should abort the registration
828 void emberAfRegistrationAbortCallback();
830 /** @brief Interpan Send Message
832 * This function will send a raw MAC message with interpan frame format using
833 * the passed parameters.
835 * @param header Interpan header info Ver.: always
836 * @param messageLength The length of the message received or to send Ver.:
838 * @param message The message data received or to send. Ver.: always
840 EmberStatus emberAfInterpanSendMessageCallback(EmberAfInterpanHeader * header, uint16_t messageLength, uint8_t * message);
842 /** @brief Start Move
844 * This function is called to initiate the process for a device to move (rejoin)
848 bool emberAfStartMoveCallback();