只有easylink例程里面有信号强度rssi数据么?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
在rfPacketRx例程中有相关代码,
具体分为两种方式
方式一:在接收数据包时读取RSSI值 使用bAppendRsii
方式二:读取当前信道的信号强度,使用RF_getRssi()
可以参考以下帖子
使用bAppendRssi是在每次收到的数据包后面附上接收时的RSSI数值,注意设置接收缓存时,留出足够空间存放RSSI值。
/* Packet RX Configuration */
#define DATA_ENTRY_HEADER_SIZE 8 /* Constant header size of a Generic Data Entry */
#define MAX_LENGTH 30 /* Max length byte the radio will accept */
#define NUM_DATA_ENTRIES 2 /* NOTE: Only two data entries supported at the moment */
#define NUM_APPENDED_BYTES 2 /* The Data Entries data field will contain:
* 1 Header byte (RF_cmdPropRx.rxConf.bIncludeHdr = 0x1)
* Max 30 payload bytes
* 1 status byte (RF_cmdPropRx.rxConf.bAppendStatus = 0x1) */
rxDataEntryBuffer[RF_QUEUE_DATA_ENTRY_BUFFER_SIZE(NUM_DATA_ENTRIES,
MAX_LENGTH,
NUM_APPENDED_BYTES)];
RF_getRssi()使用时需要射频处于接收状态
void *mainThread(void *arg0)
{
RF_Params rfParams;
RF_Params_init(&rfParams);
/* Request access to the radio */
rfHandle = RF_open(&rfObject, &RF_prop,
(RF_RadioSetup*)&RF_cmdPropRadioDivSetup, &rfParams);
/* Set the frequency */
RF_postCmd(rfHandle, (RF_Op*)&RF_cmdFs, RF_PriorityNormal, NULL, 0);
/*设置为连续接收模式*/
RF_postCmd(rfHandle, (RF_Op*)&RF_cmdRxTest, RF_PriorityNormal, NULL, 0);
while(1)
{
temp=RF_getRssi(rfHandle);
};
}