完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
描述:
1、CC2530 非开发套件,使用 SampleDoorLock 作为协调器、SampleDoorLockController作用终端 2、终端(SampleDoorLockController)开启一个定时器来检测按键(100ms),例如:P1_5 ==1时,来发起Becon reques 请求并且可以入网(入网抓包如下图) 3、例如:P1_6 ==1时,来发送解锁命令,但是数据发来出来,抢包没有抢出来。debug能正常进入定时器检测,例程其他地方没有改动,请问问题出在那里呢?谢谢,代码如下: if ( events & SAMPLEDOORLOCK_wds ) [ osal_start_timerEx( zclSampleDoorLockController_TaskID, SAMPLEDOORLOCK_wds, 100 ); // zcl_EZModeAction ( EZMODE_ACTION_TIMED_OUT, NULL ); // EZ-Mode timed out if(P1_6==1) [ // increase PIN number if ( giDoorLockScreenMode == DOORLOCK_PINMODE ) [ if ( giDoorLockPINColumnCount < 4 ) [ if ( giDoorLockPINCount > 8 ) [ giDoorLockPINCount = 0; ] else [ giDoorLockPINCount++; ] ] ] // for all other modes, lock/unlock door else [ zclDoorLock_t cmd; cmd.pPinRfidCode = aiDoorLockPIN; static bool locked = TRUE; giDoorLockScreenMode = DOORLOCK_MAINMODE; if ( locked ) [ zclClosures_SendDoorLockUnlockDoor( SAMPLEDOORLOCKCONTROLLER_ENDPOINT, &zclSampleDoorLockController_DstAddr, &cmd, false, zclSampleDoorLockControllerSeqNum++ ); locked = FALSE; ] else [ zclClosures_SendDoorLockLockDoor( SAMPLEDOORLOCKCONTROLLER_ENDPOINT, &zclSampleDoorLockController_DstAddr, &cmd, false, zclSampleDoorLockControllerSeqNum++ ); locked = TRUE; ] ] ] if(P1_5==1) [ if ( ( giDoorLockScreenMode == DOORLOCK_MAINMODE ) || ( giDoorLockScreenMode == DOORLOCK_HELPMODE ) ) [ giDoorLockScreenMode = DOORLOCK_MAINMODE;#ifdef ZCL_EZMODE [ zclEZMode_InvokeData_t ezModeData; static uint16 clusterIDs[] = [ ZCL_CLUSTER_ID_CLOSURES_DOOR_LOCK ]; // only bind on the on/off cluster // Invoke EZ-Mode ezModeData.endpoint = SAMPLEDOORLOCKCONTROLLER_ENDPOINT; // endpoint on which to invoke EZ-Mode if ( ( zclSampleDoorLockController_NwkState == DEV_ZB_COORD ) || ( zclSampleDoorLockController_NwkState == DEV_ROUTER ) || ( zclSampleDoorLockController_NwkState == DEV_END_DEVICE ) ) [ ezModeData.onNetwork = TRUE; // node is already on the network ] else [ ezModeData.onNetwork = FALSE; // node is not yet on the network ] ezModeData.initiator = TRUE; // DoorLock Controller is an initiator ezModeData.numActiveInClusters = 0; ezModeData.pActiveInClusterIDs = NULL; ezModeData.numActiveOutClusters = 1; // active output cluster ezModeData.pActiveOutClusterIDs = clusterIDs; zcl_InvokeEZMode( &ezModeData );#ifdef LCD_SUPPORTED HalLcdWriteString( "EZMode", HAL_LCD_LINE_2 );#endif ]// NOT ZCL_EZMODE, Use EndDeviceBind#else [ zAddrType_t dstAddr; HalLedSet ( HAL_LED_4, HAL_LED_MODE_OFF ); // Initiate an End Device Bind Request, this bind request will // only use a cluster list that is important to binding. dstAddr.addrMode = afAddr16Bit; dstAddr.addr.shortAddr = 0; // Coordinator makes the match ZDP_EndDeviceBindReq( &dstAddr, NLME_GetShortAddr(), SAMPLEDOORLOCKCONTROLLER_ENDPOINT, ZCL_HA_PROFILE_ID, 0, NULL, // No incoming clusters to bind ZCLSAMPLEDOORLOCKCONTROLLER_BINDINGLIST, bindingOutClusters, TRUE ); ]#endif // ZCL_EZMODE ] ] return ( events ^ SAMPLEDOORLOCK_wds ); ] |
|
相关推荐
1 个讨论
|
|
只有小组成员才能发言,加入小组>>
341 浏览 1 评论
539 浏览 2 评论
NA555DR VCC最低电压需要在5V供电,为什么用3.3V供电搭了个单稳态触发器也使用正常?
781 浏览 3 评论
MSP430F249TPMR出现高温存储后失效了的情况,怎么解决?
655 浏览 1 评论
对于多级放大电路板,在PCB布局中,电源摆放的位置应该注意什么?
1138 浏览 1 评论
AT32F407在USART2 DMA发送数据时,接包接到了要发送的数据,程序还是处于等待传输完成的标识判断中,为什么?
69浏览 29评论
215浏览 23评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
256浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
205浏览 14评论
两个TMP117传感器一个可以正常读取温度值,一个读取的值一直是0,为什么?
65浏览 13评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-25 11:23 , Processed in 0.720122 second(s), Total 39, Slave 34 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号