mirror of
https://github.com/espressif/openthread.git
synced 2026-09-04 16:20:05 +00:00
Implement the use of otPlatRadioDefaultTxPower API. (#1417)
* Implement the use of otPlatRadioDefaultTxPower API. * Add implementation of otPlatRadioSetDefaultTxPower for windows.
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user