两个问题:
1.cc2530射频只能接收无法发送,接收可以接收数据,发送无法发送(link status也没有发出)。我想重启射频有重启的API吗?
2.AF_DataRequest的options选项,有那个是发送时发起路由发现?现在的问题是经过一段时间后第一次控制设备提示无路由,发起路由发现后才可发送数据
YiKai Chen:
1. 沒有單獨重启射频的API,只有reset chip的
2. 路由不存在的話Z-Stack 會主動發出route request,無須在AF_DataRequest的options选项設定
Sleeping Forest:
回复 YiKai Chen:
2.但是我在AF_DATA_CONFIRM_CMD消息里做如下处理,重新发起了ZDP_MgmtNwkDiscReq()case AF_DATA_CONFIRM_CMD:// This message is received as a confirmation of a data packet sent.// The status is of ZStatus_t type [defined in NLMEDE.h]// The message fields are defined in AF.hafDataConfirm = (afDataConfirm_t *)MSGpkt;// sentEP = afDataConfirm->endpoint;SentStatus = afDataConfirm->hdr.status;if(SentStatus != ZSuccess ){if(countt < 10){if(SentStatus == ZNwkNoRoute)//没有路由{zAddrType_tSendDataAddr;SendDataAddr.addrMode = (afAddrMode_t)Addr16Bit;SendDataAddr.addr.shortAddr = addrs;ZDP_MgmtNwkDiscReq(&SendDataAddr,zgDefaultChannelList,10,0,0);}else if(SentStatus == ZMacNoACK){SystemResetSoft();// mac出错,只能重启解决 }else if( SentStatus == ZApsNoAck ){SystemResetSoft();}else{osal_start_timerEx( zclSampleLight_TaskID,SAMPLEAPP_SEND_WRITEDATA_EVT,50 );}memset(&TEST[0],0xAA,3);TEST[3]=SentStatus; HalUARTWrite ( 0, &TEST[0] ,4);}//SystemResetSoft();}else{memset(&TEST[0],0xBB,4);HalUARTWrite ( 0, &TEST[0] ,4);}break;
(2)的问题是经过一段时间后第一次控制,控制不到,我发起了ZDP_MgmtNwkDiscReq之后就能发送了。并且路由设置的route request为120S。我也很奇怪到底什么问题引起的
YiKai Chen:
回复 Sleeping Forest:
第一次控制,控制不到代表路由失效,所以你如果有做APS ACK的檢查就會發現沒有APS ACK,這時候Z-Stack會自動做route request,所以你只要在APS沒有ACK的時候在重送AF_DataRequest即可,並不需要特別做ZDP_MgmtNwkDiscReq
Susan Yang:
回复 Sleeping Forest:
您可以通过APSC_MAX_FRAME_RETRIES设置重发次数,在您发送失败后会自动进行重新发送
The number of times that the message is retried (if APS ACK message isn’t received) and the timeout between retries are configuration items in
f8wConfig.cfg. APSC_MAX_FRAME_RETRIES is the number of retries the APS layer will send the message if it doesn’t receive an APS ACK before giving up. APSC_ACK_WAIT_DURATION_POLLED is the time between retries.