MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / power

Function power

CLI/CLI.cpp:1626–1666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1624
1625
1626static CLIStatus power(int argc, char **argv, ostream& os)
1627{
1628 os << "current downlink power " << gBTS.powerManager().power() << " dB wrt full scale" << endl;
1629 os << "current attenuation bounds "
1630 << gConfig.getNum("GSM.Radio.PowerManager.MinAttenDB")
1631 << " to "
1632 << gConfig.getNum("GSM.Radio.PowerManager.MaxAttenDB")
1633 << " dB" << endl;
1634
1635 if (argc==1) return SUCCESS;
1636 if (argc!=3) return BAD_NUM_ARGS;
1637
1638 int min = atoi(argv[1]);
1639 int max = atoi(argv[2]);
1640 if (min>max) {
1641 os << "Min is larger than max" << endl;
1642 return BAD_VALUE;
1643 }
1644
1645 if (!gConfig.isValidValue("GSM.Radio.PowerManager.MinAttenDB", argv[1])) {
1646 os << "Invalid new value for min. It must be in range (";
1647 os << gConfig.mSchema["GSM.Radio.PowerManager.MinAttenDB"].getValidValues() << ")" << endl;
1648 return BAD_VALUE;
1649 }
1650 if (!gConfig.isValidValue("GSM.Radio.PowerManager.MaxAttenDB", argv[2])) {
1651 os << "Invalid new value for max. It must be in range (";
1652 os << gConfig.mSchema["GSM.Radio.PowerManager.MaxAttenDB"].getValidValues() << ")" << endl;
1653 return BAD_VALUE;
1654 }
1655
1656 gConfig.set("GSM.Radio.PowerManager.MinAttenDB",argv[1]);
1657 gConfig.set("GSM.Radio.PowerManager.MaxAttenDB",argv[2]);
1658
1659 os << "new attenuation bounds "
1660 << gConfig.getNum("GSM.Radio.PowerManager.MinAttenDB")
1661 << " to "
1662 << gConfig.getNum("GSM.Radio.PowerManager.MaxAttenDB")
1663 << " dB" << endl;
1664
1665 return SUCCESS;
1666}
1667
1668
1669static CLIStatus rxgain(int argc, char** argv, ostream& os)

Callers 1

powerMethod · 0.85

Calls 2

powerMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected