完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
本帖最后由 1353740943 于 2013-3-10 16:37 编辑
我要在一个zigbee终端节点上带多个传感器(DHT11+红外热释电+烟雾),可总是调不出来结果,下面为sampleAPP中的发送及数据处理函数,求大神指教! 数据点对点发送函数: void SampleApp_SendPointToPointMessage( void ) { uchar data[6]; data[0]=wendu_shi+48; data[1]=wendu_ge%10+48; data[2]=shidu_shi+48; data[3]=shidu_ge%10+48; if(PEOPLE==1) { data[4]=1;//有人 HalUARTWrite(0,"Get Peoplen",11); //串口 HalLcdWriteString( "Get People", HAL_LCD_LINE_3 ); //LCD } else { data[4]=0;//无人 HalUARTWrite(0,"No Peoplen",10); //串口 } if(SMOKE==1) { data[5]=1;//没烟雾 HalUARTWrite(0,"No bad Airn",11); //串口 } else { data[5]=0;//有烟雾 HalUARTWrite(0,"Get bad Airn",12); //串口 } if ( AF_DataRequest( &Point_To_Point_DstAddr, &SampleApp_epDesc, SAMPLEAPP_POINT_TO_POINT_CLUSTERID, 6, data, &SampleApp_TransID, AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS ) { } else { // Error occurred in request to send. } } 数据处理函数: void SampleApp_MessageMSGCB( afIncomingMSGPacket_t *pkt ) { uint16 flashtime; switch ( pkt->clusterId ) { case SAMPLEAPP_POINT_TO_POINT_CLUSTERID: /***********温度打印***************/ HalUARTWrite(0,"Temp is:",8); //提示接收到数据 HalUARTWrite(0,&pkt->cmd.Data[0],2); //温 度 HalUARTWrite(0,"n",1); // 回车换行 /***************湿度打印****************/ HalUARTWrite(0,"Humidity is:",12); //提示接收到数据 HalUARTWrite(0,&pkt->cmd.Data[2],2); //湿度 HalUARTWrite(0,"n",1); if(&pkt->cmd.Data[4]) HalUARTWrite(0,"Get Peoplen",11); else HalUARTWrite(0,"No Peoplen",10); if(&pkt->cmd.Data[5]) HalUARTWrite(0,"Get bad airn",12); else HalUARTWrite(0,"No bad airn",11); break; case SAMPLEAPP_FLASH_CLUSTERID: flashTime = BUILD_UINT16(pkt->cmd.Data[1], pkt->cmd.Data[2] ); HalLedBlink( HAL_LED_4, 4, 50, (flashTime / 4) ); break; } } 下好程序后终端节点串口打印的温湿度正常,两个传感器状态随环境变化。协调节点的温湿度正常,而红外热释电及烟雾传感器的信息一直却显示为“Get People ,Get bad air”,说明两个数据发送的过程中出现了问题,弄了好久也解决不了,诚心求大神帮忙,小弟感激不尽 |
|
相关推荐
49个回答
|
|
|
|
|
|
楼主,请问源码还有吗?小弟正在学习,希望能分享一下,邮箱[email]136110595@qq.com,感激不尽。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
本帖最后由 switchANDchange 于 2015-7-7 09:23 编辑
朋友 我最近搞这块 能不能把你调好的代码发给我看看啊 这个问题困了我好长时间了呢 谢谢你了哦 1296681849[url=]@qq.com[/url] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
blog.sina.com.cn/s/blog_15645cb250102wkuu.html
blog.sina.com.cn/s/blog_15645cb250102wkuv.html blog.sina.com.cn/s/blog_15645cb250102wkuw.html blog.sina.com.cn/s/blog_15645cb250102wkux.html blog.sina.com.cn/s/blog_15645cb250102wkuy.html blog.sina.com.cn/s/blog_15645cb250102wkuz.html blog.sina.com.cn/s/blog_15645cb250102wkv0.html blog.sina.com.cn/s/blog_15645cb250102wkv1.html blog.sina.com.cn/s/blog_15676dfe90102who9.html blog.sina.com.cn/s/blog_15676dfe90102whoa.html blog.sina.com.cn/s/blog_15676dfe90102whob.html blog.sina.com.cn/s/blog_15676dfe90102whoc.html blog.sina.com.cn/s/blog_15676dfe90102whod.html blog.sina.com.cn/s/blog_15676dfe90102whoe.html blog.sina.com.cn/s/blog_15676dfe90102whog.html blog.sina.com.cn/s/blog_1565d14df0102w59x.html blog.sina.com.cn/s/blog_1565d14df0102w59y.html blog.sina.com.cn/s/blog_1565d14df0102w59z.html blog.sina.com.cn/s/blog_1565d14df0102w5a0.html blog.sina.com.cn/s/blog_1565d14df0102w5a1.html blog.sina.com.cn/s/blog_1565d14df0102w5a2.html blog.sina.com.cn/s/blog_1565d14df0102w5a3.html blog.sina.com.cn/s/blog_15645cb9d0102wdqb.html blog.sina.com.cn/s/blog_15645cb9d0102wdqc.html blog.sina.com.cn/s/blog_15645cb9d0102wdqd.html blog.sina.com.cn/s/blog_15645cb9d0102wdqe.html blog.sina.com.cn/s/blog_15645cb9d0102wdqg.html blog.sina.com.cn/s/blog_15645cb9d0102wdqh.html blog.sina.com.cn/s/blog_15645cb9d0102wdqi.html blog.sina.com.cn/s/blog_15690e4e70102wccv.html blog.sina.com.cn/s/blog_15690e4e70102wccw.html blog.sina.com.cn/s/blog_15690e4e70102wccx.html blog.sina.com.cn/s/blog_15690e4e70102wccy.html blog.sina.com.cn/s/blog_15690e4e70102wccz.html blog.sina.com.cn/s/blog_15690e4e70102wcd0.html blog.sina.com.cn/s/blog_15676e0bd0102w1kd.html blog.sina.com.cn/s/blog_15676e0bd0102w1kf.html blog.sina.com.cn/s/blog_15676e0bd0102w1kg.html blog.sina.com.cn/s/blog_15676e0bd0102w1kh.html blog.sina.com.cn/s/blog_15676e0bd0102w1ki.html blog.sina.com.cn/s/blog_15676e0bd0102w1kj.html blog.sina.com.cn/s/blog_15676e0bd0102w1kk.html blog.sina.com.cn/s/blog_15645cc610102w271.html blog.sina.com.cn/s/blog_15645cc610102w272.html blog.sina.com.cn/s/blog_15645cc610102w273.html blog.sina.com.cn/s/blog_15645cc610102w274.html blog.sina.com.cn/s/blog_15645cc610102w275.html blog.sina.com.cn/s/blog_15645cc610102w277.html blog.sina.com.cn/s/blog_15676e1090102w2t1.html blog.sina.com.cn/s/blog_15676e1090102w2t2.html blog.sina.com.cn/s/blog_15676e1090102w2t3.html blog.sina.com.cn/s/blog_15676e1090102w2t4.html blog.sina.com.cn/s/blog_15676e1090102w2t5.html blog.sina.com.cn/s/blog_15676e1090102w2t6.html blog.sina.com.cn/s/blog_15674edc50102wqy8.html blog.sina.com.cn/s/blog_15674edc50102wqy9.html blog.sina.com.cn/s/blog_15674edc50102wqyb.html blog.sina.com.cn/s/blog_15674edc50102wqyf.html blog.sina.com.cn/s/blog_15674edc50102wqyi.html blog.sina.com.cn/s/blog_15674edc50102wqyj.html blog.sina.com.cn/s/blog_15674edc50102wqyk.html blog.sina.com.cn/s/blog_1568ef3630102w6rx.html blog.sina.com.cn/s/blog_1568ef3630102w6ry.html blog.sina.com.cn/s/blog_1568ef3630102w6rz.html blog.sina.com.cn/s/blog_1568ef3630102w6s0.html blog.sina.com.cn/s/blog_1568ef3630102w6s1.html blog.sina.com.cn/s/blog_1568ef3630102w6s2.html blog.sina.com.cn/s/blog_1568ef3630102w6s4.html blog.sina.com.cn/s/blog_1568ef3630102w6s6.html blog.sina.com.cn/s/blog_1565ca3570102w2ow.html blog.sina.com.cn/s/blog_1565ca3570102w2ox.html blog.sina.com.cn/s/blog_1565ca3570102w2oy.html blog.sina.com.cn/s/blog_1565ca3570102w2oz.html blog.sina.com.cn/s/blog_1565ca3570102w2p1.html blog.sina.com.cn/s/blog_1565ca3570102w2p2.html blog.sina.com.cn/s/blog_15676dfac0102vwve.html blog.sina.com.cn/s/blog_15676dfac0102vwvf.html blog.sina.com.cn/s/blog_15676dfac0102vwvi.html blog.sina.com.cn/s/blog_15676dfac0102vwvk.html blog.sina.com.cn/s/blog_15676dfac0102vwvl.html blog.sina.com.cn/s/blog_15676dfac0102vwvm.html blog.sina.com.cn/s/blog_15643ba980102w14k.html blog.sina.com.cn/s/blog_15643ba980102w14l.html blog.sina.com.cn/s/blog_15643ba980102w14m.html blog.sina.com.cn/s/blog_15643ba980102w14n.html blog.sina.com.cn/s/blog_15643ba980102w14o.html blog.sina.com.cn/s/blog_15643ba980102w14p.html blog.sina.com.cn/s/blog_15643ba980102w14r.html blog.sina.com.cn/s/blog_15674d77c0102wjnu.html blog.sina.com.cn/s/blog_15674d77c0102wjnv.html blog.sina.com.cn/s/blog_15674d77c0102wjnw.html blog.sina.com.cn/s/blog_15674d77c0102wjnx.html blog.sina.com.cn/s/blog_15674d77c0102wjny.html blog.sina.com.cn/s/blog_15674d77c0102wjnz.html blog.sina.com.cn/s/blog_15674d77c0102wjo0.html blog.sina.com.cn/s/blog_1568edd750102wg3n.html blog.sina.com.cn/s/blog_1568edd750102wg3o.html blog.sina.com.cn/s/blog_1568edd750102wg3q.html blog.sina.com.cn/s/blog_1568edd750102wg3r.html blog.sina.com.cn/s/blog_1568edd750102wg3s.html blog.sina.com.cn/s/blog_1568edd750102wg3t.html blog.sina.com.cn/s/blog_15674edc40102w6rn.html blog.sina.com.cn/s/blog_15674edc40102w6ro.html blog.sina.com.cn/s/blog_15674edc40102w6rp.html blog.sina.com.cn/s/blog_15674edc40102w6rq.html blog.sina.com.cn/s/blog_15674edc40102w6rr.html blog.sina.com.cn/s/blog_15674edc40102w6rs.html |
|
|
|
|
|
|
|
|
|
|
|
楼主,我最近在学ZigBee,可否发一下这个多传感器的ZigBee程序,不胜感激
|
|
|
|
|
|
|
|
楼主可以发个源程序吗,1451377303@qq.com谢谢
|
|
|
|
楼主还有保留程序么?小弟现在才学这个
|
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
物联网工程师必备:怎么选择不同的无线连接技术,本指南帮你忙!
3042 浏览 1 评论
【DFRobot TinkerNode NB-IoT 物联网开发板试用连载】WIFI功能测试
3685 浏览 0 评论
【DFRobot TinkerNode NB-IoT 物联网开发板试用连载】Arduino的替代SublimeText3+STino
3197 浏览 0 评论
使用端口扩展器轻松高效地向IIoT端点添加具有成本效益的子节点
3730 浏览 1 评论
20217 浏览 11 评论
模组有时候复位重启后输出日志为“REBOOT_CAUSE_SECURITY_PMU_POWER_ON_RESET”的原因?
301浏览 2评论
295浏览 2评论
2761浏览 1评论
374浏览 1评论
414浏览 1评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-8-5 06:16 , Processed in 0.982271 second(s), Total 85, Slave 78 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191