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