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 Level Control Cluster Init
44 * @param endpoint Endpoint that is being initialized
46 void emberAfLevelControlClusterInitCallback(chip::EndpointId endpoint);
48 /** @brief Network Commissioning Cluster Init
52 * @param endpoint Endpoint that is being initialized
54 void emberAfNetworkCommissioningClusterInitCallback(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 // Level Control Cluster server
70 /** @brief Level Control Cluster Server Init
74 * @param endpoint Endpoint that is being initialized
76 void emberAfLevelControlClusterServerInitCallback(chip::EndpointId endpoint);
78 /** @brief Level Control Cluster Server Attribute Changed
80 * Server Attribute Changed
82 * @param endpoint Endpoint that is being initialized
83 * @param attributeId Attribute that changed
85 void emberAfLevelControlClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId);
87 /** @brief Level Control 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 emberAfLevelControlClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint,
96 chip::AttributeId attributeId,
97 uint16_t manufacturerCode);
99 /** @brief Level Control Cluster Server Message Sent
101 * Server Message Sent
103 * @param type The type of message sent
104 * @param indexOrDestination The destination or address to which the message was sent
105 * @param apsFrame The APS frame for the message
106 * @param msgLen The length of the message
107 * @param message The message that was sent
108 * @param status The status of the sent message
110 void emberAfLevelControlClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination,
111 EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message,
114 /** @brief Level Control Cluster Server Pre Attribute Changed
116 * server Pre Attribute Changed
118 * @param endpoint Endpoint that is being initialized
119 * @param attributeId Attribute to be changed
120 * @param attributeType Attribute type
121 * @param size Attribute size
122 * @param value Attribute value
124 EmberAfStatus emberAfLevelControlClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId,
125 EmberAfAttributeType attributeType, uint8_t size,
128 /** @brief Level Control Cluster Server Tick
132 * @param endpoint Endpoint that is being served
134 void emberAfLevelControlClusterServerTickCallback(chip::EndpointId endpoint);
137 // Network Commissioning Cluster server
140 /** @brief Network Commissioning Cluster Server Init
144 * @param endpoint Endpoint that is being initialized
146 void emberAfNetworkCommissioningClusterServerInitCallback(chip::EndpointId endpoint);
148 /** @brief Network Commissioning Cluster Server Attribute Changed
150 * Server Attribute Changed
152 * @param endpoint Endpoint that is being initialized
153 * @param attributeId Attribute that changed
155 void emberAfNetworkCommissioningClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId);
157 /** @brief Network Commissioning Cluster Server Manufacturer Specific Attribute Changed
159 * Server Manufacturer Specific Attribute Changed
161 * @param endpoint Endpoint that is being initialized
162 * @param attributeId Attribute that changed
163 * @param manufacturerCode Manufacturer Code of the attribute that changed
165 void emberAfNetworkCommissioningClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint,
166 chip::AttributeId attributeId,
167 uint16_t manufacturerCode);
169 /** @brief Network Commissioning Cluster Server Message Sent
171 * Server Message Sent
173 * @param type The type of message sent
174 * @param indexOrDestination The destination or address to which the message was sent
175 * @param apsFrame The APS frame for the message
176 * @param msgLen The length of the message
177 * @param message The message that was sent
178 * @param status The status of the sent message
180 void emberAfNetworkCommissioningClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination,
181 EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message,
184 /** @brief Network Commissioning Cluster Server Pre Attribute Changed
186 * server Pre Attribute Changed
188 * @param endpoint Endpoint that is being initialized
189 * @param attributeId Attribute to be changed
190 * @param attributeType Attribute type
191 * @param size Attribute size
192 * @param value Attribute value
194 EmberAfStatus emberAfNetworkCommissioningClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint,
195 chip::AttributeId attributeId,
196 EmberAfAttributeType attributeType, uint8_t size,
199 /** @brief Network Commissioning Cluster Server Tick
203 * @param endpoint Endpoint that is being served
205 void emberAfNetworkCommissioningClusterServerTickCallback(chip::EndpointId endpoint);
208 // On/off Cluster server
211 /** @brief On/off Cluster Server Init
215 * @param endpoint Endpoint that is being initialized
217 void emberAfOnOffClusterServerInitCallback(chip::EndpointId endpoint);
219 /** @brief On/off Cluster Server Attribute Changed
221 * Server Attribute Changed
223 * @param endpoint Endpoint that is being initialized
224 * @param attributeId Attribute that changed
226 void emberAfOnOffClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId);
228 /** @brief On/off Cluster Server Manufacturer Specific Attribute Changed
230 * Server Manufacturer Specific Attribute Changed
232 * @param endpoint Endpoint that is being initialized
233 * @param attributeId Attribute that changed
234 * @param manufacturerCode Manufacturer Code of the attribute that changed
236 void emberAfOnOffClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId,
237 uint16_t manufacturerCode);
239 /** @brief On/off Cluster Server Message Sent
241 * Server Message Sent
243 * @param type The type of message sent
244 * @param indexOrDestination The destination or address to which the message was sent
245 * @param apsFrame The APS frame for the message
246 * @param msgLen The length of the message
247 * @param message The message that was sent
248 * @param status The status of the sent message
250 void emberAfOnOffClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination,
251 EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status);
253 /** @brief On/off Cluster Server Pre Attribute Changed
255 * server Pre Attribute Changed
257 * @param endpoint Endpoint that is being initialized
258 * @param attributeId Attribute to be changed
259 * @param attributeType Attribute type
260 * @param size Attribute size
261 * @param value Attribute value
263 EmberAfStatus emberAfOnOffClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId,
264 EmberAfAttributeType attributeType, uint8_t size,
267 /** @brief On/off Cluster Server Tick
271 * @param endpoint Endpoint that is being served
273 void emberAfOnOffClusterServerTickCallback(chip::EndpointId endpoint);
275 // Cluster Commands Callback
278 * @brief Level Control Cluster Move Command callback
282 * @param optionOverride
285 bool emberAfLevelControlClusterMoveCallback(uint8_t moveMode, uint8_t rate, uint8_t optionMask, uint8_t optionOverride);
288 * @brief Level Control Cluster MoveToLevel Command callback
290 * @param transitionTime
292 * @param optionOverride
295 bool emberAfLevelControlClusterMoveToLevelCallback(uint8_t level, uint16_t transitionTime, uint8_t optionMask,
296 uint8_t optionOverride);
299 * @brief Level Control Cluster MoveToLevelWithOnOff Command callback
301 * @param transitionTime
304 bool emberAfLevelControlClusterMoveToLevelWithOnOffCallback(uint8_t level, uint16_t transitionTime);
307 * @brief Level Control Cluster MoveWithOnOff Command callback
312 bool emberAfLevelControlClusterMoveWithOnOffCallback(uint8_t moveMode, uint8_t rate);
315 * @brief Level Control Cluster Step Command callback
318 * @param transitionTime
320 * @param optionOverride
323 bool emberAfLevelControlClusterStepCallback(uint8_t stepMode, uint8_t stepSize, uint16_t transitionTime, uint8_t optionMask,
324 uint8_t optionOverride);
327 * @brief Level Control Cluster StepWithOnOff Command callback
330 * @param transitionTime
333 bool emberAfLevelControlClusterStepWithOnOffCallback(uint8_t stepMode, uint8_t stepSize, uint16_t transitionTime);
336 * @brief Level Control Cluster Stop Command callback
338 * @param optionOverride
341 bool emberAfLevelControlClusterStopCallback(uint8_t optionMask, uint8_t optionOverride);
344 * @brief Level Control Cluster StopWithOnOff Command callback
347 bool emberAfLevelControlClusterStopWithOnOffCallback();
350 * @brief Network Commissioning Cluster AddThreadNetwork Command callback
351 * @param operationalDataset
356 bool emberAfNetworkCommissioningClusterAddThreadNetworkCallback(uint8_t * operationalDataset, uint64_t breadcrumb,
360 * @brief Network Commissioning Cluster AddWiFiNetwork Command callback
367 bool emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(uint8_t * ssid, uint8_t * credentials, uint64_t breadcrumb,
371 * @brief Network Commissioning Cluster DisableNetwork Command callback
377 bool emberAfNetworkCommissioningClusterDisableNetworkCallback(uint8_t * networkID, uint64_t breadcrumb, uint32_t timeoutMs);
380 * @brief Network Commissioning Cluster EnableNetwork Command callback
386 bool emberAfNetworkCommissioningClusterEnableNetworkCallback(uint8_t * networkID, uint64_t breadcrumb, uint32_t timeoutMs);
389 * @brief Network Commissioning Cluster GetLastNetworkCommissioningResult Command callback
393 bool emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(uint32_t timeoutMs);
396 * @brief Network Commissioning Cluster RemoveNetwork Command callback
402 bool emberAfNetworkCommissioningClusterRemoveNetworkCallback(uint8_t * NetworkID, uint64_t Breadcrumb, uint32_t TimeoutMs);
405 * @brief Network Commissioning Cluster ScanNetworks Command callback
411 bool emberAfNetworkCommissioningClusterScanNetworksCallback(uint8_t * ssid, uint64_t breadcrumb, uint32_t timeoutMs);
414 * @brief Network Commissioning Cluster UpdateThreadNetwork Command callback
415 * @param operationalDataset
420 bool emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback(uint8_t * operationalDataset, uint64_t breadcrumb,
424 * @brief Network Commissioning Cluster UpdateWiFiNetwork Command callback
431 bool emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(uint8_t * ssid, uint8_t * credentials, uint64_t breadcrumb,
435 * @brief On/off Cluster Off Command callback
438 bool emberAfOnOffClusterOffCallback();
441 * @brief On/off Cluster On Command callback
444 bool emberAfOnOffClusterOnCallback();
447 * @brief On/off Cluster Toggle Command callback
450 bool emberAfOnOffClusterToggleCallback();
453 // Non-Cluster Related Callbacks
456 /** @brief Add To Current App Tasks
458 * This function is only useful to sleepy end devices. This function will note
459 * the passed item as part of a set of tasks the application has outstanding
460 * (e.g. message sent requiring APS acknwoledgement). This will affect how the
461 * application behaves with regard to sleeping and polling. Until the
462 * outstanding task is completed, the device may poll more frequently and sleep
465 * @param tasks Ver.: always
467 void emberAfAddToCurrentAppTasksCallback(EmberAfApplicationTask tasks);
469 /** @brief Remove From Current App Tasks
471 * This function is only useful to sleepy end devices. This function will
472 * remove the passed item from the set of tasks the application has outstanding
473 * (e.g. message sent requiring APS acknwoledgement). This will affect how the
474 * application behaves with regard to sleeping and polling. Removing the item
475 * from the list of outstanding tasks may allow the device to sleep longer and
476 * poll less frequently. If there are other outstanding tasks the system may
477 * still have to stay away and poll more often.
479 * @param tasks Ver.: always
481 void emberAfRemoveFromCurrentAppTasksCallback(EmberAfApplicationTask tasks);
483 /** @brief Allow Network Write Attribute
485 * This function is called by the application framework before it writes an
486 * attribute in response to a write attribute request from an external device.
487 * The value passed into this callback is the value to which the attribute is to
488 * be set by the framework.
489 Example: In mirroring simple metering data
490 * on an Energy Services Interface (ESI) (formerly called Energy Service Portal
491 * (ESP) in SE 1.0).), a mirrored simple meter needs to write read-only
492 * attributes on its mirror. The-meter-mirror sample application, located in
493 * app/framework/sample-apps, uses this callback to allow the mirrored device to
494 * write simple metering attributes on the mirror regardless of the fact that
495 * most simple metering attributes are defined as read-only by the ZigBee
497 Note: The ZCL specification does not (as of this
498 * writing) specify any permission-level security for writing writeable
499 * attributes. As far as the ZCL specification is concerned, if an attribute is
500 * writeable, any device that has a link key for the device should be able to
501 * write that attribute. Furthermore if an attribute is read only, it should not
502 * be written over the air. Thus, if you implement permissions for writing
503 * attributes as a feature, you MAY be operating outside the specification. This
504 * is unlikely to be a problem for writing read-only attributes, but it may be a
505 * problem for attributes that are writeable according to the specification but
506 * restricted by the application implementing this callback.
508 * @param endpoint Ver.: always
509 * @param clusterId Ver.: always
510 * @param attributeId Ver.: always
511 * @param mask Ver.: always
512 * @param manufacturerCode Ver.: always
513 * @param value Ver.: always
514 * @param type Ver.: always
516 EmberAfAttributeWritePermission emberAfAllowNetworkWriteAttributeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
517 chip::AttributeId attributeId, uint8_t mask,
518 uint16_t manufacturerCode, uint8_t * value, uint8_t type);
520 /** @brief Attribute Read Access
522 * This function is called whenever the Application Framework needs to check
523 * access permission for an attribute read.
525 * @param endpoint Ver.: always
526 * @param clusterId Ver.: always
527 * @param manufacturerCode Ver.: always
528 * @param attributeId Ver.: always
530 bool emberAfAttributeReadAccessCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, uint16_t manufacturerCode,
531 chip::AttributeId attributeId);
533 /** @brief Attribute Write Access
535 * This function is called whenever the Application Framework needs to check
536 * access permission for an attribute write.
538 * @param endpoint Ver.: always
539 * @param clusterId Ver.: always
540 * @param manufacturerCode Ver.: always
541 * @param attributeId Ver.: always
543 bool emberAfAttributeWriteAccessCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, uint16_t manufacturerCode,
544 chip::AttributeId attributeId);
546 /** @brief Default Response
548 * This function is called by the application framework when a Default Response
549 * command is received from an external device. The application should return
550 * true if the message was processed or false if it was not.
552 * @param clusterId The cluster identifier of this response. Ver.: always
553 * @param commandId The command identifier to which this is a response. Ver.:
555 * @param status Specifies either SUCCESS or the nature of the error that was
556 * detected in the received command. Ver.: always
558 bool emberAfDefaultResponseCallback(chip::ClusterId clusterId, chip::CommandId commandId, EmberAfStatus status);
560 /** @brief Configure Reporting Response
562 * This function is called by the application framework when a Configure
563 * Reporting Response command is received from an external device. The
564 * application should return true if the message was processed or false if it
567 * @param clusterId The cluster identifier of this response. Ver.: always
568 * @param buffer Buffer containing the list of attribute status records. Ver.:
570 * @param bufLen The length in bytes of the list. Ver.: always
572 bool emberAfConfigureReportingResponseCallback(chip::ClusterId clusterId, uint8_t * buffer, uint16_t bufLen);
574 /** @brief Read Reporting Configuration Response
576 * This function is called by the application framework when a Read Reporting
577 * Configuration Response command is received from an external device. The
578 * application should return true if the message was processed or false if it
581 * @param clusterId The cluster identifier of this response. Ver.: always
582 * @param buffer Buffer containing the list of attribute reporting configuration
583 * records. Ver.: always
584 * @param bufLen The length in bytes of the list. Ver.: always
586 bool emberAfReadReportingConfigurationResponseCallback(chip::ClusterId clusterId, uint8_t * buffer, uint16_t bufLen);
588 /** @brief Discover Attributes Response
590 * This function is called by the application framework when a Discover
591 * Attributes Response or Discover Attributes Extended Response command is
592 * received from an external device. The Discover Attributes Response command
593 * contains a bool indicating if discovery is complete and a list of zero or
594 * more attribute identifier/type records. The final argument indicates whether
595 * the response is in the extended format or not. The application should return
596 * true if the message was processed or false if it was not.
598 * @param clusterId The cluster identifier of this response. Ver.: always
599 * @param discoveryComplete Indicates whether there are more attributes to be
600 * discovered. true if there are no more attributes to be discovered. Ver.:
602 * @param buffer Buffer containing the list of attribute identifier/type
603 * records. Ver.: always
604 * @param bufLen The length in bytes of the list. Ver.: always
605 * @param extended Indicates whether the response is in the extended format or
608 bool emberAfDiscoverAttributesResponseCallback(chip::ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, uint16_t bufLen,
611 /** @brief Discover Commands Generated Response
613 * This function is called by the framework when Discover Commands Generated
614 * Response is received.
616 * @param clusterId The cluster identifier of this response. Ver.: always
617 * @param manufacturerCode Manufacturer code Ver.: always
618 * @param discoveryComplete Indicates whether there are more commands to be
619 * discovered. Ver.: always
620 * @param commandIds Buffer containing the list of command identifiers. Ver.:
622 * @param commandIdCount The length of bytes of the list, whish is the same as
623 * the number of identifiers. Ver.: always
625 bool emberAfDiscoverCommandsGeneratedResponseCallback(chip::ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete,
626 chip::CommandId * commandIds, uint16_t commandIdCount);
628 /** @brief Discover Commands Received Response
630 * This function is called by the framework when Discover Commands Received
631 * Response is received.
633 * @param clusterId The cluster identifier of this response. Ver.: always
634 * @param manufacturerCode Manufacturer code Ver.: always
635 * @param discoveryComplete Indicates whether there are more commands to be
636 * discovered. Ver.: always
637 * @param commandIds Buffer containing the list of command identifiers. Ver.:
639 * @param commandIdCount The length of bytes of the list, whish is the same as
640 * the number of identifiers. Ver.: always
642 bool emberAfDiscoverCommandsReceivedResponseCallback(chip::ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete,
643 chip::CommandId * commandIds, uint16_t commandIdCount);
645 /** @brief Pre Command Received
647 * This callback is the second in the Application Framework's message processing
648 * chain. At this point in the processing of incoming over-the-air messages, the
649 * application has determined that the incoming message is a ZCL command. It
650 * parses enough of the message to populate an EmberAfClusterCommand struct. The
651 * Application Framework defines this struct value in a local scope to the
652 * command processing but also makes it available through a global pointer
653 * called emberAfCurrentCommand, in app/framework/util/util.c. When command
654 * processing is complete, this pointer is cleared.
656 * @param cmd Ver.: always
658 bool emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd);
660 /** @brief Pre Message Send
662 * This function is called by the framework when it is about to pass a message
663 * to the stack primitives for sending. This message may or may not be ZCL,
664 * ZDO, or some other protocol. This is called prior to
666 * fragmentation that may be done. If the function returns true it is assumed
667 * the callback has consumed and processed the message. The callback must also
668 * set the EmberStatus status code to be passed back to the caller. The
669 * framework will do no further processing on the message.
671 * function returns false then it is assumed that the callback has not processed
672 * the mesasge and the framework will continue to process accordingly.
674 * @param messageStruct The structure containing the parameters of the APS
675 * message to be sent. Ver.: always
676 * @param status A pointer to the status code value that will be returned to the
677 * caller. Ver.: always
679 bool emberAfPreMessageSendCallback(EmberAfMessageStruct * messageStruct, EmberStatus * status);
681 /** @brief Message Sent
683 * This function is called by the application framework from the message sent
684 * handler, when it is informed by the stack regarding the message sent status.
685 * All of the values passed to the emberMessageSentHandler are passed on to this
686 * callback. This provides an opportunity for the application to verify that its
687 * message has been sent successfully and take the appropriate action. This
688 * callback should return a bool value of true or false. A value of true
689 * indicates that the message sent notification has been handled and should not
690 * be handled by the application framework.
692 * @param type Ver.: always
693 * @param indexOrDestination Ver.: always
694 * @param apsFrame Ver.: always
695 * @param msgLen Ver.: always
696 * @param message Ver.: always
697 * @param status Ver.: always
699 bool emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, EmberApsFrame * apsFrame,
700 uint16_t msgLen, uint8_t * message, EmberStatus status);
702 /** @brief Pre Attribute Change
704 * This function is called by the application framework before it changes an
705 * attribute value. The value passed into this callback is the value to which
706 * the attribute is to be set by the framework. The application should return
707 * ::EMBER_ZCL_STATUS_SUCCESS to permit the change or any other ::EmberAfStatus
710 * @param endpoint Ver.: always
711 * @param clusterId Ver.: always
712 * @param attributeId Ver.: always
713 * @param mask Ver.: always
714 * @param manufacturerCode Ver.: always
715 * @param type Ver.: always
716 * @param size Ver.: always
717 * @param value Ver.: always
719 EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId,
720 uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size,
723 /** @brief Post Attribute Change
725 * This function is called by the application framework after it changes an
726 * attribute value. The value passed into this callback is the value to which
727 * the attribute was set by the framework.
729 * @param endpoint Ver.: always
730 * @param clusterId Ver.: always
731 * @param attributeId Ver.: always
732 * @param mask Ver.: always
733 * @param manufacturerCode Ver.: always
734 * @param type Ver.: always
735 * @param size Ver.: always
736 * @param value Ver.: always
738 void emberAfPostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId,
739 uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value);
741 /** @brief Read Attributes Response
743 * This function is called by the application framework when a Read Attributes
744 * Response command is received from an external device. The application should
745 * return true if the message was processed or false if it was not.
747 * @param clusterId The cluster identifier of this response. Ver.: always
748 * @param buffer Buffer containing the list of read attribute status records.
750 * @param bufLen The length in bytes of the list. Ver.: always
752 bool emberAfReadAttributesResponseCallback(chip::ClusterId clusterId, uint8_t * buffer, uint16_t bufLen);
754 /** @brief External Attribute Read
756 * Like emberAfExternalAttributeWriteCallback above, this function is called
757 * when the framework needs to read an attribute that is not stored within the
758 * Application Framework's data structures.
760 * information about the attribute itself is passed as a pointer to an
761 * EmberAfAttributeMetadata struct, which is stored within the application and
762 * used to manage the attribute. A complete description of the
763 * EmberAfAttributeMetadata struct is provided in
764 * app/framework/include/af-types.h
765 This function assumes that the
766 * application is able to read the attribute, write it into the passed buffer,
767 * and return immediately. Any attributes that require a state machine for
768 * reading and writing are not really candidates for externalization at the
769 * present time. The Application Framework does not currently include a state
770 * machine for reading or writing attributes that must take place across a
771 * series of application ticks. Attributes that cannot be read in a timely
772 * manner should be stored within the Application Framework and updated
773 * occasionally by the application code from within the
774 * emberAfMainTickCallback.
775 If the application was successfully able to
776 * read the attribute and write it into the passed buffer, it should return a
777 * value of EMBER_ZCL_STATUS_SUCCESS. Ensure that the size of the externally
778 * managed attribute value is smaller than what the buffer can hold. In the case
779 * of a buffer overflow throw an appropriate error such as
780 * EMBER_ZCL_STATUS_INSUFFICIENT_SPACE. Any other return value indicates the
781 * application was not able to read the attribute.
783 * @param endpoint Ver.: always
784 * @param clusterId Ver.: always
785 * @param attributeMetadata Ver.: always
786 * @param manufacturerCode Ver.: always
787 * @param buffer Ver.: always
788 * @param maxReadLength Ver.: always
790 EmberAfStatus emberAfExternalAttributeReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
791 EmberAfAttributeMetadata * attributeMetadata, uint16_t manufacturerCode,
792 uint8_t * buffer, uint16_t maxReadLength);
794 /** @brief Write Attributes Response
796 * This function is called by the application framework when a Write Attributes
797 * Response command is received from an external device. The application should
798 * return true if the message was processed or false if it was not.
800 * @param clusterId The cluster identifier of this response. Ver.: always
801 * @param buffer Buffer containing the list of write attribute status records.
803 * @param bufLen The length in bytes of the list. Ver.: always
805 bool emberAfWriteAttributesResponseCallback(chip::ClusterId clusterId, uint8_t * buffer, uint16_t bufLen);
807 /** @brief External Attribute Write
809 * This function is called whenever the Application Framework needs to write an
810 * attribute which is not stored within the data structures of the Application
811 * Framework itself. One of the new features in Version 2 is the ability to
812 * store attributes outside the Framework. This is particularly useful for
813 * attributes that do not need to be stored because they can be read off the
814 * hardware when they are needed, or are stored in some central location used by
815 * many modules within the system. In this case, you can indicate that the
816 * attribute is stored externally. When the framework needs to write an external
817 * attribute, it makes a call to this callback.
818 This callback is very
819 * useful for host micros which need to store attributes in persistent memory.
820 * Because each host micro (used with an Ember NCP) has its own type of
821 * persistent memory storage, the Application Framework does not include the
822 * ability to mark attributes as stored in flash the way that it does for Ember
823 * SoCs like the EM35x. On a host micro, any attributes that need to be stored
824 * in persistent memory should be marked as external and accessed through the
825 * external read and write callbacks. Any host code associated with the
826 * persistent storage should be implemented within this callback.
828 * the important information about the attribute itself is passed as a pointer
829 * to an EmberAfAttributeMetadata struct, which is stored within the application
830 * and used to manage the attribute. A complete description of the
831 * EmberAfAttributeMetadata struct is provided in
832 * app/framework/include/af-types.h.
833 This function assumes that the
834 * application is able to write the attribute and return immediately. Any
835 * attributes that require a state machine for reading and writing are not
836 * candidates for externalization at the present time. The Application Framework
837 * does not currently include a state machine for reading or writing attributes
838 * that must take place across a series of application ticks. Attributes that
839 * cannot be written immediately should be stored within the Application
840 * Framework and updated occasionally by the application code from within the
841 * emberAfMainTickCallback.
842 If the application was successfully able to
843 * write the attribute, it returns a value of EMBER_ZCL_STATUS_SUCCESS. Any
844 * other return value indicates the application was not able to write the
847 * @param endpoint Ver.: always
848 * @param clusterId Ver.: always
849 * @param attributeMetadata Ver.: always
850 * @param manufacturerCode Ver.: always
851 * @param buffer Ver.: always
853 EmberAfStatus emberAfExternalAttributeWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
854 EmberAfAttributeMetadata * attributeMetadata, uint16_t manufacturerCode,
857 /** @brief Report Attributes
859 * This function is called by the application framework when a Report Attributes
860 * command is received from an external device. The application should return
861 * true if the message was processed or false if it was not.
863 * @param clusterId The cluster identifier of this command. Ver.: always
864 * @param buffer Buffer containing the list of attribute report records. Ver.:
866 * @param bufLen The length in bytes of the list. Ver.: always
868 bool emberAfReportAttributesCallback(chip::ClusterId clusterId, uint8_t * buffer, uint16_t bufLen);
870 /** @brief Get Current Time
872 * This callback is called when device attempts to get current time from the
873 * hardware. If this device has means to retrieve exact time, then this method
874 * should implement it. If the callback can't provide the exact time it should
875 * return 0 to indicate failure. Default action is to return 0, which indicates
876 * that device does not have access to real time.
879 uint32_t emberAfGetCurrentTimeCallback();
881 /** @brief Get Endpoint Info
883 * This function is a callback to an application implemented endpoint that
884 * operates outside the normal application framework. When the framework wishes
885 * to perform operations with that endpoint it uses this callback to retrieve
886 * the endpoint's information. If the endpoint exists and the application can
887 * provide data then true shall be returned. Otherwise the callback must return
890 * @param endpoint The endpoint to retrieve data for. Ver.: always
891 * @param returnNetworkIndex The index corresponding to the ZigBee network the
892 * endpoint belongs to. If not using a multi-network device, 0 must be
893 * returned. Otherwise on a multi-network device the stack will switch to this
894 * network before sending the message. Ver.: always
895 * @param returnEndpointInfo A pointer to a data struct that will be written
896 * with information about the endpoint. Ver.: always
898 bool emberAfGetEndpointInfoCallback(chip::EndpointId endpoint, uint8_t * returnNetworkIndex,
899 EmberAfEndpointInfoStruct * returnEndpointInfo);
901 /** @brief Get Source Route Overhead
903 * This function is called by the framework to determine the overhead required
904 * in the network frame for source routing to a particular destination.
906 * @param destination The node id of the destination Ver.: always
908 uint8_t emberAfGetSourceRouteOverheadCallback(chip::NodeId destination);
910 /** @brief Registration Abort
912 * This callback is called when the device should abort the registration
916 void emberAfRegistrationAbortCallback();
918 /** @brief Interpan Send Message
920 * This function will send a raw MAC message with interpan frame format using
921 * the passed parameters.
923 * @param header Interpan header info Ver.: always
924 * @param messageLength The length of the message received or to send Ver.:
926 * @param message The message data received or to send. Ver.: always
928 EmberStatus emberAfInterpanSendMessageCallback(EmberAfInterpanHeader * header, uint16_t messageLength, uint8_t * message);
930 /** @brief Start Move
932 * This function is called to initiate the process for a device to move (rejoin)
936 bool emberAfStartMoveCallback();