mirror of
https://github.com/espressif/openthread.git
synced 2026-09-02 23:30:07 +00:00
[ncp] send spinel LAST_STATUS error if getting PHY_TX_POWER fails with an error (#2392)
This commit is contained in:
committed by
Jonathan Hui
parent
58dd2af06f
commit
831c7874f9
+10
-3
@@ -1949,10 +1949,17 @@ otError NcpBase::GetPropertyHandler_PHY_TX_POWER(void)
|
||||
int8_t power;
|
||||
otError error;
|
||||
|
||||
SuccessOrExit(error = otPlatRadioGetTransmitPower(mInstance, &power));
|
||||
error = mEncoder.WriteInt8(power);
|
||||
error = otPlatRadioGetTransmitPower(mInstance, &power);
|
||||
|
||||
if (error == OT_ERROR_NONE)
|
||||
{
|
||||
error = mEncoder.WriteInt8(power);
|
||||
}
|
||||
else
|
||||
{
|
||||
error = mEncoder.OverwriteWithLastStatusError(ThreadErrorToSpinelStatus(error));
|
||||
}
|
||||
|
||||
exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user