zigbee学习 示例程序SampleApp中通讯流程

               

zigbee学习:示例程序SampleApp中通讯流程


本文博客链接:http://blog.csdn.net/jdh99,作者:jdh,转载请注明.


参考链接:

http://wjf88223.blog.163.com/blog/static/3516800120104711268760/

http://www.cnblogs.com/yqh2007/archive/2011/04/27/2030062.html

 

环境:

主机:WIN7

开发环境:IAR8.10.3

MCU:CC2530

示例程序:SampleApp


说明:

在此示例程序中,有两种通讯方式:

1.每个设备每隔5s,会发送广播信息

2.按下向上键,设备会向组1发送信息

如果按下向右键,可以加入或退出组1


代码分析:

1.在main()->osal_init_system()->osalInitTasks()中增加示例程序任务SampleApp_Init( taskID )

此函数代码:

void SampleApp_Init( uint8 task_id ){  SampleApp_TaskID = task_id;  SampleApp_NwkState = DEV_INIT;  SampleApp_TransID = 0// Device hardware initialization can be added here or in main() (Zmain.c).  // If the hardware is application specific - add it here.  // If the hardware is other parts of the device add it in main(). #if defined ( BUILD_ALL_DEVICES )  // The "Demo" target is setup to have BUILD_ALL_DEVICES and HOLD_AUTO_START  // We are looking at a jumper (defined in SampleAppHw.c) to be jumpered  // together - if they are - we will start up a coordinator. Otherwise,  // the device will start as a router.  if ( readCoordinatorJumper() )    zgDeviceLogicalType = ZG_DEVICETYPE_COORDINATOR;  else    zgDeviceLogicalType = ZG_DEVICETYPE_ROUTER;#
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值