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