c76cbccf4dd9ae0af06a5ce8b1442353fb629137
[platform/upstream/connectedhomeip.git] / examples / temperature-measurement-app / esp32 / main / gen / callback.h
1 /*
2  *
3  *    Copyright (c) 2021 Project CHIP Authors
4  *
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
8  *
9  *        http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  */
17
18 // THIS FILE IS GENERATED BY ZAP
19
20 // Prevent multiple inclusion
21 #pragma once
22
23 #include "af-structs.h"
24 #include "af-types.h"
25 #include "basic-types.h"
26
27 /** @brief Cluster Init
28  *
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.
32  *
33  * @param endpoint   Ver.: always
34  * @param clusterId   Ver.: always
35  */
36 void emberAfClusterInitCallback(chip::EndpointId endpoint, chip::ClusterId clusterId);
37
38 // Cluster Init Functions
39
40 /** @brief Basic Cluster Init
41  *
42  * Cluster Init
43  *
44  * @param endpoint    Endpoint that is being initialized
45  */
46 void emberAfBasicClusterInitCallback(chip::EndpointId endpoint);
47
48 /** @brief Temperature Measurement Cluster Init
49  *
50  * Cluster Init
51  *
52  * @param endpoint    Endpoint that is being initialized
53  */
54 void emberAfTemperatureMeasurementClusterInitCallback(chip::EndpointId endpoint);
55
56 // Cluster Server/Client Init Functions
57
58 //
59 // Basic Cluster server
60 //
61
62 /** @brief Basic Cluster Server Init
63  *
64  * Server Init
65  *
66  * @param endpoint    Endpoint that is being initialized
67  */
68 void emberAfBasicClusterServerInitCallback(chip::EndpointId endpoint);
69
70 /** @brief Basic Cluster Server Attribute Changed
71  *
72  * Server Attribute Changed
73  *
74  * @param endpoint    Endpoint that is being initialized
75  * @param attributeId Attribute that changed
76  */
77 void emberAfBasicClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId);
78
79 /** @brief Basic Cluster Server Manufacturer Specific Attribute Changed
80  *
81  * Server Manufacturer Specific Attribute Changed
82  *
83  * @param endpoint          Endpoint that is being initialized
84  * @param attributeId       Attribute that changed
85  * @param manufacturerCode  Manufacturer Code of the attribute that changed
86  */
87 void emberAfBasicClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId,
88                                                                            uint16_t manufacturerCode);
89
90 /** @brief Basic Cluster Server Message Sent
91  *
92  * Server Message Sent
93  *
94  * @param type               The type of message sent
95  * @param indexOrDestination The destination or address to which the message was sent
96  * @param apsFrame           The APS frame for the message
97  * @param msgLen             The length of the message
98  * @param message            The message that was sent
99  * @param status             The status of the sent message
100  */
101 void emberAfBasicClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination,
102                                                   EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message, EmberStatus status);
103
104 /** @brief Basic Cluster Server Pre Attribute Changed
105  *
106  * server Pre Attribute Changed
107  *
108  * @param endpoint      Endpoint that is being initialized
109  * @param attributeId   Attribute to be changed
110  * @param attributeType Attribute type
111  * @param size          Attribute size
112  * @param value         Attribute value
113  */
114 EmberAfStatus emberAfBasicClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId,
115                                                                    EmberAfAttributeType attributeType, uint8_t size,
116                                                                    uint8_t * value);
117
118 /** @brief Basic Cluster Server Tick
119  *
120  * server Tick
121  *
122  * @param endpoint  Endpoint that is being served
123  */
124 void emberAfBasicClusterServerTickCallback(chip::EndpointId endpoint);
125
126 //
127 // Temperature Measurement Cluster server
128 //
129
130 /** @brief Temperature Measurement Cluster Server Init
131  *
132  * Server Init
133  *
134  * @param endpoint    Endpoint that is being initialized
135  */
136 void emberAfTemperatureMeasurementClusterServerInitCallback(chip::EndpointId endpoint);
137
138 /** @brief Temperature Measurement Cluster Server Attribute Changed
139  *
140  * Server Attribute Changed
141  *
142  * @param endpoint    Endpoint that is being initialized
143  * @param attributeId Attribute that changed
144  */
145 void emberAfTemperatureMeasurementClusterServerAttributeChangedCallback(chip::EndpointId endpoint, chip::AttributeId attributeId);
146
147 /** @brief Temperature Measurement Cluster Server Manufacturer Specific Attribute Changed
148  *
149  * Server Manufacturer Specific Attribute Changed
150  *
151  * @param endpoint          Endpoint that is being initialized
152  * @param attributeId       Attribute that changed
153  * @param manufacturerCode  Manufacturer Code of the attribute that changed
154  */
155 void emberAfTemperatureMeasurementClusterServerManufacturerSpecificAttributeChangedCallback(chip::EndpointId endpoint,
156                                                                                             chip::AttributeId attributeId,
157                                                                                             uint16_t manufacturerCode);
158
159 /** @brief Temperature Measurement Cluster Server Message Sent
160  *
161  * Server Message Sent
162  *
163  * @param type               The type of message sent
164  * @param indexOrDestination The destination or address to which the message was sent
165  * @param apsFrame           The APS frame for the message
166  * @param msgLen             The length of the message
167  * @param message            The message that was sent
168  * @param status             The status of the sent message
169  */
170 void emberAfTemperatureMeasurementClusterServerMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination,
171                                                                    EmberApsFrame * apsFrame, uint16_t msgLen, uint8_t * message,
172                                                                    EmberStatus status);
173
174 /** @brief Temperature Measurement Cluster Server Pre Attribute Changed
175  *
176  * server Pre Attribute Changed
177  *
178  * @param endpoint      Endpoint that is being initialized
179  * @param attributeId   Attribute to be changed
180  * @param attributeType Attribute type
181  * @param size          Attribute size
182  * @param value         Attribute value
183  */
184 EmberAfStatus emberAfTemperatureMeasurementClusterServerPreAttributeChangedCallback(chip::EndpointId endpoint,
185                                                                                     chip::AttributeId attributeId,
186                                                                                     EmberAfAttributeType attributeType,
187                                                                                     uint8_t size, uint8_t * value);
188
189 /** @brief Temperature Measurement Cluster Server Tick
190  *
191  * server Tick
192  *
193  * @param endpoint  Endpoint that is being served
194  */
195 void emberAfTemperatureMeasurementClusterServerTickCallback(chip::EndpointId endpoint);
196
197 // Cluster Commands Callback
198
199 /**
200  * @brief Basic Cluster ResetToFactoryDefaults Command callback
201  */
202
203 bool emberAfBasicClusterResetToFactoryDefaultsCallback();
204
205 //
206 // Non-Cluster Related Callbacks
207 //
208
209 /** @brief Add To Current App Tasks
210  *
211  * This function is only useful to sleepy end devices.  This function will note
212  * the passed item as part of a set of tasks the application has outstanding
213  * (e.g. message sent requiring APS acknwoledgement).  This will affect how the
214  * application behaves with regard to sleeping and polling.  Until the
215  * outstanding task is completed, the device may poll more frequently and sleep
216  * less often.
217  *
218  * @param tasks   Ver.: always
219  */
220 void emberAfAddToCurrentAppTasksCallback(EmberAfApplicationTask tasks);
221
222 /** @brief Remove From Current App Tasks
223  *
224  * This function is only useful to sleepy end devices.  This function will
225  * remove the passed item from the set of tasks the application has outstanding
226  * (e.g. message sent requiring APS acknwoledgement).  This will affect how the
227  * application behaves with regard to sleeping and polling.  Removing the item
228  * from the list of outstanding tasks may allow the device to sleep longer and
229  * poll less frequently.  If there are other outstanding tasks the system may
230  * still have to stay away and poll more often.
231  *
232  * @param tasks   Ver.: always
233  */
234 void emberAfRemoveFromCurrentAppTasksCallback(EmberAfApplicationTask tasks);
235
236 /** @brief Allow Network Write Attribute
237  *
238  * This function is called by the application framework before it writes an
239  * attribute in response to a write attribute request from an external device.
240  * The value passed into this callback is the value to which the attribute is to
241  * be set by the framework.
242         Example:        In mirroring simple metering data
243  * on an Energy Services Interface (ESI) (formerly called Energy Service Portal
244  * (ESP) in SE 1.0).), a mirrored simple meter needs to write read-only
245  * attributes on its mirror. The-meter-mirror sample application, located in
246  * app/framework/sample-apps, uses this callback to allow the mirrored device to
247  * write simple metering attributes on the mirror regardless of the fact that
248  * most simple metering attributes are defined as read-only by the ZigBee
249  * specification.
250         Note:   The ZCL specification does not (as of this
251  * writing) specify any permission-level security for writing writeable
252  * attributes. As far as the ZCL specification is concerned, if an attribute is
253  * writeable, any device that has a link key for the device should be able to
254  * write that attribute. Furthermore if an attribute is read only, it should not
255  * be written over the air. Thus, if you implement permissions for writing
256  * attributes as a feature, you MAY be operating outside the specification. This
257  * is unlikely to be a problem for writing read-only attributes, but it may be a
258  * problem for attributes that are writeable according to the specification but
259  * restricted by the application implementing this callback.
260  *
261  * @param endpoint   Ver.: always
262  * @param clusterId   Ver.: always
263  * @param attributeId   Ver.: always
264  * @param mask   Ver.: always
265  * @param manufacturerCode   Ver.: always
266  * @param value   Ver.: always
267  * @param type   Ver.: always
268  */
269 EmberAfAttributeWritePermission emberAfAllowNetworkWriteAttributeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
270                                                                           chip::AttributeId attributeId, uint8_t mask,
271                                                                           uint16_t manufacturerCode, uint8_t * value, uint8_t type);
272
273 /** @brief Attribute Read Access
274  *
275  * This function is called whenever the Application Framework needs to check
276  * access permission for an attribute read.
277  *
278  * @param endpoint   Ver.: always
279  * @param clusterId   Ver.: always
280  * @param manufacturerCode   Ver.: always
281  * @param attributeId   Ver.: always
282  */
283 bool emberAfAttributeReadAccessCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, uint16_t manufacturerCode,
284                                         chip::AttributeId attributeId);
285
286 /** @brief Attribute Write Access
287  *
288  * This function is called whenever the Application Framework needs to check
289  * access permission for an attribute write.
290  *
291  * @param endpoint   Ver.: always
292  * @param clusterId   Ver.: always
293  * @param manufacturerCode   Ver.: always
294  * @param attributeId   Ver.: always
295  */
296 bool emberAfAttributeWriteAccessCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, uint16_t manufacturerCode,
297                                          chip::AttributeId attributeId);
298
299 /** @brief Default Response
300  *
301  * This function is called by the application framework when a Default Response
302  * command is received from an external device.  The application should return
303  * true if the message was processed or false if it was not.
304  *
305  * @param clusterId The cluster identifier of this response.  Ver.: always
306  * @param commandId The command identifier to which this is a response.  Ver.:
307  * always
308  * @param status Specifies either SUCCESS or the nature of the error that was
309  * detected in the received command.  Ver.: always
310  */
311 bool emberAfDefaultResponseCallback(chip::ClusterId clusterId, chip::CommandId commandId, EmberAfStatus status);
312
313 /** @brief Configure Reporting Response
314  *
315  * This function is called by the application framework when a Configure
316  * Reporting Response command is received from an external device.  The
317  * application should return true if the message was processed or false if it
318  * was not.
319  *
320  * @param clusterId The cluster identifier of this response.  Ver.: always
321  * @param buffer Buffer containing the list of attribute status records.  Ver.:
322  * always
323  * @param bufLen The length in bytes of the list.  Ver.: always
324  */
325 bool emberAfConfigureReportingResponseCallback(chip::ClusterId clusterId, uint8_t * buffer, uint16_t bufLen);
326
327 /** @brief Read Reporting Configuration Response
328  *
329  * This function is called by the application framework when a Read Reporting
330  * Configuration Response command is received from an external device.  The
331  * application should return true if the message was processed or false if it
332  * was not.
333  *
334  * @param clusterId The cluster identifier of this response.  Ver.: always
335  * @param buffer Buffer containing the list of attribute reporting configuration
336  * records.  Ver.: always
337  * @param bufLen The length in bytes of the list.  Ver.: always
338  */
339 bool emberAfReadReportingConfigurationResponseCallback(chip::ClusterId clusterId, uint8_t * buffer, uint16_t bufLen);
340
341 /** @brief Discover Attributes Response
342  *
343  * This function is called by the application framework when a Discover
344  * Attributes Response or Discover Attributes Extended Response command is
345  * received from an external device.  The Discover Attributes Response command
346  * contains a bool indicating if discovery is complete and a list of zero or
347  * more attribute identifier/type records. The final argument indicates whether
348  * the response is in the extended format or not.  The application should return
349  * true if the message was processed or false if it was not.
350  *
351  * @param clusterId The cluster identifier of this response.  Ver.: always
352  * @param discoveryComplete Indicates whether there are more attributes to be
353  * discovered.  true if there are no more attributes to be discovered.  Ver.:
354  * always
355  * @param buffer Buffer containing the list of attribute identifier/type
356  * records.  Ver.: always
357  * @param bufLen The length in bytes of the list.  Ver.: always
358  * @param extended Indicates whether the response is in the extended format or
359  * not.  Ver.: always
360  */
361 bool emberAfDiscoverAttributesResponseCallback(chip::ClusterId clusterId, bool discoveryComplete, uint8_t * buffer, uint16_t bufLen,
362                                                bool extended);
363
364 /** @brief Discover Commands Generated Response
365  *
366  * This function is called by the framework when Discover Commands Generated
367  * Response is received.
368  *
369  * @param clusterId The cluster identifier of this response.  Ver.: always
370  * @param manufacturerCode Manufacturer code  Ver.: always
371  * @param discoveryComplete Indicates whether there are more commands to be
372  * discovered.  Ver.: always
373  * @param commandIds Buffer containing the list of command identifiers.  Ver.:
374  * always
375  * @param commandIdCount The length of bytes of the list, whish is the same as
376  * the number of identifiers.  Ver.: always
377  */
378 bool emberAfDiscoverCommandsGeneratedResponseCallback(chip::ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete,
379                                                       chip::CommandId * commandIds, uint16_t commandIdCount);
380
381 /** @brief Discover Commands Received Response
382  *
383  * This function is called by the framework when Discover Commands Received
384  * Response is received.
385  *
386  * @param clusterId The cluster identifier of this response.  Ver.: always
387  * @param manufacturerCode Manufacturer code  Ver.: always
388  * @param discoveryComplete Indicates whether there are more commands to be
389  * discovered.  Ver.: always
390  * @param commandIds Buffer containing the list of command identifiers.  Ver.:
391  * always
392  * @param commandIdCount The length of bytes of the list, whish is the same as
393  * the number of identifiers.  Ver.: always
394  */
395 bool emberAfDiscoverCommandsReceivedResponseCallback(chip::ClusterId clusterId, uint16_t manufacturerCode, bool discoveryComplete,
396                                                      chip::CommandId * commandIds, uint16_t commandIdCount);
397
398 /** @brief Pre Command Received
399  *
400  * This callback is the second in the Application Framework's message processing
401  * chain. At this point in the processing of incoming over-the-air messages, the
402  * application has determined that the incoming message is a ZCL command. It
403  * parses enough of the message to populate an EmberAfClusterCommand struct. The
404  * Application Framework defines this struct value in a local scope to the
405  * command processing but also makes it available through a global pointer
406  * called emberAfCurrentCommand, in app/framework/util/util.c. When command
407  * processing is complete, this pointer is cleared.
408  *
409  * @param cmd   Ver.: always
410  */
411 bool emberAfPreCommandReceivedCallback(EmberAfClusterCommand * cmd);
412
413 /** @brief Pre Message Send
414  *
415  * This function is called by the framework when it is about to pass a message
416  * to the stack primitives for sending.   This message may or may not be ZCL,
417  * ZDO, or some other protocol.  This is called prior to
418         any ZigBee
419  * fragmentation that may be done.  If the function returns true it is assumed
420  * the callback has consumed and processed the message.  The callback must also
421  * set the EmberStatus status code to be passed back to the caller.  The
422  * framework will do no further processing on the message.
423         If the
424  * function returns false then it is assumed that the callback has not processed
425  * the mesasge and the framework will continue to process accordingly.
426  *
427  * @param messageStruct The structure containing the parameters of the APS
428  * message to be sent.  Ver.: always
429  * @param status A pointer to the status code value that will be returned to the
430  * caller.  Ver.: always
431  */
432 bool emberAfPreMessageSendCallback(EmberAfMessageStruct * messageStruct, EmberStatus * status);
433
434 /** @brief Message Sent
435  *
436  * This function is called by the application framework from the message sent
437  * handler, when it is informed by the stack regarding the message sent status.
438  * All of the values passed to the emberMessageSentHandler are passed on to this
439  * callback. This provides an opportunity for the application to verify that its
440  * message has been sent successfully and take the appropriate action. This
441  * callback should return a bool value of true or false. A value of true
442  * indicates that the message sent notification has been handled and should not
443  * be handled by the application framework.
444  *
445  * @param type   Ver.: always
446  * @param indexOrDestination   Ver.: always
447  * @param apsFrame   Ver.: always
448  * @param msgLen   Ver.: always
449  * @param message   Ver.: always
450  * @param status   Ver.: always
451  */
452 bool emberAfMessageSentCallback(EmberOutgoingMessageType type, uint64_t indexOrDestination, EmberApsFrame * apsFrame,
453                                 uint16_t msgLen, uint8_t * message, EmberStatus status);
454
455 /** @brief Pre Attribute Change
456  *
457  * This function is called by the application framework before it changes an
458  * attribute value.  The value passed into this callback is the value to which
459  * the attribute is to be set by the framework.  The application should return
460  * ::EMBER_ZCL_STATUS_SUCCESS to permit the change or any other ::EmberAfStatus
461  * to reject it.
462  *
463  * @param endpoint   Ver.: always
464  * @param clusterId   Ver.: always
465  * @param attributeId   Ver.: always
466  * @param mask   Ver.: always
467  * @param manufacturerCode   Ver.: always
468  * @param type   Ver.: always
469  * @param size   Ver.: always
470  * @param value   Ver.: always
471  */
472 EmberAfStatus emberAfPreAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId,
473                                                 uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size,
474                                                 uint8_t * value);
475
476 /** @brief Post Attribute Change
477  *
478  * This function is called by the application framework after it changes an
479  * attribute value. The value passed into this callback is the value to which
480  * the attribute was set by the framework.
481  *
482  * @param endpoint   Ver.: always
483  * @param clusterId   Ver.: always
484  * @param attributeId   Ver.: always
485  * @param mask   Ver.: always
486  * @param manufacturerCode   Ver.: always
487  * @param type   Ver.: always
488  * @param size   Ver.: always
489  * @param value   Ver.: always
490  */
491 void emberAfPostAttributeChangeCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId,
492                                         uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value);
493
494 /** @brief Read Attributes Response
495  *
496  * This function is called by the application framework when a Read Attributes
497  * Response command is received from an external device.  The application should
498  * return true if the message was processed or false if it was not.
499  *
500  * @param clusterId The cluster identifier of this response.  Ver.: always
501  * @param buffer Buffer containing the list of read attribute status records.
502  * Ver.: always
503  * @param bufLen The length in bytes of the list.  Ver.: always
504  */
505 bool emberAfReadAttributesResponseCallback(chip::ClusterId clusterId, uint8_t * buffer, uint16_t bufLen);
506
507 /** @brief External Attribute Read
508  *
509  * Like emberAfExternalAttributeWriteCallback above, this function is called
510  * when the framework needs to read an attribute that is not stored within the
511  * Application Framework's data structures.
512         All of the important
513  * information about the attribute itself is passed as a pointer to an
514  * EmberAfAttributeMetadata struct, which is stored within the application and
515  * used to manage the attribute. A complete description of the
516  * EmberAfAttributeMetadata struct is provided in
517  * app/framework/include/af-types.h
518         This function assumes that the
519  * application is able to read the attribute, write it into the passed buffer,
520  * and return immediately. Any attributes that require a state machine for
521  * reading and writing are not really candidates for externalization at the
522  * present time. The Application Framework does not currently include a state
523  * machine for reading or writing attributes that must take place across a
524  * series of application ticks. Attributes that cannot be read in a timely
525  * manner should be stored within the Application Framework and updated
526  * occasionally by the application code from within the
527  * emberAfMainTickCallback.
528         If the application was successfully able to
529  * read the attribute and write it into the passed buffer, it should return a
530  * value of EMBER_ZCL_STATUS_SUCCESS. Ensure that the size of the externally
531  * managed attribute value is smaller than what the buffer can hold. In the case
532  * of a buffer overflow throw an appropriate error such as
533  * EMBER_ZCL_STATUS_INSUFFICIENT_SPACE. Any other return value indicates the
534  * application was not able to read the attribute.
535  *
536  * @param endpoint   Ver.: always
537  * @param clusterId   Ver.: always
538  * @param attributeMetadata   Ver.: always
539  * @param manufacturerCode   Ver.: always
540  * @param buffer   Ver.: always
541  * @param maxReadLength   Ver.: always
542  */
543 EmberAfStatus emberAfExternalAttributeReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
544                                                    EmberAfAttributeMetadata * attributeMetadata, uint16_t manufacturerCode,
545                                                    uint8_t * buffer, uint16_t maxReadLength);
546
547 /** @brief Write Attributes Response
548  *
549  * This function is called by the application framework when a Write Attributes
550  * Response command is received from an external device.  The application should
551  * return true if the message was processed or false if it was not.
552  *
553  * @param clusterId The cluster identifier of this response.  Ver.: always
554  * @param buffer Buffer containing the list of write attribute status records.
555  * Ver.: always
556  * @param bufLen The length in bytes of the list.  Ver.: always
557  */
558 bool emberAfWriteAttributesResponseCallback(chip::ClusterId clusterId, uint8_t * buffer, uint16_t bufLen);
559
560 /** @brief External Attribute Write
561  *
562  * This function is called whenever the Application Framework needs to write an
563  * attribute which is not stored within the data structures of the Application
564  * Framework itself. One of the new features in Version 2 is the ability to
565  * store attributes outside the Framework. This is particularly useful for
566  * attributes that do not need to be stored because they can be read off the
567  * hardware when they are needed, or are stored in some central location used by
568  * many modules within the system. In this case, you can indicate that the
569  * attribute is stored externally. When the framework needs to write an external
570  * attribute, it makes a call to this callback.
571         This callback is very
572  * useful for host micros which need to store attributes in persistent memory.
573  * Because each host micro (used with an Ember NCP) has its own type of
574  * persistent memory storage, the Application Framework does not include the
575  * ability to mark attributes as stored in flash the way that it does for Ember
576  * SoCs like the EM35x. On a host micro, any attributes that need to be stored
577  * in persistent memory should be marked as external and accessed through the
578  * external read and write callbacks. Any host code associated with the
579  * persistent storage should be implemented within this callback.
580         All of
581  * the important information about the attribute itself is passed as a pointer
582  * to an EmberAfAttributeMetadata struct, which is stored within the application
583  * and used to manage the attribute. A complete description of the
584  * EmberAfAttributeMetadata struct is provided in
585  * app/framework/include/af-types.h.
586         This function assumes that the
587  * application is able to write the attribute and return immediately. Any
588  * attributes that require a state machine for reading and writing are not
589  * candidates for externalization at the present time. The Application Framework
590  * does not currently include a state machine for reading or writing attributes
591  * that must take place across a series of application ticks. Attributes that
592  * cannot be written immediately should be stored within the Application
593  * Framework and updated occasionally by the application code from within the
594  * emberAfMainTickCallback.
595         If the application was successfully able to
596  * write the attribute, it returns a value of EMBER_ZCL_STATUS_SUCCESS. Any
597  * other return value indicates the application was not able to write the
598  * attribute.
599  *
600  * @param endpoint   Ver.: always
601  * @param clusterId   Ver.: always
602  * @param attributeMetadata   Ver.: always
603  * @param manufacturerCode   Ver.: always
604  * @param buffer   Ver.: always
605  */
606 EmberAfStatus emberAfExternalAttributeWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId,
607                                                     EmberAfAttributeMetadata * attributeMetadata, uint16_t manufacturerCode,
608                                                     uint8_t * buffer);
609
610 /** @brief Report Attributes
611  *
612  * This function is called by the application framework when a Report Attributes
613  * command is received from an external device.  The application should return
614  * true if the message was processed or false if it was not.
615  *
616  * @param clusterId The cluster identifier of this command.  Ver.: always
617  * @param buffer Buffer containing the list of attribute report records.  Ver.:
618  * always
619  * @param bufLen The length in bytes of the list.  Ver.: always
620  */
621 bool emberAfReportAttributesCallback(chip::ClusterId clusterId, uint8_t * buffer, uint16_t bufLen);
622
623 /** @brief Get Current Time
624  *
625  * This callback is called when device attempts to get current time from the
626  * hardware. If this device has means to retrieve exact time, then this method
627  * should implement it. If the callback can't provide the exact time it should
628  * return 0 to indicate failure. Default action is to return 0, which indicates
629  * that device does not have access to real time.
630  *
631  */
632 uint32_t emberAfGetCurrentTimeCallback();
633
634 /** @brief Get Endpoint Info
635  *
636  * This function is a callback to an application implemented endpoint that
637  * operates outside the normal application framework.  When the framework wishes
638  * to perform operations with that endpoint it uses this callback to retrieve
639  * the endpoint's information.  If the endpoint exists and the application can
640  * provide data then true shall be returned.  Otherwise the callback must return
641  * false.
642  *
643  * @param endpoint The endpoint to retrieve data for.  Ver.: always
644  * @param returnNetworkIndex The index corresponding to the ZigBee network the
645  * endpoint belongs to.  If not using a multi-network device, 0 must be
646  * returned.  Otherwise on a multi-network device the stack will switch to this
647  * network before sending the message.  Ver.: always
648  * @param returnEndpointInfo A pointer to a data struct that will be written
649  * with information about the endpoint.  Ver.: always
650  */
651 bool emberAfGetEndpointInfoCallback(chip::EndpointId endpoint, uint8_t * returnNetworkIndex,
652                                     EmberAfEndpointInfoStruct * returnEndpointInfo);
653
654 /** @brief Get Source Route Overhead
655  *
656  * This function is called by the framework to determine the overhead required
657  * in the network frame for source routing to a particular destination.
658  *
659  * @param destination The node id of the destination  Ver.: always
660  */
661 uint8_t emberAfGetSourceRouteOverheadCallback(chip::NodeId destination);
662
663 /** @brief Registration Abort
664  *
665  * This callback is called when the device should abort the registration
666  * process.
667  *
668  */
669 void emberAfRegistrationAbortCallback();
670
671 /** @brief Interpan Send Message
672  *
673  * This function will send a raw MAC message with interpan frame format using
674  * the passed parameters.
675  *
676  * @param header Interpan header info  Ver.: always
677  * @param messageLength The length of the message received or to send  Ver.:
678  * always
679  * @param message The message data received or to send.  Ver.: always
680  */
681 EmberStatus emberAfInterpanSendMessageCallback(EmberAfInterpanHeader * header, uint16_t messageLength, uint8_t * message);
682
683 /** @brief Start Move
684  *
685  * This function is called to initiate the process for a device to move (rejoin)
686  * to a new parent.
687  *
688  */
689 bool emberAfStartMoveCallback();