CC2530de RSSI值怎么获取?
利用int8 rssi;
rssi = pkt->rssi;得到的rssi,需要减去73才是真实的RSSI值吗?pkt里的rssi与RSSI寄存器的值为什么不一样,而且有20左右的差距,它俩之间有什么公式可以互算吗?有什么区别?
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.
CC2530de RSSI值怎么获取?
利用int8 rssi;
rssi = pkt->rssi;得到的rssi,需要减去73才是真实的RSSI值吗?pkt里的rssi与RSSI寄存器的值为什么不一样,而且有20左右的差距,它俩之间有什么公式可以互算吗?有什么区别?
看如下这篇文档。
http://www.ti.com/lit/an/swra114d/swra114d.pdf
3 RSSI Register Interpretation
The RSSI value read from the RSSI status register is a 2’s complement number and is in
dBm with ½ dB resolution. The following procedure can be used to convert the RSSI reading to an absolute power level (RSSI_dBm).
Assume that the RSSI offset is 72 dB and that 11111010b is read from the RSSIregister.
If 11111010b is interpret as a 2’s complement number it has the value -6.This means that the RSSI value, before taking the offset into account, is -3 dBm. Subtracting the RSSI offset, the RSSI value in dBm ends up at -3 dBm - 72 dB = -75 dBm.
To find the actual signal power P at the RF pins with reasonable accuracy, an offset must be added to the
RSSI value. P = RSSI – OFFSET [dBm]
For example, with an offset of 73 dB, reading an RSSI value of –10 from the RSSI register means that the
RF input power is approximately –83 dBm. For the correct offset value to use, see the data sheet。
datasheet中offset为
我不知道你的PKT->RSSI是哪里的。在z-stack里你可以看到如下,我估计D3应该是已经通过计算后的了,表示RF input power 大概是为D3-FF= -45dbm, 一米差不多。
/* record link quality metrics for the receive ACK */
{
int8 rssiDbm;
uint8 corr;
rssiDbm = PROPRIETARY_FCS_RSSI(fcsBuf) + MAC_RADIO_RSSI_OFFSET;
MAC_RADIO_RSSI_LNA_OFFSET(rssiDbm);
corr = PROPRIETARY_FCS_CORRELATION_VALUE(fcsBuf);
pMacDataTx->internal.mpduLinkQuality = macRadioComputeLQI(rssiDbm, corr);
pMacDataTx->internal.correlation = corr;
pMacDataTx->internal.rssi= rssiDbm;
}
谢谢你。
case AF_INCOMING_MSG_CMD:
MRFI_RSSI_VALID_WAIT();
Sample_ProcessMSGCmd( MSGpkt );
static void Sample_ProcessMSGCmd( afIncomingMSGPacket_t *pkt )
{
uint8 rssi;
rssi = pkt->rssi;
HalUARTWrite( SERIAL_APP_PORT, &rssi, 1 );
}
从这里面得到的,你最后的那个程序是从哪个C文件得到的?再次表示感谢。
函数是static void rxStartIsr(void)。
第一个问号是的,第二个问号是的。第三个packetsniffer抓到的是还没进行计算的。RSSI是容易受环境影响的。
利用pkt->rssi可以获取RSSI的值,不过需要转化,但是终端节点如何获取其他终端节点的RSSI。如果还是用pkt->rssi,那么终端节点收到的RSSI是协调器的RSSI,而不是其他终端节点的RSSI,你有办法解决吗?
其他节点设置为路由,限制跳数为1,然后得到的应是路由到终端的RSSI值,你能把你得到的值给我看看嘛?
我没有用路由节点,只有协调器和终端节点,
uint8 value=pkt->rssi;
uint8 *rss;
_ltoa(value,rss,10);
通过这段代码可以把收到的RSSI转化为十进制
但是一个终端节点获取其他终端节点的RSSI值,利用这种方式,得到的是协调器的,我不知道怎么解决