add API to setup TxPowerLevels

This commit is contained in:
Rohit Grover 2014-12-01 13:33:43 +00:00
parent 13ed67ec1e
commit 78696699c8

View file

@ -141,16 +141,17 @@ public:
}
/**
* Update the txPower for a particular mode in the powerLevels table.
* Update the txPowerLevels table.
*/
void setTxPowerLevel(TXPowerModes_t mode, int8_t txPowerIn) {
powerLevels[mode] = txPowerIn;
void setTxPowerLevels(const int8_t powerLevelsIn[NUM_POWER_MODES]) {
memcpy(powerLevels, powerLevelsIn, sizeof(powerLevels));
updateTxPowerLevelsCharacteristic();
}
/**
* Set the effective power mode from one of the values in the powerLevels tables.
*/
void useTxPowerMode(TXPowerModes_t mode) {
void setTxPowerMode(TXPowerModes_t mode) {
txPowerMode = mode;
configureGAP();
updateTxPowerModeCharacteristic();