mirror of
https://github.com/espressif/openthread.git
synced 2026-08-11 13:17:48 +00:00
[posix-app] get real rssi from NCP (#3051)
This commit is contained in:
@@ -918,6 +918,15 @@ otError RadioSpinel::GetTransmitPower(int8_t &aPower)
|
||||
return error;
|
||||
}
|
||||
|
||||
int8_t RadioSpinel::GetRssi(void)
|
||||
{
|
||||
int8_t rssi = OT_RADIO_RSSI_INVALID;
|
||||
otError error = Get(SPINEL_PROP_PHY_RSSI, SPINEL_DATATYPE_INT8_S, &rssi);
|
||||
|
||||
LogIfFail(mInstance, "Get RSSI failed", error);
|
||||
return rssi;
|
||||
}
|
||||
|
||||
otError RadioSpinel::SetTransmitPower(int8_t aPower)
|
||||
{
|
||||
otError error = Set(SPINEL_PROP_PHY_TX_POWER, SPINEL_DATATYPE_INT8_S, aPower);
|
||||
@@ -1532,7 +1541,7 @@ otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance)
|
||||
int8_t otPlatRadioGetRssi(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
return 0;
|
||||
return sRadioSpinel.GetRssi();
|
||||
}
|
||||
|
||||
otRadioCaps otPlatRadioGetCaps(otInstance *aInstance)
|
||||
|
||||
@@ -168,6 +168,13 @@ public:
|
||||
*/
|
||||
otRadioCaps GetRadioCaps(void) const { return mRadioCaps; }
|
||||
|
||||
/**
|
||||
* This method gets the most recent RSSI measurement.
|
||||
*
|
||||
* @returns The RSSI in dBm when it is valid. 127 when RSSI is invalid.
|
||||
*/
|
||||
int8_t GetRssi(void);
|
||||
|
||||
/**
|
||||
* This method returns the radio receive sensitivity value.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user