Part Number:CC1312R
只有easylink例程里面有信号强度rssi数据么?
Galaxy Yue:
在rfPacketRx例程中有相关代码,
具体分为两种方式
方式一:在接收数据包时读取RSSI值 使用bAppendRsii
方式二:读取当前信道的信号强度,使用RF_getRssi()
可以参考以下帖子
https://www.ti2k.com/wp-content/uploads/ti2k/DeyiSupport_1GHz_458210
,
zjj12138:
Galaxy Yue 说:RF_getRssi()
这条命令读出来的是0x80是错误的。
Galaxy Yue 说:bAppendRsii
能否具体说明一下呢?没看明白
,
Galaxy Yue:
使用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)];
,
Galaxy Yue:
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);};}