mirror of
https://github.com/espressif/openthread.git
synced 2026-09-06 01:00:09 +00:00
Parent last rssi (#1558)
* Added thread api call to get the last rssi for the parent
This commit is contained in:
@@ -834,11 +834,23 @@ OTAPI ThreadError OTCALL otThreadGetParentInfo(otInstance *aInstance, otRouterIn
|
||||
* The function retrieves the average RSSI for the Thread Parent.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[out] aParentInfo A pointer to where the parent rssi should be placed.
|
||||
* @param[out] aParentRssi A pointer to where the parent rssi should be placed.
|
||||
*
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadGetParentAverageRssi(otInstance *aInstance, int8_t *aParentRssi);
|
||||
|
||||
/**
|
||||
* The function retrieves the RSSI of the last packet from the Thread Parent.
|
||||
*
|
||||
* @param[in] aInstance A pointer to an OpenThread instance.
|
||||
* @param[out] aLastRssi A pointer to where the last rssi should be placed.
|
||||
*
|
||||
* @retval kThreadError_None Successfully retrieved the RSSI data.
|
||||
* @retval kThreadError_Failed Unable to get RSSI data.
|
||||
* @retval kThreadError_InvalidArgs @p aLastRssi is NULL.
|
||||
*/
|
||||
OTAPI ThreadError OTCALL otThreadGetParentLastRssi(otInstance *aInstance, int8_t *aLastRssi);
|
||||
|
||||
/**
|
||||
* This function pointer is called when Network Diagnostic Get response is received.
|
||||
*
|
||||
|
||||
@@ -511,6 +511,22 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
ThreadError otThreadGetParentLastRssi(otInstance *aInstance, int8_t *aLastRssi)
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
Router *parent;
|
||||
|
||||
VerifyOrExit(aLastRssi != NULL, error = kThreadError_InvalidArgs);
|
||||
|
||||
parent = aInstance->mThreadNetif.GetMle().GetParent();
|
||||
*aLastRssi = parent->mLinkInfo.GetLastRss();
|
||||
|
||||
VerifyOrExit(*aLastRssi != LinkQualityInfo::kUnknownRss, error = kThreadError_Failed);
|
||||
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
const char *otGetVersionString(void)
|
||||
{
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user