TI中文支持网
TI专业的中文技术问题咨询交流网站

关于CC2640 连续发送10包以上有失败的问题

发送代码使用 ti\simplelink_cc2640r2_sdk_3_10_00_15\examples\nortos\CC2640R2_LAUNCHXL\easylink\rfEasyLinkTx
接收代码使用 ti\simplelink_cc2640r2_sdk_3_10_00_15\examples\nortos\CC2640R2_LAUNCHXL\easylink\rfEasyLinkRx
两个代码没有改动并编译下载,每次发送前10包都很正常,但第11包时就会停到   if(!txDoneFlag){ 里面,只要进入这里代表 RF没有发送成功,
是不是RF芯片里只有10包缓存,每发完10包后要清一个,才能发送下一包,
   while(!txDoneFlag){
            /*
             * Set the device to sleep for 108ms. The packet transmission is
             * set 100 ms in the future but takes about 7ms to complete and
             * for the execution to hit the callback. A 1ms buffer is added to
             * the sleep time to ensure the callback always execute prior to
             * the end of usleep().
             */
            usleep(108000);
            /* check to see if the transmit flag was set during sleep */
            if(!txDoneFlag){
                txSleepPeriodsElapsed++;
                if(txSleepPeriodsElapsed == 3){
                    /* 324 ms have passed. We need to abort the transmission */
                    if(EasyLink_abort() == EasyLink_Status_Success)
                    {
                        /*
                         * Abort will cause the txDoneCb to be called and the
                         * txDoneFlag to be set
                         */
                        while(!txDoneFlag){};
                    }
                    break;
                }
            }
        }
还有一个问题,就是这里每次发送时要等待108MS这个时间太长了,正常不是1到3MS就可以完成了,如果每次都这么慢我们发送20K
数据那不要 S以上了,有没有什么办法加快发送速度
Viki Shi:

看例程描述:

Run the example. Board_PIN_LED1 will toggle every 100 ms indicating a packet has been transmitted. This will happen 10 times. The 11th transmission will then be aborted, toggling Board_PIN_LED2. This cycle will continue.

The rfEasyLinkTx example will transmit a packet every 10 ms for 10 packets, if RFEASYLINKTX_ASYNC is defined (as it is by default) then the 11th TX will be scheduled, but will be aborted. This is to show an example of aborting a TX. LED2 will toggle when a TX abort happens. Board_PIN_LED1 and Board_PIN_LED2 indicates an error (not expected to happen). The TX/abort cycle will repeat indefinitely.

http://dev.ti.com/tirex/explore/node?node=AByK2gknDyDqndi09pZ85A__krol.2c__LATEST

user1412065:

回复 Viki Shi:

我可以通过调用哪个函数或更改哪个参数让他能一直连续发送

Alvin Chen:

回复 user1412065:

你把RFEASYLINKTX_ASYNC注释掉就可以。

/* Undefine to not use async mode */
//#define RFEASYLINKTX_ASYNC

赞(0)
未经允许不得转载:TI中文支持网 » 关于CC2640 连续发送10包以上有失败的问题
分享到: 更多 (0)