本文整理汇总了C++中TransceiverManager类的典型用法代码示例。如果您正苦于以下问题:C++ TransceiverManager类的具体用法?C++ TransceiverManager怎么用?C++ TransceiverManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TransceiverManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void GSMConfig::createCombination0(TransceiverManager& TRX, unsigned TN)
{
// This channel is a dummy burst generator.
// This should not be applied to C0T0.
LOG_ASSERT(TN!=0);
LOG(NOTICE) << "Configuring dummy filling on C0T " << TN;
ARFCNManager *radio = TRX.ARFCN(0);
radio->setSlot(TN,0); // (pat) 0 => Transciever.h enum ChannelCombination = FILL
}
示例2:
void GSMConfig::createCombination0(TransceiverManager& TRX, unsigned CN, unsigned TN)
{
// This channel is a dummy burst generator.
// This should not be applied to non-C0.
LOG_ASSERT(CN==0);
// This should not be applied to C0T0.
LOG_ASSERT(TN!=0);
LOG(NOTICE) << "Configuring dummy filling on C" << CN << "T " << TN;
ARFCNManager *radio = TRX.ARFCN(CN);
radio->setSlot(TN,0);
}
示例3: createCombinationI
void GSMConfig::createCombinationI(TransceiverManager& TRX, unsigned CN, unsigned TN)
{
LOG_ASSERT((CN!=0)||(TN!=0));
LOG(NOTICE) << "Configuring combination I on C" << CN << "T" << TN;
ARFCNManager *radio = TRX.ARFCN(CN);
radio->setSlot(TN,1); // (pat) 1 => Transciever.h enum ChannelCombination = I
TCHFACCHLogicalChannel* chan = new TCHFACCHLogicalChannel(CN,TN,gTCHF_T[TN]);
chan->downstream(radio);
Thread* thread = new Thread;
thread->start((void*(*)(void*))Control::DCCHDispatcher,chan);
chan->open();
gBTS.addTCH(chan);
}
示例4: createCombinationI
void GSMConfig::createCombinationI(TransceiverManager& TRX, unsigned CN, unsigned TN)
{
LOG_ASSERT((CN!=0)||(TN!=0));
LOG(NOTICE) << "Configuring combination I on C" << CN << "T" << TN;
ARFCNManager *radio = TRX.ARFCN(CN);
radio->setSlot(TN,1); // (pat) 1 => Transciever.h enum ChannelCombination = I
TCHFACCHLogicalChannel* chan = new TCHFACCHLogicalChannel(CN,TN,gTCHF_T[TN]);
chan->downstream(radio);
Thread* thread = new Thread;
thread->start((void*(*)(void*))Control::DCCHDispatcher,dynamic_cast<L3LogicalChannel*>(chan));
chan->lcinit();
if (CN == 0 && !testStart) chan->lcstart(); // Everything on C0 must broadcast continually.
gBTS.addTCH(chan);
}
示例5: createCombinationVII
void GSMConfig::createCombinationVII(TransceiverManager& TRX, unsigned CN, unsigned TN)
{
LOG_ASSERT((CN!=0)||(TN!=0));
LOG(NOTICE) << "Configuring combination VII on C" << CN << "T" << TN;
ARFCNManager *radio = TRX.ARFCN(CN);
radio->setSlot(TN,7);
for (int i=0; i<8; i++) {
SDCCHLogicalChannel* chan = new SDCCHLogicalChannel(TN,gSDCCH8[i]);
chan->downstream(radio);
Thread* thread = new Thread;
thread->start((void*(*)(void*))Control::DCCHDispatcher,chan);
chan->open();
gBTS.addSDCCH(chan);
}
}
示例6: noise
int noise(int argc, char** argv, ostream& os)
{
if (argc!=1) return BAD_NUM_ARGS;
int noise = gTRX.ARFCN(0)->getNoiseLevel();
os << "noise RSSI is -" << noise << " dB wrt full scale" << endl;
os << "MS RSSI target is " << gConfig.getNum("GSM.Radio.RSSITarget") << " dB wrt full scale" << endl;
return SUCCESS;
}
示例7: trxfactory
int trxfactory(int argc, char** argv, ostream& os)
{
if (argc!=1) return BAD_NUM_ARGS;
signed val = gTRX.ARFCN(0)->getFactoryCalibration("sdrsn");
if (val == 0 || val == 65535) {
os << "Reading factory calibration not supported on this radio." << endl;
return SUCCESS;
}
os << "Factory Information" << endl;
os << " SDR Serial Number = " << val << endl;
val = gTRX.ARFCN(0)->getFactoryCalibration("rfsn");
os << " RF Serial Number = " << val << endl;
val = gTRX.ARFCN(0)->getFactoryCalibration("band");
os << " GSM.Radio.Band = ";
if (val == 0) {
os << "multi-band";
} else {
os << val;
}
os << endl;
val = gTRX.ARFCN(0)->getFactoryCalibration("rxgain");
os << " GSM.Radio.RxGain = " << val << endl;
val = gTRX.ARFCN(0)->getFactoryCalibration("txgain");
os << " TRX.TxAttenOffset = " << val << endl;
val = gTRX.ARFCN(0)->getFactoryCalibration("freq");
os << " TRX.RadioFrequencyOffset = " << val << endl;
return SUCCESS;
}
示例8: rxgain
int rxgain(int argc, char** argv, ostream& os)
{
os << "current RX gain is " << gConfig.getNum("GSM.RxGain") << " dB" << endl;
if (argc==1) return SUCCESS;
if (argc!=2) return BAD_NUM_ARGS;
int newGain = gTRX.ARFCN(0)->setRxGain(atoi(argv[1]));
os << "new RX gain is " << newGain << " dB" << endl;
gConfig.set("GSM.RxGain",newGain);
return SUCCESS;
}
示例9: radio
int radio(int argc, char** argv, ostream& os)
{
if (argc==1) return BAD_NUM_ARGS;
std::string cmd;
for (argc--, argv++; argc > 0; argc--, argv++) {
cmd += *argv;
if (argc > 1)
cmd += " ";
}
os << (gTRX.ARFCN(0)->runCustom(cmd.c_str()) ? "OK" : "Command rejected") << endl;
return SUCCESS;
}
示例10: freqcorr
int freqcorr(int argc, char** argv, ostream& os)
{
os << "current freq. offset is " << gConfig.getNum("TRX.RadioFrequencyOffset") << endl;
if (argc==1) return SUCCESS;
if (argc!=2) return BAD_NUM_ARGS;
if (!gConfig.isValidValue("TRX.RadioFrequencyOffset", argv[1])) {
os << "Invalid new value for freq. offset It must be in range (";
os << gConfig.mSchema["TRX.RadioFrequencyOffset"].getValidValues() << ")" << endl;
return BAD_VALUE;
}
int newOffset = gTRX.ARFCN(0)->setFreqOffset(atoi(argv[1]));
os << "new freq. offset is " << newOffset << endl;
gConfig.set("TRX.RadioFrequencyOffset",newOffset);
return SUCCESS;
}
示例11: rxgain
int rxgain(int argc, char** argv, ostream& os)
{
os << "current RX gain is " << gConfig.getNum("GSM.Radio.RxGain") << " dB" << endl;
if (argc==1) return SUCCESS;
if (argc!=2) return BAD_NUM_ARGS;
if (!gConfig.isValidValue("GSM.Radio.RxGain", argv[1])) {
os << "Invalid new value for RX gain. It must be in range (";
os << gConfig.mSchema["GSM.Radio.RxGain"].getValidValues() << ")" << endl;
return BAD_VALUE;
}
int newGain = gTRX.ARFCN(0)->setRxGain(atoi(argv[1]));
os << "new RX gain is " << newGain << " dB" << endl;
gConfig.set("GSM.Radio.RxGain",newGain);
return SUCCESS;
}
示例12: txatten
int txatten(int argc, char** argv, ostream& os)
{
os << "current TX attenuation is " << gConfig.getNum("TRX.TxAttenOffset") << " dB" << endl;
if (argc==1) return SUCCESS;
if (argc!=2) return BAD_NUM_ARGS;
if (!gConfig.isValidValue("TRX.TxAttenOffset", argv[1])) {
os << "Invalid new value for TX attenuation. It must be in range (";
os << gConfig.mSchema["TRX.TxAttenOffset"].getValidValues() << ")" << endl;
return BAD_VALUE;
}
int newAtten = gTRX.ARFCN(0)->setTxAtten(atoi(argv[1]));
os << "new TX attenuation is " << newAtten << " dB" << endl;
gConfig.set("TRX.TxAttenOffset",newAtten);
return SUCCESS;
}
示例13: main
int main(int argc, char *argv[])
{
// TODO: Properly parse and handle any arguments
if (argc > 1) {
for (int argi = 0; argi < argc; argi++) {
if (!strcmp(argv[argi], "--version") ||
!strcmp(argv[argi], "-v")) {
cout << gVersionString << endl;
}
}
return 0;
}
createStats();
gReports.incr("OpenBTS.Starts");
int sock = socket(AF_UNIX,SOCK_DGRAM,0);
if (sock<0) {
perror("creating CLI datagram socket");
LOG(ALERT) << "cannot create socket for CLI";
gReports.incr("OpenBTS.Exit.CLI.Socket");
exit(1);
}
try {
srandom(time(NULL));
gConfig.setUpdateHook(purgeConfig);
gLogInit("openbts",gConfig.getStr("Log.Level").c_str());
LOG(ALERT) << "OpenBTS starting, ver " << VERSION << " build date " << __DATE__;
COUT("\n\n" << gOpenBTSWelcome << "\n");
gTMSITable.open(gConfig.getStr("Control.Reporting.TMSITable").c_str());
gTransactionTable.init(gConfig.getStr("Control.Reporting.TransactionTable").c_str());
gPhysStatus.open(gConfig.getStr("Control.Reporting.PhysStatusTable").c_str());
gBTS.init();
gSubscriberRegistry.init();
gParser.addCommands();
COUT("\nStarting the system...");
// is the radio running?
// Start the transceiver interface.
LOG(INFO) << "checking transceiver";
//gTRX.ARFCN(0)->powerOn();
//sleep(gConfig.getNum("TRX.Timeout.Start",2));
bool haveTRX = gTRX.ARFCN(0)->powerOn(false);
Thread transceiverThread;
if (!haveTRX) {
transceiverThread.start((void*(*)(void*)) startTransceiver, NULL);
// sleep to let the FPGA code load
// TODO: we should be "pinging" the radio instead of sleeping
sleep(5);
} else {
LOG(NOTICE) << "transceiver already running";
}
// Start the SIP interface.
gSIPInterface.start();
//
// Configure the radio.
//
gTRX.start();
// Set up the interface to the radio.
// Get a handle to the C0 transceiver interface.
ARFCNManager* C0radio = gTRX.ARFCN(0);
// Tuning.
// Make sure its off for tuning.
//C0radio->powerOff();
// Get the ARFCN list.
unsigned C0 = gConfig.getNum("GSM.Radio.C0");
unsigned numARFCNs = gConfig.getNum("GSM.Radio.ARFCNs");
for (unsigned i=0; i<numARFCNs; i++) {
// Tune the radios.
unsigned ARFCN = C0 + i*2;
LOG(INFO) << "tuning TRX " << i << " to ARFCN " << ARFCN;
ARFCNManager* radio = gTRX.ARFCN(i);
radio->tune(ARFCN);
}
// Send either TSC or full BSIC depending on radio need
if (gConfig.getBool("GSM.Radio.NeedBSIC")) {
// Send BSIC to
C0radio->setBSIC(gBTS.BSIC());
} else {
// Set TSC same as BCC everywhere.
C0radio->setTSC(gBTS.BCC());
}
// Set maximum expected delay spread.
C0radio->setMaxDelay(gConfig.getNum("GSM.Radio.MaxExpectedDelaySpread"));
//.........这里部分代码省略.........
示例14: audit
/** Audit the current configuration. */
int audit(int argc, char** argv, ostream& os)
{
ConfigurationKeyMap::iterator mp;
stringstream ss;
// value errors
mp = gConfig.mSchema.begin();
while (mp != gConfig.mSchema.end()) {
if (!gConfig.isValidValue(mp->first, gConfig.getStr(mp->first))) {
ss << mp->first << " \"" << gConfig.getStr(mp->first) << "\" (\"" << mp->second.getDefaultValue() << "\")" << endl;
}
mp++;
}
if (ss.str().length()) {
os << "+---------------------------------------------------------------------+" << endl;
os << "| ERROR : Invalid Values [key current-value (default)] |" << endl;
os << "| To use the default value again, execute: rmconfig key |" << endl;
os << "+---------------------------------------------------------------------+" << endl;
os << ss.str();
os << endl;
ss.str("");
}
// factory calibration warnings
signed sdrsn = gTRX.ARFCN(0)->getFactoryCalibration("sdrsn");
if (sdrsn != 0 && sdrsn != 65535) {
string factoryValue;
string configValue;
factoryValue = gConfig.mSchema["GSM.Radio.Band"].getDefaultValue();
configValue = gConfig.getStr("GSM.Radio.Band");
// only warn on band changes if the unit is not multi-band
if (gTRX.ARFCN(0)->getFactoryCalibration("band") != 0 && configValue.compare(factoryValue) != 0) {
ss << "GSM.Radio.Band \"" << configValue << "\" (\"" << factoryValue << "\")" << endl;
}
factoryValue = gConfig.mSchema["GSM.Radio.RxGain"].getDefaultValue();
configValue = gConfig.getStr("GSM.Radio.RxGain");
if (configValue.compare(factoryValue) != 0) {
ss << "GSM.Radio.RxGain \"" << configValue << "\" (\"" << factoryValue << "\")" << endl;
}
factoryValue = gConfig.mSchema["TRX.TxAttenOffset"].getDefaultValue();
configValue = gConfig.getStr("TRX.TxAttenOffset");
if (configValue.compare(factoryValue) != 0) {
ss << "TRX.TxAttenOffset \"" << configValue << "\" (\"" << factoryValue << "\")" << endl;
}
factoryValue = gConfig.mSchema["TRX.RadioFrequencyOffset"].getDefaultValue();
configValue = gConfig.getStr("TRX.RadioFrequencyOffset");
if (configValue.compare(factoryValue) != 0) {
ss << "TRX.RadioFrequencyOffset \"" << configValue << "\" (\"" << factoryValue << "\")" << endl;
}
if (ss.str().length()) {
os << "+---------------------------------------------------------------------+" << endl;
os << "| WARNING : Factory Radio Calibration [key current-value (factory)] |" << endl;
os << "| To use the factory value again, execute: rmconfig key |" << endl;
os << "+---------------------------------------------------------------------+" << endl;
os << ss.str();
os << endl;
ss.str("");
}
}
// cross check warnings
vector<string> allWarnings;
vector<string> warnings;
vector<string>::iterator warning;
mp = gConfig.mSchema.begin();
while (mp != gConfig.mSchema.end()) {
warnings = gConfig.crossCheck(mp->first);
allWarnings.insert(allWarnings.end(), warnings.begin(), warnings.end());
mp++;
}
sort(allWarnings.begin(), allWarnings.end());
allWarnings.erase(unique(allWarnings.begin(), allWarnings.end() ), allWarnings.end());
warning = allWarnings.begin();
while (warning != allWarnings.end()) {
ss << *warning << endl;
warning++;
}
if (ss.str().length()) {
os << "+---------------------------------------------------------------------+" << endl;
os << "| WARNING : Cross-Check Values |" << endl;
os << "| To quiet these warnings, follow the advice given. |" << endl;
os << "+---------------------------------------------------------------------+" << endl;
os << ss.str();
os << endl;
ss.str("");
}
// site-specific values
mp = gConfig.mSchema.begin();
while (mp != gConfig.mSchema.end()) {
if (mp->second.getVisibility() == ConfigurationKey::CUSTOMERSITE) {
if (gConfig.getStr(mp->first).compare(gConfig.mSchema[mp->first].getDefaultValue()) == 0) {
ss << mp->first << " \"" << gConfig.mSchema[mp->first].getDefaultValue() << "\"" << endl;
}
//.........这里部分代码省略.........
示例15: main
int main(int argc, char *argv[])
{
//mtrace(); // (pat) Enable memory leak detection. Unfortunately, huge amounts of code have been started in the constructors above.
gLogGroup.setAll();
// TODO: Properly parse and handle any arguments
if (argc > 1) {
bool testflag = false;
for (int argi = 1; argi < argc; argi++) { // Skip argv[0] which is the program name.
if (!strcmp(argv[argi], "--version") || !strcmp(argv[argi], "-v")) {
// Print the version number and exit immediately.
cout << gVersionString << endl;
return 0;
}
if (!strcmp(argv[argi], "--test")) {
testflag = true;
continue;
}
if (!strcmp(argv[argi], "--gensql")) {
cout << gConfig.getDefaultSQL(string(argv[0]), gVersionString) << endl;
return 0;
}
if (!strcmp(argv[argi], "--gentex")) {
cout << gConfig.getTeX(string(argv[0]), gVersionString) << endl;
return 0;
}
// (pat) Adding support for specified sql file.
// Unfortunately, the Config table was inited quite some time ago,
// so stick this arg in the environment, whence the ConfigurationTable can find it, and then reboot.
if (!strcmp(argv[argi],"--config")) {
if (++argi == argc) {
LOG(ALERT) <<"Missing argument to --config option";
exit(2);
}
setenv(cOpenBTSConfigEnv,argv[argi],1);
execl(argv[0],"OpenBTS",NULL);
LOG(ALERT) <<"execl failed? Exiting...";
exit(0);
}
if (!strcmp(argv[argi],"--help")) {
printf("OpenBTS [--version --gensql --gentex] [--config file.db]\n");
printf("OpenBTS exiting...\n");
exit(0);
}
printf("OpenBTS: unrecognized argument: %s\nexiting...\n",argv[argi]);
}
if (testflag) { GSM::TestTCHL1FEC(); return 0; }
}
createStats();
gConfig.setCrossCheckHook(&configurationCrossCheck);
gReports.incr("OpenBTS.Starts");
gNeighborTable.NeighborTableInit(
gConfig.getStr("Peering.NeighborTable.Path").c_str());
int sock = socket(AF_UNIX,SOCK_DGRAM,0);
if (sock<0) {
perror("creating CLI datagram socket");
LOG(ALERT) << "cannot create socket for CLI";
gReports.incr("OpenBTS.Exit.CLI.Socket");
exit(1);
}
try {
srandom(time(NULL));
gConfig.setUpdateHook(purgeConfig);
LOG(ALERT) << "OpenBTS (re)starting, ver " << VERSION << " build date " << __DATE__;
LOG(ALERT) << "OpenBTS reading config file "<<cOpenBTSConfigFile;
COUT("\n\n" << gOpenBTSWelcome << "\n");
Control::controlInit(); // init Layer3: TMSITable, TransactionTable.
gPhysStatus.open(gConfig.getStr("Control.Reporting.PhysStatusTable").c_str());
gBTS.init();
gParser.addCommands();
COUT("\nStarting the system...");
// is the radio running?
// Start the transceiver interface.
LOG(INFO) << "checking transceiver";
//gTRX.ARFCN(0)->powerOn();
//sleep(gConfig.getNum("TRX.Timeout.Start"));
//bool haveTRX = gTRX.ARFCN(0)->powerOn(false); This prints an inapplicable warning message.
bool haveTRX = gTRX.ARFCN(0)->trxRunning(); // This does not print an inapplicable warning message.
Thread transceiverThread;
if (!haveTRX) {
LOG(ALERT) << "starting the transceiver";
transceiverThread.start((void*(*)(void*)) startTransceiver, NULL);
// sleep to let the FPGA code load
// TODO: we should be "pinging" the radio instead of sleeping
sleep(5);
} else {
//.........这里部分代码省略.........