下载此文档

zigbee网络设备启动.doc


文档分类:通信/电子 | 页数:约23页 举报非法文档有奖
1/23
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/23 下载此文档
文档列表 文档介绍
Zigbee 网络设备启动—主要函数说明 2010-07-09 20:32:17| 分类: Zigbee |字号订阅使用的协议栈版本信息: ZigBee2006\ZStack-- 1、 ZDApp_Init() 及其中几个函数的说明. (1)ZDApp_Init() **************************************** void ZDApp_Init( byte task_id ) { uint8 capabilities; // Save the task ID ZDAppTaskID = task_id; // Initialize the ZDO global device short address storage = Addr16Bit; = INVALID_NODE_ADDR; //0xFFFE (void)NLME_GetExtAddr(); // Load the saveExtAddr pointer. // Check for manual"Hold Auto Start" // 检测到有手动设置 SW_1 则会设置 devState = DEV_HOLD, 从而避开网络初始化 ZDAppCheckForHoldKey(); // Initialize ZDO items and setup the device - type of device to create. ZDO_Init(); // 通过预编译来初始化一些功能函数. // Register the endpoint description with the AF // This task doesn't have a Simple description, but we still need // to register the endpoint. afRegister( (endPointDesc_t *)&ZDApp_epDesc ); #if defined( ZDO_USERDESC_RESPONSE ) ZDApp_InitUserDesc(); #endif // ZDO_USERDESC_RESPONSE // set broadcast address mask to support broadcast filtering NLME_GetRequest(nwkCapabilityInfo, 0, &capabilities); NLME_SetBroadcastFilter( capabilities ); // Start the device? if( devState != DEV_HOLD ){ ZDOInitDevice( 0 ); } /*如果 devState=DEV_HOLD, 则不会调用 ZDOInitDevice() 闪烁指示这是一个非自动启动模式,等待应用程序来开启是网络设备*/ else { // Blink LED to indicate HOLD_START HalLedBlink ( HAL_LED_4, 0, 50, 500 ); } ZDApp_RegisterCBs(); } **************************************** 这里说明三个函数: ZDAppCheckForHoldKey() ZDO_Init() ZDOInitDevice( 0) (1)ZDAppCheckForHoldKey() ************************** void ZDAppCheckForHoldKey( void ) { #if (defined HAL_KEY) && (HAL_KEY == TRUE) //个人认为:可以直接通过读取按键来看是否需要采用 HOLD_START 模式//如果发现 SW_1 按下(普通按键吧)/向上(Joystick up), 则设置 DEV_HOLD; // Get Keypad directly to see ifa HOLD_START is needed. // Hold down the SW_BYPASS_START key (see ) // while booting to avoid starting up the device. if( HalKeyRead () == SW_BYPASS_START) //HAL_KEY_SW_1 { // Change the device state to HOLD

zigbee网络设备启动 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数23
  • 收藏数0 收藏
  • 顶次数0
  • 上传人63229029
  • 文件大小100 KB
  • 时间2017-01-26
最近更新