[radio] remove transmit power config from core (#2352)

Thread (and OpenThread) does not employ any form of transmit power control.
As a result, while OpenThread provides APIs to control transmit power, it
simply buffers and passes the transmit power value straight through to the
radio.

Currently, the transmit power APIs allow specifying an int8_t in units of
dBm.  This is overly constraining for platforms that have more advanced ways
of configuring the transmit power.

This commit removes the transmit power configuration from the core.  This
provides better flexibility in platform-specific ways to configure transmit
power.
This commit is contained in:
Jonathan Hui
2017-11-28 17:33:32 +00:00
committed by GitHub
parent 8bd588301e
commit 741941e271
38 changed files with 302 additions and 196 deletions
+7 -3
View File
@@ -148,13 +148,17 @@ public:
#pragma region Link Layer
property signed int /*int8_t*/ MaxTransmitPower
property signed int /*int8_t*/ TransmitPower
{
signed int get() { return otLinkGetMaxTransmitPower(DeviceInstance); }
signed int get() {
int8_t value;
ThrowOnFailure(otPlatRadioGetTransmitPower(DeviceInstance, &value));
return value;
}
void set(signed int value)
{
if (value > 127) throw Exception::CreateException(E_INVALIDARG);
otLinkSetMaxTransmitPower(DeviceInstance, (int8_t)value);
ThrowOnFailure(otPlatRadioSetTransmitPower(DeviceInstance, (int8_t)value);
}
}