Ti专家您好,
CC1310用在产品中, 接收设备在发射设备的无线范围内接收没有问题, 如果接收设备位置超出无线发射范围, 接收不到, 接收设备再进入无线范围, 就一直接收不到, 只有重新上电才能收到.
下面是接收代码:
if( RFQueue_defineQueue(&dataQueue, DataEntryBuffer, sizeof(DataEntryBuffer),
NUM_DATA_ENTRIES, MAX_LENGTH + NUM_APPENDED_BYTES))
{
while(1);
}
RF_cmdPropRxAdv.pQueue = &dataQueue; /* Set the Data Entity queue for received data */
RF_cmdPropRxAdv.rxConf.bAutoFlushIgnored = 1; /* Discard ignored packets from Rx queue */
RF_cmdPropRxAdv.rxConf.bAutoFlushCrcErr = 1; /* Discard packets with CRC error from Rx queue */
RF_cmdPropRxAdv.maxPktLen = MAX_LENGTH; /* Implement packet length filtering to avoid PROP_ERROR_RXBUF */
RF_cmdPropRxAdv.pktConf.bRepeatOk = 1;
RF_cmdPropRxAdv.pktConf.bRepeatNok = 1;
RF_cmdPropRxAdv.pOutput = (uint8_t*)&rxStatistics;
RF_cmdPropRxAdv.startTrigger.triggerType = TRIG_NOW;
RF_cmdPropRxAdv.startTrigger.pastTrig = 1;
RF_cmdPropRxAdv.startTime = 0;
rfHandle = RF_open(&rfObject, &RF_prop, (RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
RF_runCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRxAdv, RF_PriorityHigh, &RxDoneCb, RF_EventRxEntryDone);
while(1)
{
uint32_t events = Event_pend(RxEventHandle, 0, RADIO_EVENT_ALL, BIOS_WAIT_FOREVER);
if(events == RADIO_EVENT_RECEIVED)
{
LedTurnOn(LED_RF_RECV_OK, 5, 10, 1);
ProcessData(packetDataPointer, packetLength);
}
RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRxAdv, RF_PriorityHigh, &RxDoneCb, RF_EventRxEntryDone);
}
void RxDoneCb(RF_Handle h, RF_CmdHandle ch, RF_EventMask e)
{
if (e & RF_EventRxEntryDone)
{
currentDataEntry = RFQueue_getDataEntry();
packetLength = (*(uint8_t*)(¤tDataEntry->data)) | (*(uint8_t*)(¤tDataEntry->data + 1) << 8);
packetDataPointer = (uint8_t*)(¤tDataEntry->data + 2);
RFQueue_nextEntry();
Event_post(RxEventHandle, RADIO_EVENT_RECEIVED);
}
}
请帮助, 谢谢.
Kevin Qiu1:
你使用的是哪个例程,SDK版本是多少?
应该是超出范围后断开,再进入范围内没有建立连接
user1118902:
回复 Kevin Qiu1:
SDK版本: simplelink_cc13x0_sdk_3_20_00_23, Datarate 500kBps,
用Easylink在50kBps, 没有这个问题, Easylink在Callback函数中有很多状态判断, 但是我不知道这种情况的错误状态是哪一个事件.
Kevin Qiu1:
回复 user1118902:
你可以先测下,再次进入通信范围内,是否重新建立了连接
比如连接后点亮一个led或者串口打印一条信息
50kbps理论上通信距离更远一些
user1118902:
回复 Kevin Qiu1:
目前的测试问题: 每秒发送20帧数据(500kBps/512bytes), 接收端在信号强的范围内不丢包正常, 移动到信号比较若的距离位置, 开始丢包, 几秒就死机. 即使再返回强信号区域也不接收. 如果每秒发送一帧数据, 就不会死机. 依次用LED指示观察下面状态都没有问题: RF_EventMask, RF_cmdPropRxAdv.status, currentDataEntry->status; 如果是信号变差CRC错误, 应该丢弃错误包. 怎么会死机? 请帮助, 谢谢
Kevin Qiu1:
回复 user1118902:
你说的死机具体是什么现象,卡在某个地方了?接收用的是EasyLink_receiveAsync()还是EasyLink_receive
user1118902:
回复 Kevin Qiu1:
数据包长500多个字节, 无法用EasyLink.接收用RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRxAdv, RF_PriorityHigh, &RxDoneCb, RF_EventRxEntryDone);
收到数据OK时LED会闪一次,死机LED不闪,在强信号区重新上电正常接收.
user1118902:
回复 Kevin Qiu1:
数据包长500多个字节, 无法用EasyLink.接收用RF_postCmd(rfHandle, (RF_Op*)&RF_cmdPropRxAdv, RF_PriorityHigh, &RxDoneCb, RF_EventRxEntryDone);
收到数据OK时LED会闪一次,死机LED不闪,在强信号区重新上电正常接收.
user1118902:
回复 Kevin Qiu1:
是这个原因,已经解决, 非常感谢.
Kevin Qiu1:
回复 user1118902:
不客气