在rfEasyLinkEcho例程中,我使用的是LRM5K的配置。
1.我使用该例程不做收发切换,一边只发送,一边只接收。这样会出现什么问题吗?
2.我使用EasyLink_transmitCcaAsync(EasyLink_TxPacket *txPacket,EasyLink_TxDoneCb cb);进行发送,为什么在信号强度良好的情况下,RX还是接收不到TX发送过来的数据。
3.使用EasyLink_transmitCcaAsync(EasyLink_TxPacket *txPacket,EasyLink_TxDoneCb cb);这几个参数应该如何配置?
//! \brief Minimum CCA back-off window in units of
//! EASYLINK_CCA_BACKOFF_TIMEUNITS, as a power of 2
#define EASYLINK_MIN_CCA_BACKOFF_WINDOW 5
//! \brief Maximum CCA back-off window in units of
//! EASYLINK_CCA_BACKOFF_TIMEUNITS, as a power of 2
#define EASYLINK_MAX_CCA_BACKOFF_WINDOW 8
//! \brief The back-off time units in microseconds
#define EASYLINK_CCA_BACKOFF_TIMEUNITS 250
//! \brief RSSI threshold for Clear Channel Assessment (CCA)
#define EASYLINK_CS_RSSI_THRESHOLD_DBM -80
//! \brief Time for which the channel RSSI must remain below the specified
//! threshold for the channel to be considered idle
#define EASYLINK_CHANNEL_IDLE_TIME_US 5000
Kevin Qiu1:
1.不做收发切换可以用这个例程:C:\ti\simplelink_cc13x0_sdk_4_10_01_01\examples\rtos\CC1350_LAUNCHXL\easylink\rfEasyLinkTx
rfEasyLinkEcho例程功能:一个运行rfEasyLinkEchoTx,另一个运行rfEasyLinkEchoRx。将Board_1设置为每秒发送一次数据包,而Board_2设置为接收数据包,然后在经过100ms的延迟后转向并发送数据包。Board_1上的Board_PIN_LED1在能够成功发送数据包以及接收到回显信号时将进行切换。当Board_2上的Board_PIN_LED2收到数据包,然后能够重新传输时,将进行切换。
关于EasyLink_transmitCcaAsync看下这里的说明:
/***************************************************************************** // //! \brief Sends a Packet with non blocking call if the channel is idle. //! //! This function is a non blocking call to send a packet. It will check for a //! clear channel prior to transmission. If the channel is busy it will backoff //! for a random period, in time units of EASYLINK_CCA_BACKOFF_TIMEUNITS, before //! reassessing. It does this a certain number //! (EASYLINK_MAX_CCA_BACKOFF_WINDOW - EASYLINK_MIN_CCA_BACKOFF_WINDOW) //! of times before quitting unsuccessfully and running to the callback. //! If the Tx is successfully scheduled then the callback will be called once //! the Tx is complete. //! //! \param txPacket The descriptor for the packet to be Tx'ed. //! \param cbThe tx done function pointer. //! //! \return ::EasyLink_Status // //***************************************************************************** extern EasyLink_Status EasyLink_transmitCcaAsync(EasyLink_TxPacket *txPacket,EasyLink_TxDoneCb cb);你在哪里使用的,是否已经发送了数据
lin shi chang:
回复 Kevin Qiu1:
我看了这里的说明,不是太明白。我在rfEasyLinkEchoTx中的while(1)里使用的。 while(1) { send_pend(); Data.Crc16 = crc16((uint8_t *)&Data, sizeof(Data_Req) – 2); memcpy(txPacket.payload, &Data, sizeof(Data_Req)); txPacket.len = sizeof(Data_Req); //18 txPacket.dstAddr[0] = Add; txPacket.absTime = 0; EasyLink_transmitCcaAsync(&txPacket, echoTxDoneCb); Semaphore_pend(echoDoneSem, BIOS_WAIT_FOREVER); }
应该是发送了,我设置2S发一次。50米前数据发送正常,信号强度不错。过了50米突然就收不到数据了。然后我又走回去,又收到了。