#author("2022-11-15T10:10:35+08:00","default:Admin","Admin") #author("2022-11-22T15:16:35+08:00","default:Admin","Admin") [[+Zigbee30+EmberZnet]] &color(red){※This article is based on EmberZnet SDK 6.7.5.0 and EFR32MG Series}; #contents * Non-cluster related [#t413c9eb] ** 初始化时的 [#u9487868] *** emberAfMainTickCallback [#fafdcbef] #codeprettify{{ /** @brief Main Tick * * Whenever main application tick is called, this callback will be called at the end of the main tick execution. * */ void emberAfMainTickCallback(void); }} *** emberAfMainInitCallback [#u3812e82] #codeprettify{{ /** @brief Main Init * * This function is called from the application's main function. It gives the application a chance to do any initialization required at system startup. * Any code that you would normally put into the top of the application's main() routine should be put into this function. * * This is called before the clusters, plugins, and the network are initialized so some functionality is not yet available. * * Note: * No callback in the Application Framework is associated with resource cleanup. If you are implementing your application on a Unix host where resource cleanup is a consideration, * we expect that you will use the standard Posix system calls, including the use of atexit() and handlers for signals such as SIGTERM, SIGINT, SIGCHLD, SIGPIPE and so on. * If you use the signal() function to register your signal handler, please mind the returned value which may be an Application Framework function. If the return value is non-null, * please make sure that you call the returned function from your handler to avoid negating the resource cleanup of the Application Framework itself. */ void emberAfMainInitCallback(void); }} &ref(ZigBee.png); ** emberAfPreCommandReceivedCallback [#y1c9cf3a] emberAfPreCommandReceivedCallback(EmberAfClusterCommand* cmd, boolean isInterpan) 为了便于使用,回调接口在AppBuilder GUI中划分为多个部分。第一部分,与Cluster无关的回调,由位于tool/appbuilder/callback .xml文档中描述的回调组成。这些回调已经被手动插入到Zigbee应用程序框架代码中,这些代码位于客户希望接收关于Zigbee应用程序框架功能的信息的位置。 所有全局命令都属于这个类别。Zigbee应用程序框架包含全局命令的处理代码。如果任何全局命令回调返回TRUE,这表明该命令已由应用程序处理,不应该进行进一步的命令处理。如果回调返回FALSE,则Zigbee应用程序框架将继续正常处理该命令。 示例: 预命令接收回调 emberAfPreCommandReceivedCallback 在接收到ZCL命令但尚未被Zigbee应用程序框架的命令处理代码处理之后调用。该命令被解析为一个有用的struct EmberAfClusterCommand,它提供了一种简单的方法来访问关于该命令的相关数据,包括它的EmberApsFrame、消息类型、源、缓冲区、长度以及该命令的任何相关标志。此回调还返回一个布尔值,指示是否已处理该命令。如果回调返回TRUE,则假定应用程序已经处理了该命令,并且没有采取进一步的操作。 #hr(); Comment: #comment_kcaptcha