[posix] add radio platform API to get/set tx power (#3152)

This commit is contained in:
Abtin Keshavarzian
2018-10-17 13:22:16 +02:00
committed by Jonathan Hui
parent a56666a6d0
commit 5b546fe22d
+7 -4
View File
@@ -124,6 +124,7 @@ static uint16_t sPortOffset = 0;
static int sSockFd;
static bool sPromiscuous = false;
static bool sAckWait = false;
static int8_t sTxPower = 0;
static uint8_t sShortAddressMatchTableCount = 0;
static uint8_t sExtAddressMatchTableCount = 0;
@@ -932,15 +933,17 @@ otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint1
otError otPlatRadioGetTransmitPower(otInstance *aInstance, int8_t *aPower)
{
(void)aInstance;
(void)aPower;
return OT_ERROR_NOT_IMPLEMENTED;
*aPower = sTxPower;
return OT_ERROR_NONE;
}
otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower)
{
(void)aInstance;
(void)aPower;
return OT_ERROR_NOT_IMPLEMENTED;
sTxPower = aPower;
return OT_ERROR_NONE;
}
int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)