Implement the use of otPlatRadioDefaultTxPower API. (#1417)

* Implement the use of otPlatRadioDefaultTxPower API.

* Add implementation of otPlatRadioSetDefaultTxPower for windows.
This commit is contained in:
pvanhorn
2017-03-03 11:09:33 -08:00
committed by Jonathan Hui
parent d4718dbeae
commit 04caca7cc8
9 changed files with 70 additions and 0 deletions
+20
View File
@@ -759,6 +759,26 @@ error:
return NT_SUCCESS(status) ? kThreadError_None : kThreadError_Failed;
}
void otPlatRadioSetDefaultTxPower(_In_ otInstance *otCtx, int8_t aPower)
{
NT_ASSERT(otCtx);
PMS_FILTER pFilter = otCtxToFilter(otCtx);
NTSTATUS status;
// Indicate to the miniport
status =
otLwfCmdSetProp(
pFilter,
SPINEL_PROP_PHY_TX_POWER,
SPINEL_DATATYPE_INT8_S,
aPower
);
if (!NT_SUCCESS(status))
{
LogError(DRIVER_DEFAULT, "Set SPINEL_PROP_PHY_TX_POWER failed, %!STATUS!", status);
}
}
inline USHORT getDstShortAddress(const UCHAR *frame)
{
return (((USHORT)frame[IEEE802154_DSTADDR_OFFSET + 1]) << 8) | frame[IEEE802154_DSTADDR_OFFSET];