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